/* ==========================================
   ISKCON Ratlam - Store Stylesheet
   Store-specific styles for products, cart, and checkout
   ========================================== */

/* ========== Store Hero Section ========== */
.store-hero {
  background: linear-gradient(135deg, rgba(230, 81, 0, 0.9) 0%, rgba(255, 179, 0, 0.9) 100%),
    url('../public/hero_bg.png') center center / cover no-repeat;
  color: var(--color-white);
  padding: 5rem var(--spacing-md);
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-hero h1 {
  color: var(--color-white);
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.store-hero p {
  color: var(--color-white);
  font-size: 1.3rem;
  opacity: 0.95;
}

/* ========== Category Filter ========== */
.category-filter {
  background-color: var(--color-light);
  padding: var(--spacing-lg) 0;
  position: sticky;
  top: 70px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-buttons {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--color-white);
  color: var(--color-dark);
  border: 2px solid var(--color-gray-light);
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.filter-btn:hover {
  background-color: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-dark);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  border-color: var(--color-saffron);
  color: var(--color-white);
}

/* ========== Products Grid ========== */
.products-section {
  padding: var(--spacing-2xl) 0;
  background-color: var(--color-white);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.product-card {
  background-color: var(--color-white);
  border: 2px solid var(--color-gray-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  border-color: var(--color-gold);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
  transform: translateY(-5px);
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background-color: var(--color-light);
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: var(--color-white);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.product-info {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  color: var(--color-saffron);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.product-name {
  color: var(--color-dark);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-description {
  color: var(--color-gray);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  color: var(--color-saffron);
  font-size: 1.5rem;
  font-weight: 700;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: var(--color-white);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.add-to-cart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.4);
}

.add-to-cart-btn:active {
  transform: scale(0.98);
}

.out-of-stock {
  opacity: 0.6;
  pointer-events: none;
}

.out-of-stock .add-to-cart-btn {
  background: var(--color-gray);
  cursor: not-allowed;
}

/* ========== Floating Cart Icon ========== */
.cart-icon {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(230, 81, 0, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
}

.cart-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(230, 81, 0, 0.6);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #dc3545;
  color: var(--color-white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--color-white);
}

/* ========== Cart Sidebar ========== */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background-color: var(--color-white);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: var(--color-white);
  padding: var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-cart {
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-cart:hover {
  opacity: 0.8;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.cart-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-gray-light);
  align-items: center;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-name {
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.cart-item-price {
  color: var(--color-saffron);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  background-color: var(--color-light);
  border: 1px solid var(--color-gray-light);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background-color: var(--color-gold);
  border-color: var(--color-gold);
}

.qty-display {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.remove-item-btn {
  background-color: #dc3545;
  color: var(--color-white);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
}

.remove-item-btn:hover {
  background-color: #c82333;
}

.empty-cart {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--color-gray);
}

.empty-cart-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.cart-footer {
  border-top: 2px solid var(--color-gray-light);
  padding: var(--spacing-lg);
  background-color: var(--color-light);
}

.cart-summary {
  margin-bottom: var(--spacing-md);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-saffron);
  padding-top: 0.5rem;
  border-top: 2px solid var(--color-gray-light);
  margin-top: 0.5rem;
}

.checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: var(--color-white);
  border: none;
  padding: var(--spacing-md);
  border-radius: 25px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: var(--spacing-sm);
}

.checkout-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.clear-cart-btn {
  width: 100%;
  background-color: var(--color-gray);
  color: var(--color-white);
  border: none;
  padding: 0.75rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-cart-btn:hover {
  background-color: #dc3545;
}

/* ========== Checkout Modal ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--color-white);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: var(--color-white);
  padding: var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
  margin: 0;
  color: var(--color-white);
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.close-modal:hover {
  opacity: 0.8;
}

.modal-body {
  padding: var(--spacing-lg);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.order-summary-box {
  background-color: var(--color-light);
  padding: var(--spacing-lg);
  border-radius: var(--radius);
  margin: var(--spacing-lg) 0;
}

.order-summary-box h3 {
  color: var(--color-saffron);
  margin-bottom: var(--spacing-md);
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-gray-light);
  font-size: 0.9rem;
}

.order-item:last-child {
  border-bottom: none;
}

.submit-order-btn {
  width: 100%;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: var(--color-white);
  border: none;
  padding: var(--spacing-md);
  border-radius: 25px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: var(--spacing-md);
}

.submit-order-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  .store-hero h1 {
    font-size: 2rem;
  }

  .store-hero p {
    font-size: 1.1rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
  }

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .cart-icon {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
  }

  .filter-buttons {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .store-hero {
    padding: 3rem var(--spacing-sm);
    min-height: 200px;
  }

  .store-hero h1 {
    font-size: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: var(--spacing-sm);
  }

  .modal-content {
    max-height: 95vh;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
