@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4F46E5;
  /* Indigo 600 */
  --primary-hover: #4338CA;
  /* Indigo 700 */
  --secondary: #10B981;
  /* Emerald 500 */
  --bg-color: #F9FAFB;
  /* Gray 50 */
  --text-main: #111827;
  /* Gray 900 */
  --text-muted: #6B7280;
  /* Gray 500 */
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  /* Gray 200 */
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

.cart-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background-color: var(--secondary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  min-width: 1.25rem;
  text-align: center;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  min-height: calc(100vh - 200px);
}

main.product-main {
  max-width: 98%;
  padding: 0 1%;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-radius: var(--radius);
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

/* Categories */
.categories-row {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}

.categories-row::-webkit-scrollbar {
  height: 6px;
}

.categories-row::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.categories-row::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  cursor: pointer;
}

.category-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  background-color: #f3f4f6;
}

.category-item:hover .category-img {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.category-name {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* Products Grid */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #f3f4f6;
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.product-card .btn {
  margin-top: auto;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

/* Product Detail Page */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.product-detail-img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  background-color: #f3f4f6;
  aspect-ratio: 1;
  margin-bottom: 1rem;
}

.product-gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.gallery-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.gallery-thumbnail:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.product-option {
  margin-bottom: 1rem;
}

.product-option label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.product-detail-price {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.product-detail-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Cart Page */
.cart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.cart-items {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 1.5rem;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.cart-item-price {
  color: var(--text-muted);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-right: 2rem;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.cart-item-remove {
  color: #EF4444;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 500;
}

.cart-summary {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2rem;
}

/* Checkout */
.checkout-form {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Footer */
footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: auto;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-4 {
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
  }

  .cart-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .product-title {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .product-price {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .product-info {
    padding: 0.75rem;
  }

  .product-card .btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* New Promo Slider */
.promo-slider-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 4rem auto;
  padding: 0 1rem;
}

.slider-track {
  display: flex;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
}

.slider-track img {
  flex: 0 0 100%;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 1599 / 750;
  display: block;
}

/* Navigation Arrows */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.slider-btn:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: 20px;
}

.next-btn {
  right: 20px;
}

@media (max-width: 768px) {
  .slider-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .prev-btn {
    left: 10px;
  }

  .next-btn {
    right: 10px;
  }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D1D5DB;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dots .dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.categories-row {
  /* Hide scrollbar for Chrome, Safari and Opera */
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.categories-row::-webkit-scrollbar {
  display: none;
}

/* Product Detail Page */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1%;
}

.product-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.product-detail-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: block;
}

.product-gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.product-gallery::-webkit-scrollbar {
  display: none;
}

.gallery-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery-thumbnail:hover {
  border-color: var(--primary);
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.product-detail-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.product-detail-price {
  font-size: 1.75rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.product-detail-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2rem;
  width: 100%;
  word-wrap: break-word;
}

.read-more-btn {
  display: none;
}

.buy-now-btn {
  width: 200px;
  margin-top: 1rem;
}

@media (max-width: 992px) {
  .product-detail {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.5rem;
    padding: 1rem;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
  }

  main.product-main {
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
  }

  .product-detail-title {
    font-size: 1.75rem;
  }

  .product-detail-price {
    font-size: 1.5rem;
  }

  .product-detail-desc {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
  }

  .product-detail-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
  }

  .read-more-btn {
    display: inline-block;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
  }

  .read-more-btn.hidden {
    display: none !important;
  }

  .buy-now-btn {
    width: 100%;
  }

  .product-gallery-container {
    align-items: center;
    width: 100%;
    max-width: 100%;
  }

  .product-detail-img {
    max-width: 100%;
    margin: 0 auto;
    height: auto;
  }

  .product-gallery {
    gap: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .gallery-thumbnail {
    flex: 0 0 calc(25% - 0.375rem);
    height: auto;
    aspect-ratio: 1/1;
    scroll-snap-align: start;
    width: auto;
  }
}