/* ========================================
   HOMEPAGE STYLES - GRID FIXES AND ENHANCEMENTS
   ======================================== */

/* Horizontal Categories Section - Refined */
.categories-horizontal-section {
  padding: 4rem 0 4.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
}

/* Section header */
.categories-section-header {
  margin-bottom: 2.5rem;
}

.categories-section-header .section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7C4A85;
  background: rgba(124, 74, 133, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.875rem;
}

.categories-section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.categories-section-header p {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Card — premium tile */
.categories-horizontal-section .category-horizontal-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  animation: fadeInUp 0.5s ease-out backwards;
  position: relative;
  overflow: hidden;
  height: 100%;
  padding: 0;
}

.categories-horizontal-section .category-horizontal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.categories-horizontal-section .category-horizontal-card:hover {
  border-color: var(--cat-accent, #7C4A85);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
  transform: translateY(-4px);
  text-decoration: none;
}

/* Visual — icon slot (category images are 64×64) */
.categories-horizontal-section .category-horizontal-visual {
  width: 100%;
  height: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  position: relative;
  background: var(--cat-bg, #f1f5f9);
  transition: background 0.25s ease;
}

.categories-horizontal-section .category-horizontal-card--image .category-horizontal-visual {
  height: 88px;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-visual {
  background: var(--cat-bg, #f1f5f9);
}

.categories-horizontal-section .category-horizontal-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-icon-wrap {
  transform: scale(1.06);
  background: var(--cat-accent, #7C4A85);
}

.categories-horizontal-section .category-horizontal-icon {
  font-size: 1.625rem;
  color: var(--cat-icon, #7C4A85);
  transition: color 0.25s ease;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-icon {
  color: #ffffff;
}

.categories-horizontal-section .category-horizontal-image {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

/* Body */
.categories-horizontal-section .category-horizontal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem 1rem;
  gap: 0.625rem;
}

.categories-horizontal-section .category-horizontal-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-name {
  color: var(--cat-accent, #4A2E4D);
}

.categories-horizontal-section .category-horizontal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.categories-horizontal-section .category-horizontal-count {
  font-size: 0.6875rem;
  color: #64748b;
  font-weight: 600;
  background: #f8fafc;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-count {
  background: color-mix(in srgb, var(--cat-accent, #7C4A85) 10%, white);
  border-color: color-mix(in srgb, var(--cat-accent, #7C4A85) 25%, white);
  color: var(--cat-icon, #4A2E4D);
}

.categories-horizontal-section .category-horizontal-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.6875rem;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.categories-horizontal-section .category-horizontal-card:hover .category-horizontal-arrow {
  background: var(--cat-accent, #7C4A85);
  color: #ffffff;
  transform: translateX(2px);
}

/* "View All Categories" CTA */
.categories-horizontal-section .btn.btn-outline-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border: 1.5px solid #7C4A85;
  border-radius: 999px;
  background: transparent;
  color: #7C4A85;
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: 0 1px 2px rgba(124, 74, 133, 0.06);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.categories-horizontal-section .btn.btn-outline-primary:hover {
  background: linear-gradient(135deg, #7C4A85 0%, #4A2E4D 100%);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(124, 74, 133, 0.3);
}

.categories-horizontal-section .btn.btn-outline-primary i {
  transition: transform 0.2s ease;
}

.categories-horizontal-section .btn.btn-outline-primary:hover i {
  transform: translateX(3px);
}

/* Animation for fade-in */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .categories-horizontal-section .category-horizontal-body {
    padding: 0.625rem 0.625rem 0.75rem;
    gap: 0.375rem;
  }

  .categories-horizontal-section .category-horizontal-name {
    font-size: 0.75rem;
    min-height: 2.6em;
  }

  .categories-horizontal-section .category-horizontal-visual {
    height: 76px;
    padding: 6px;
  }

  .categories-horizontal-section .category-horizontal-card--image .category-horizontal-visual {
    height: 76px;
  }
}

@media (max-width: 768px) {
  .categories-horizontal-section .category-horizontal-card:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  }
}

@media (max-width: 576px) {
  .categories-horizontal-section {
    padding: 2rem 0;
  }

  .categories-horizontal-section .category-horizontal-footer {
    flex-wrap: nowrap;
    gap: 0.375rem;
  }

  .categories-horizontal-section .category-horizontal-count {
    font-size: 0.625rem;
    padding: 0.2rem 0.45rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .categories-horizontal-section .category-horizontal-arrow {
    width: 24px;
    height: 24px;
    font-size: 0.625rem;
  }
}

/* Homepage card grids — 2 per row on mobile (padding gutters, no flex gap overflow) */
.categories-horizontal-section .categories-home-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: -6px !important;
  margin-right: -6px !important;
  row-gap: 0.625rem;
  gap: 0 !important;
}

.categories-horizontal-section .categories-home-grid > [class*="col-"] {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.categories-home-grid,
.brands-home-grid,
.featured-home-grid,
.products-home-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
  row-gap: 0.75rem;
  gap: 0 !important;
}

.categories-home-grid > [class*="col-"],
.brands-home-grid > [class*="col-"],
.featured-home-grid > [class*="col-"],
.products-home-grid > [class*="col-"] {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

@media (max-width: 575.98px) {
  .categories-home-grid > .col-6,
  .brands-home-grid > .col-6,
  .featured-home-grid > .col-6,
  .products-home-grid > .col-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .categories-home-grid > .col-sm-4,
  .brands-home-grid > .col-sm-4,
  .products-home-grid > .col-sm-4 {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .categories-home-grid > .col-md-3,
  .brands-home-grid > .col-md-3,
  .products-home-grid > .col-md-3,
  .featured-home-grid > .col-md-4 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
  }
}

@media (min-width: 992px) {
  .categories-home-grid > .col-lg-2,
  .brands-home-grid > .col-lg-2,
  .featured-home-grid > .col-lg-2,
  .products-home-grid > .col-lg-2 {
    flex: 0 0 16.666667% !important;
    max-width: 16.666667% !important;
  }
}

/* ===========================================================
   Homepage product sections — shared header + card tiles
   =========================================================== */
.featured-products-section {
  padding: 4rem 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.latest-products-section {
  padding: 4rem 0;
  background: #ffffff;
}

.home-products-section-header {
  margin-bottom: 2.5rem;
}

.home-products-section-header .section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7C4A85;
  background: rgba(124, 74, 133, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.875rem;
}

.home-products-section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.home-products-section-header p {
  color: #64748b;
  font-size: 1rem;
  margin: 0 auto;
  max-width: 560px;
}

/* Product card — premium tile (matches category cards) */
.featured-products-section .home-product-card,
.latest-products-section .home-product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  animation: fadeInUp 0.5s ease-out backwards;
}

.featured-products-section .home-product-card:hover,
.latest-products-section .home-product-card:hover {
  border-color: #7C4A85;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
  transform: translateY(-4px);
  text-decoration: none;
  color: inherit;
}

.home-product-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: hidden;
}
.home-product-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.home-card-wishlist,
.home-card-compare {
  position: absolute;
  top: 0.625rem;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8125rem;
  cursor: pointer;
  z-index: 2;
  transition: all 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.home-card-wishlist { right: 0.625rem; }
.home-card-compare { left: 0.625rem; }
.home-card-wishlist:hover { color: #ef4444; border-color: #fecaca; transform: scale(1.05); }
.home-card-wishlist.active { color: #ef4444; }
.home-card-compare:hover { color: #7C4A85; border-color: #f0c4ce; transform: scale(1.05); }
.home-card-compare.active { color: #7C4A85; }
.home-product-brand {
  text-decoration: none;
}
.home-product-brand:hover { text-decoration: underline; }
.home-product-name {
  text-decoration: none;
  color: inherit;
}

.home-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.875rem;
  transition: transform 0.35s ease;
}

.home-product-card:hover .home-product-image {
  transform: scale(1.04);
}

.home-product-badge {
  position: absolute;
  z-index: 2;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.home-product-badge--new {
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.home-product-badge--offers {
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.home-product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.875rem 1rem 1rem;
  gap: 0.375rem;
}

.home-product-brand {
  font-size: 0.625rem;
  font-weight: 700;
  color: #7C4A85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-product-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  transition: color 0.2s ease;
}

.home-product-card:hover .home-product-name {
  color: #4A2E4D;
}

.home-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.375rem;
}

.home-product-pricing {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.home-product-price {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.home-product-price sup.curreny {
  font-size: 0.625rem;
  font-weight: 700;
}

.home-product-time {
  font-size: 0.625rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.home-product-time i {
  font-size: 0.5625rem;
}

.home-product-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1;
}

.home-product-stars {
  color: #FFC107;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
}

.home-product-stars .fa-star,
.home-product-stars .fa-star-half-alt {
  font-size: 0.6875rem;
}

.home-product-rating-value {
  font-weight: 600;
  color: #0f172a;
}

.home-product-rating-count {
  color: #94a3b8;
}

.home-product-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.6875rem;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.home-product-card:hover .home-product-arrow {
  background: #7C4A85;
  color: #ffffff;
  transform: translateX(2px);
}

.stagger-children > [class*="col-"]:nth-child(1) .home-product-card { animation-delay: 0.04s; }
.stagger-children > [class*="col-"]:nth-child(2) .home-product-card { animation-delay: 0.08s; }
.stagger-children > [class*="col-"]:nth-child(3) .home-product-card { animation-delay: 0.12s; }
.stagger-children > [class*="col-"]:nth-child(4) .home-product-card { animation-delay: 0.16s; }
.stagger-children > [class*="col-"]:nth-child(5) .home-product-card { animation-delay: 0.2s; }
.stagger-children > [class*="col-"]:nth-child(6) .home-product-card { animation-delay: 0.24s; }

@media (max-width: 768px) {
  .featured-products-section,
  .latest-products-section {
    padding: 2.5rem 0;
  }

  .home-products-section-header h2 {
    font-size: 1.5rem;
  }

  .home-product-body {
    padding: 0.625rem 0.75rem 0.75rem;
  }

  .home-product-name {
    font-size: 0.75rem;
    min-height: 2.5em;
  }

  .home-product-price {
    font-size: 0.875rem;
  }

  .home-product-image {
    padding: 0.625rem;
  }

  .home-product-badge {
    font-size: 0.5625rem;
    padding: 0.2rem 0.45rem;
  }

  .home-product-arrow {
    width: 24px;
    height: 24px;
    font-size: 0.625rem;
  }

  .featured-products-section .home-product-card:hover,
  .latest-products-section .home-product-card:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  }
}

@media (max-width: 575px) {
  .home-products-section-header p {
    font-size: 0.9375rem;
  }

  .home-product-time {
    font-size: 0.5625rem;
  }
}

/* Enhanced Bootstrap Grid Fixes — brands rows only */
.brands-section .row {
  display: flex !important;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}

/* Responsive column widths (legacy section grid) */
@media (min-width: 1200px) {
  .categories-horizontal-section .col-lg-2 {
    flex: 0 0 15%;
    max-width: 16.666667%;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .categories-horizontal-section .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .categories-horizontal-section .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .categories-horizontal-section .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 575px) {
  .categories-horizontal-section .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Brands Section — 6 per row (matches categories grid) */
.brands-grid-container {
  overflow: hidden;
}

.brands-section .row {
  display: flex !important;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
  row-gap: 1rem;
}

.brands-section .col-6,
.brands-section .col-sm-4,
.brands-section .col-md-3,
.brands-section .col-lg-2,
.brands-section .col-xl-2 {
  padding-right: 12px;
  padding-left: 12px;
  flex: 0 0 auto;
}

.brands-section .col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

@media (min-width: 576px) {
  .brands-section .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (min-width: 768px) {
  .brands-section .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (min-width: 992px) {
  .brands-section .col-lg-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
}

@media (min-width: 1200px) {
  .brands-section .col-xl-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
}

.brands-section .brand-card {
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gray-200, #e2e8f0);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.brands-section .brand-card:hover {
  border-color: #7C4A85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 74, 133, 0.1);
}

.brands-section .brand-card-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7C4A85 0%, #4A2E4D 100%);
  border-radius: 6px;
}

.brands-section .brand-initial {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.brands-section .brand-card-content {
  flex: 1;
  min-width: 0;
}

.brands-section .brand-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-900, #0f172a);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brands-section .brand-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #7C4A85;
  font-weight: 500;
}

@media (max-width: 575px) {
  .brands-section .brand-card {
    padding: 0.75rem;
    gap: 0.625rem;
  }

  .brands-section .brand-card-icon {
    width: 40px;
    height: 40px;
  }

  .brands-section .brand-name {
    font-size: 0.8125rem;
  }
}

/* How It Works — 3 cards per row (CSS grid handles gap correctly) */
.how-it-works-grid-container {
  overflow: hidden;
}

.how-it-works .how-it-works-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 !important;
}

@media (min-width: 768px) {
  .how-it-works .how-it-works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.how-it-works .how-it-works-grid > [class*="col-"] {
  padding: 0 !important;
  flex: unset !important;
  max-width: none !important;
  width: auto !important;
  min-width: 0;
}

.how-it-works .step-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: #6c757d;
  margin-bottom: 0;
}

/* Spacing Utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mt-6 { margin-top: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-6 { margin-bottom: 4rem; }
.mt-auto { margin-top: auto; }

/* Gap Utilities */
.g-3 { gap: 1rem; }
.g-4 { gap: 1.5rem; }
.g-md-4 { gap: 1.5rem; }

/* Flexbox Utilities */
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.text-center { text-align: center !important; }

/* Text Utilities */
.fw-bold { font-weight: 700 !important; }
.text-muted { color: #6c757d !important; }

/* Button Styles */
.btn {
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-outline-primary {
  color: #0d6efd;
  border-color: #0d6efd;
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Container Styles */
.container {
  width: 100%;
  padding-right: var(--bs-gutter-x, 0.75rem);
  padding-left: var(--bs-gutter-x, 0.75rem);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* =====================================================
   HOMEPAGE RESPONSIVE IMPROVEMENTS
   ===================================================== */

/* Hero search box - fluid width instead of fixed % */
.search-box {
  width: min(90%, 600px);
  margin: 0 auto;
}

@media (min-width: 992px) {
  .search-box {
    width: min(60%, 600px);
  }
}

@media (min-width: 1200px) {
  .search-box {
    width: min(50%, 600px);
  }
}

/* Fluid category grid */
.categories-grid-container {
  overflow: visible;
}

.categories-grid-container .categories-home-grid {
  row-gap: 0.625rem;
}

/* Category section — small screens */
@media (max-width: 575px) {
  .categories-section-header h2 {
    font-size: 1.5rem;
  }

  .categories-section-header p {
    font-size: 0.9375rem;
  }
}

@media (max-width: 400px) {
  .categories-horizontal-section {
    padding: 2.5rem 0 3rem;
  }
}

/* Section headers responsive fix */
@media (max-width: 575px) {
  .section-header h2 {
    font-size: 1.375rem;
  }

  .section-header p {
    font-size: 0.875rem;
  }
}

/* =====================================================
   HERO SEARCH BOX — REFINED UI
   ===================================================== */
.hero .search-box {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  transform: none;
}

.hero .search-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  transform: none;
}

.hero .search-box:focus-within {
  border-color: #7C4A85;
  box-shadow: 0 0 0 4px rgba(124, 74, 133, 0.15), 0 8px 24px rgba(124, 74, 133, 0.12);
  transform: none;
}

.hero .search-box .search-box-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 16px;
  width: 22px;
  flex-shrink: 0;
  pointer-events: none;
  transition: color 0.2s ease;
}

.hero .search-box:focus-within .search-box-icon {
  color: #7C4A85;
}

.hero .search-box input {
  flex: 1;
  border: none;
  padding: 14px 8px;
  font-size: 16px;
  line-height: 1.4;
  background: transparent;
  color: #0f172a;
  border-radius: 0;
  min-width: 0;
  text-align: left;
  width: auto;
}

.hero .search-box input:focus { outline: none; }

.hero .search-box input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 1;
}

.hero .search-box .search-box-clear {
  display: none;
  background: transparent;
  border: none;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 13px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.hero .search-box .search-box-clear:hover {
  background: #f1f5f9;
  color: #475569;
  transform: none;
  box-shadow: none;
}

.hero .search-box.has-value .search-box-clear {
  display: inline-flex;
}

.hero .search-box .search-box-submit {
  background: linear-gradient(135deg, #7C4A85 0%, #4A2E4D 100%);
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  flex-shrink: 0;
  width: auto;
  box-shadow: 0 2px 8px rgba(124, 74, 133, 0.25);
}

.hero .search-box .search-box-submit:hover {
  background: linear-gradient(135deg, #4A2E4D 0%, #3A243D 100%);
  box-shadow: 0 6px 16px rgba(124, 74, 133, 0.35);
  transform: translateY(-1px);
}

.hero .search-box .search-box-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(124, 74, 133, 0.25);
}

/* Refined popular searches under hero */
.hero .popular-searches {
  margin-top: 1.25rem;
  gap: 8px;
  align-items: center;
}

.hero .popular-searches span {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.875rem;
}

.hero .popular-searches a {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 0.375rem 0.875rem;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.hero .popular-searches a:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Mobile: keep horizontal layout, just tighten paddings (override modern-frontend.css stack) */
@media (max-width: 768px) {
  .hero .search-box {
    flex-direction: row;
    align-items: center;
    padding: 5px 5px 5px 12px;
    border-radius: 12px;
  }

  .hero .search-box input {
    text-align: left;
    padding: 12px 6px;
    font-size: 15px;
    width: auto;
    border-radius: 0;
  }

  .hero .search-box .search-box-submit {
    width: auto;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 14px;
  }

  .hero .search-box .search-box-icon {
    width: 18px;
    font-size: 15px;
  }
}

/* Product card touch target */
@media (max-width: 767px) {
  .product-card {
    min-height: 0;
  }

  .product-card a {
    padding: 2px;
    display: block;
  }
}