/* =========================================================
   GlowWithBella – Responsive CSS  (mobile-first overrides)
   Breakpoints:
     < 374px  : Mobile Small
     < 768px  : Mobile
     768-1023px: Tablet
     1024-1439px: Desktop
     1440px+  : Large Desktop
   ========================================================= */

/* =========================================================
   GLOBAL RESETS FOR ALL SCREENS
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent horizontal scroll site-wide */
html, body { max-width: 100%; overflow-x: hidden; }

/* =========================================================
   PRODUCT CARD — base constraints (all screens)
   ========================================================= */
.product-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.product-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-bg, #f9f9f9);
  width: 100%;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Carousel items — always constrained */
.product-carousel__item {
  flex-shrink: 0;
  flex-grow: 0;
  min-width: 0; /* prevent flex blowout */
  width: calc(25% - 12px);
}

/* =========================================================
   LARGE DESKTOP  ≥ 1440px
   ========================================================= */
@media (min-width: 1440px) {
  .container { max-width: 1360px; }
  .hero-slider__slide { min-height: 520px; }
}

/* =========================================================
   TABLET  768px – 1023px
   ========================================================= */
@media (max-width: 1023px) {
  /* Layout */
  .container { padding: 0 var(--space-5, 20px); }

  /* Category */
  .category-grid { grid-template-columns: repeat(3, 1fr); }

  /* Product */
  .product-carousel__item {
    flex: 0 0 calc(33.333% - 11px) !important;
    width: calc(33.333% - 11px) !important;
    max-width: calc(33.333% - 11px) !important;
    min-width: 0 !important;
  }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .products-grid .products { grid-template-columns: repeat(2, 1fr) !important; }

  /* Shop */
  .shop-layout { grid-template-columns: 200px 1fr; gap: var(--space-5, 20px); }

  /* Product single */
  .product-single { grid-template-columns: 1fr; }
  .product-single__gallery { position: static; }
  .product-single__sale-price { font-size: var(--font-size-2xl, 1.5rem); }

  /* Footer */
  .footer-main__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6, 24px); }
  .footer-trust__inner { grid-template-columns: repeat(3, 1fr); }

  /* Misc */
  .combo-banners__grid { grid-template-columns: 1fr 1fr; }
  .fabric-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-slider__slide { min-height: 360px; }
  .hero-slider__title { font-size: 2.2rem; }
  .mega-menu { min-width: 300px; }
}

/* =========================================================
   MOBILE  < 768px
   ========================================================= */
@media (max-width: 767px) {

  /* ---- Container ---- */
  .container { padding: 0 var(--space-4, 16px); }

  /* ---- Top Bar ---- */
  .top-bar__trust { display: none; }
  .top-bar__left  { display: none; }
  .top-bar { font-size: 11px; padding: 6px 0; }
  .top-bar__right { width: 100%; justify-content: center; }

  /* ---- Header ---- */
  .main-nav { display: none; }
  .hamburger-btn { display: flex; }
  .bottom-nav { display: block; }
  .header__inner { padding: 10px 0; gap: 10px; flex-wrap: nowrap; }
  .action-btn__label { display: none; }
  .header__action--wishlist { display: flex; } /* keep wishlist visible */
  .header__search { order: 3; flex: 1; max-width: 100%; }
  .site-main { padding-bottom: 64px; }

  /* ---- Mini Cart ---- */
  .mini-cart { width: 100vw; max-width: 100%; }

  /* ---- Hero ---- */
  .hero-slider { border-radius: 0; }
  .hero-slider__slide {
    min-height: 240px;
    background-position: center top;
  }
  .hero-slider__title { font-size: 1.5rem; line-height: 1.2; }
  .hero-slider__subtitle { font-size: 0.8rem; }
  .hero-slider__content { padding: var(--space-6, 24px) var(--space-4, 16px); }
  .hero-slider__content .btn { padding: 0.55rem 1.1rem; font-size: 0.75rem; }
  .hero-slider__btn { width: 34px; height: 34px; }
  .hero-slider__dots { bottom: 8px; }

  /* ---- Category Grid ---- */
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3, 12px);
  }
  .category-card__circle { width: 68px; height: 68px; }
  .category-card__name { font-size: 11px; }
  .category-card__count { display: none; }

  /* ---- Offer Strip ---- */
  .offer-strip__inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 0.8rem;
  }

  /* ---- Product Carousel (Best Sellers etc.) ---- */
  .product-carousel__track { gap: 10px !important; }
  .product-carousel__item {
    flex: 0 0 calc(50% - 5px) !important;
    width: calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    min-width: 0 !important;
    overflow: hidden;
  }
  .carousel-btn { display: none !important; } /* use swipe on mobile */

  /* ---- Product Grid (New Arrivals etc.) ---- */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3, 12px);
  }

  /* ---- Product Card ---- */
  .product-card__name {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-card__sale-price { font-size: 0.85rem; }
  .product-card__reg-price  { font-size: 0.72rem; }
  .product-card__info { padding: 8px 6px 10px; }
  .product-card__hover-actions { opacity: 1; transform: none; position: static; background: none; padding: 0; }
  .product-card__quick-add {
    font-size: 0.72rem;
    padding: 6px 8px;
    width: 100%;
    margin-top: 6px;
  }

  /* ---- Section headings ---- */
  .section { padding: var(--space-8, 40px) 0; }
  .section-title { font-size: 1.3rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-header .btn { font-size: 0.78rem; padding: 6px 14px; }

  /* ---- Combo Banners ---- */
  .combo-banners__grid { grid-template-columns: 1fr; }
  .combo-card { min-height: 140px; }

  /* ---- Fabric Grid ---- */
  .fabric-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3, 12px); }

  /* ---- Trust Section ---- */
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4, 16px); }
  .trust-item__icon { width: 48px; height: 48px; }
  .trust-item__title { font-size: 0.85rem; }

  /* ---- Newsletter ---- */
  .homepage-newsletter__inner { flex-direction: column; text-align: center; }
  .homepage-newsletter__form { flex-direction: column; width: 100%; }
  .homepage-newsletter__form input { min-width: unset; width: 100%; }

  /* ---- Shop page ---- */
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar { display: none; }
  .shop-sidebar.mobile-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    background: #fff;
    padding: var(--space-5, 20px);
  }
  .mobile-filter-bar { display: flex; }
  .products-grid .products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3, 12px) !important;
  }

  /* ---- Product Detail ---- */
  .product-single { grid-template-columns: 1fr; gap: var(--space-5, 20px); }
  .product-single__sale-price { font-size: 1.3rem; }
  .sticky-cart-bar { display: flex; }
  .product-gallery__desktop { display: none; }
  .product-gallery__mobile { display: block; }
  .product-tabs .tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .product-tabs .tabs::-webkit-scrollbar { display: none; }

  /* ---- Cart ---- */
  .cart-collaterals { grid-template-columns: 1fr; }
  .shop_table { font-size: 0.85rem; }
  .shop_table .product-thumbnail { display: none; }

  /* ---- Checkout ---- */
  .checkout-wrap { flex-direction: column; }
  .checkout-details,
  .checkout-summary { width: 100%; }

  /* ---- My Account ---- */
  .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .woocommerce-MyAccount-navigation ul li a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .order-card { padding: var(--space-4, 16px); }
  .order-card__actions { flex-wrap: wrap; gap: 6px; }
  .order-card__actions .btn { font-size: 0.75rem; padding: 6px 12px; flex: 1; min-width: 100px; }

  /* ---- Order Timeline ---- */
  .order-timeline { overflow-x: auto; padding-bottom: 8px; }
  .order-timeline__inner { min-width: 480px; }
  .order-timeline__icon { width: 30px; height: 30px; font-size: 13px; }
  .order-timeline__label { font-size: 9px; }

  /* ---- Return / Exchange forms ---- */
  .return-exchange-form { padding: var(--space-4, 16px); }
  .form-submit-row { flex-direction: column; }
  .form-submit-row .btn { width: 100%; }

  /* ---- Footer ---- */
  .footer-newsletter__inner { flex-direction: column; }
  .footer-newsletter__input-group { flex-direction: column; }
  .footer-newsletter__input-group input { min-width: unset; width: 100%; }
  .footer-main__grid { grid-template-columns: 1fr; gap: var(--space-5, 20px); }
  .footer-trust__inner { grid-template-columns: repeat(2, 1fr); gap: var(--space-4, 16px); }
  .footer-payments__inner { flex-wrap: wrap; gap: 8px; }
  .footer-bottom__inner { flex-direction: column; text-align: center; gap: 8px; }

  /* ---- Back to top & misc ---- */
  .back-to-top { bottom: 72px; right: 12px; width: 38px; height: 38px; }
  .breadcrumb { font-size: 0.75rem; }
}

/* =========================================================
   MOBILE SMALL  < 374px
   ========================================================= */
@media (max-width: 374px) {
  .container { padding: 0 10px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card__circle { width: 58px; height: 58px; }
  .category-card__name { font-size: 10px; }
  .product-grid { gap: 8px; }
  .hero-slider__title { font-size: 1.25rem; }
  .product-carousel__item {
    flex: 0 0 calc(50% - 5px) !important;
    width: calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    min-width: 0 !important;
  }
  .section-title { font-size: 1.15rem; }
}

/* =========================================================
   WOOCOMMERCE — global button & form fixes
   ========================================================= */
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.woocommerce #respond input#submit {
  background: var(--color-primary, #E91E8C) !important;
  color: #fff !important;
  border-radius: var(--radius-full, 50px) !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  border: none !important;
  padding: 10px 24px !important;
  font-size: 0.875rem !important;
}

.woocommerce button.button:hover,
.woocommerce a.button:hover {
  background: var(--color-primary-dark, #c2177a) !important;
}

.woocommerce button.button.alt {
  background: var(--color-primary, #E91E8C) !important;
}

/* WooCommerce star ratings */
.star-rating span::before,
.woocommerce .star-rating span::before {
  color: var(--color-primary, #E91E8C);
}

/* WooCommerce form fields */
.woocommerce .woocommerce-Input,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="number"],
.woocommerce select,
.woocommerce textarea {
  border: 1px solid var(--color-border, #e0e0e0) !important;
  border-radius: var(--radius-md, 8px) !important;
  padding: 10px 14px !important;
  font-size: 0.875rem !important;
  width: 100% !important;
  transition: border-color 0.2s !important;
}

.woocommerce input:focus,
.woocommerce select:focus,
.woocommerce textarea:focus {
  border-color: var(--color-primary, #E91E8C) !important;
  outline: none !important;
}

/* Variation select */
.woocommerce div.product form.cart .variations select {
  min-width: 140px;
}

/* WC notices */
@media (max-width: 767px) {
  .woocommerce-notices-wrapper .woocommerce-message,
  .woocommerce-notices-wrapper .woocommerce-error,
  .woocommerce-notices-wrapper .woocommerce-info {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
}
