/* ============================================
   DAC — Global Mobile Responsive
   All pages · phones & tablets
   ============================================ */

/* ── Base & overflow safety ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


body,
.page-wrapper,
.page-content,
main {
  max-width: 100%;
  overflow-x: clip;
}

.container,
.container-fluid {
  max-width: 100%;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

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

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Touch targets ── */
@media (max-width: 768px) {
  .btn,
  .header__action-btn,
  .bottom-nav__item,
  .shop-category-pill,
  .occasion-deals__tab,
  .sale-trending__tab,
  .qty-btn {
    min-height: 34px;
  }

  .header__hamburger {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .sale-home .occasion-deals__swiper-wrap {
    padding-inline: 0;
  }

  .sale-home .favourite-card-modern {
    min-height: 280px;
  }

  .shop-hero__stats {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .shop-hero__inner {
    padding-block: var(--space-10);
  }

  .product-gallery__thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .footer{
    padding-bottom: 70px;
  }
  /* Promo strip — scroll instead of overflow */
  .sale-home .ladies-promo-strip {
    display: flex;
    justify-content: flex-start;
    gap: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sale-home .ladies-promo-strip::-webkit-scrollbar {
    display: none;
  }

  /* Hero */
  .sale-home .hero-banner-section {
    margin-top: 0;
  }

  .sale-home .hero-slide__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .sale-home .hero-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .sale-home .hero-slide__desc {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  /* Section headers */
  .sale-home .section-header-modern,
  .sale-home .occasion-deals__header {
    margin-bottom: 1.5rem !important;
  }

  .sale-home .section-title-modern {
    font-size: clamp(1.65rem, 6vw, 2rem) !important;
  }

  .sale-home .section-subtitle,
  .sale-home .occasion-deals__subtitle {
    font-size: 0.9rem !important;
    padding-inline: 0.5rem;
  }

  /* Category cards — single column on small tablets */
  .sale-home .favourite-card-modern {
    min-height: 240px;
  }

  .sale-home .favourite-overlay {
    padding: 1.25rem !important;
  }

  /* New arrivals circular cards */
  .sale-home .new-arrival-circular-card .circular-product-image {
    width: 120px !important;
    height: 120px !important;
  }

  .sale-home .fresh-products-swiper .swiper-button-prev,
  .sale-home .fresh-products-swiper .swiper-button-next {
    display: none;
  }

  /* Occasion deals swiper */
  .sale-home .occasion-deals__tabs-wrap {
    margin-inline: -0.5rem;
    padding-inline: 0.5rem;
  }

  .sale-home .occasion-deals__arrow {
    display: none;
  }

  .sale-home .occasion-deal-card__actions {
    flex-direction: column;
  }

  .sale-home .occasion-deal-card__wish {
    width: 100%;
    height: 40px;
  }

  /* Trending tabs — horizontal scroll */
  .sale-home .sale-trending__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-inline: -0.5rem;
    padding-inline: 0.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sale-home .sale-trending__tabs::-webkit-scrollbar {
    display: none;
  }

  .sale-home .sale-trending__tab {
    flex-shrink: 0;
  }

  .sale-home .sale-trending__swiper-wrap,
  .sale-home .sale-bestsellers .sale-trending__swiper-wrap {
    padding-inline: 0 !important;
  }

  /* New season swiper */
  .sale-home .sale-new-arrivals__title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .sale-home .sale-new-arrivals__subtitle {
    font-size: 0.9rem;
  }

  /* Shop the look */
  .sale-home .shop-the-look-video .section-header-modern {
    text-align: center;
  }

  .sale-home .shop-look-video-card__media {
    min-height: 320px;
  }

  .sale-home .shop-look-video-card__title {
    font-size: 1.5rem;
  }

  /* Cart offcanvas full width on mobile */
  .cart-offcanvas {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cart-item {
    grid-template-columns: 72px 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .cart-item-image {
    width: 72px;
    height: 72px;
  }

  .cart-item-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .size-selector {
    width: 100%;
    max-width: 120px;
  }

  /* Catalog / shop pages */
  .catalog-page .shop-hero__title,
  .shop-hero__title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  .catalog-page .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .catalog-page .shop-toolbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-page .shop-categories__track {
    margin-inline: -1rem;
    padding-inline: 1rem;
  }

  /* Product detail */
  .product-detail {
    gap: var(--space-8);
  }

  .product-info__title {
    font-size: var(--text-2xl);
  }

  .product-info__actions {
    position: sticky;
    bottom: calc(var(--mobile-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
    z-index: 10;
    background: var(--bg-primary);
    padding: var(--space-4) 0;
    margin-inline: calc(-1 * var(--space-4));
    padding-inline: var(--space-4);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  }

  /* Cart page */
  .cart-layout {
    gap: var(--space-8);
  }

  .cart-summary {
    position: static;
  }

  /* Checkout */
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    order: -1;
  }

  /* Auth */
  .auth-card {
    padding: var(--space-8) var(--space-6);
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-detail__hero {
    min-height: 240px;
  }

  /* About */
  .about-hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  /* Footer */
  .footer__newsletter-form {
    flex-direction: column;
  }

  .footer__newsletter-form .btn {
    width: 100%;
  }

  /* Newsletter component */
  .newsletter__inner {
    flex-direction: column;
    text-align: center;
  }

  .newsletter__form {
    width: 100%;
    max-width: 100%;
  }

  /* Compare page */
  .compare-table-wrap {
    margin-inline: calc(-1 * var(--space-4));
    padding-inline: var(--space-4);
  }

  .compare-table {
    min-width: 560px;
  }

  /* Product tabs — scroll on narrow screens */
  .product-tabs__nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--space-4);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .product-tabs__nav::-webkit-scrollbar {
    display: none;
  }

  .product-tabs__btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: var(--text-xs);
  }

  /* Contact */
  .contact-layout {
    gap: var(--space-8);
  }

  .contact-info-card {
    padding: var(--space-6);
  }

  /* FAQ accordion */
  .faq-item__question {
    font-size: var(--text-sm);
    padding: var(--space-4) var(--space-5);
  }

  /* Order tracking */
  .tracking-form {
    padding-inline: var(--space-4);
  }

  /* Lookbook scroll */
  .lookbook-scroll {
    margin-inline: calc(-1 * var(--space-4));
    padding-inline: var(--space-4);
  }

  /* Policy pages */
  .policy-content {
    padding-inline: var(--space-4);
  }

  /* 404 */
  .error-page__title {
    font-size: clamp(3rem, 15vw, 6rem);
  }

  /* Preloader */
  .preloader__word {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }

  /* Bootstrap grid overrides on home */
  .sale-home .row.g-4 {
    --bs-gutter-y: 1rem;
  }

  .sale-home .container {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
  }

  .sale-home .favourite-card-modern {
    min-height: 220px;
  }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
  .sale-home .occasion-deals__tab {
    padding: 0.5rem 0.8rem;
  }

  .sale-home .occasion-deal-card__media {
    aspect-ratio: 4 / 5;
  }

  .sale-home .occasion-deals__tab {
    min-width: auto;
  }

  .sale-home .occasion-deals__tab-label {
    font-size: 8px;
  }

  .product-grid,
  .product-grid--3,
  .product-grid--bestsellers,
  .wishlist-grid,
  .catalog-page .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .sale-home .product-card__info,
  .catalog-page .product-card__info {
    padding: 0.65rem !important;
  }

  .sale-home .product-card__name,
  .catalog-page .product-card__name {
    font-size: 0.8rem !important;
  }

  .sale-home .product-card__price,
  .catalog-page .product-card__price {
    font-size: 0.85rem !important;
  }

  .sale-home .product-card__quick-add {
    font-size: 9px;
    padding: 0.5rem;
  }

  .sale-home .hero-swiper {
    height: 85vh !important;
  }

  .sale-home .hero-slide__title {
    font-size: 1.65rem !important;
  }

  .sale-home .hero-slide__tag {
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .cart-item {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }

  .cart-delete-btn {
    grid-column: 2;
    justify-self: end;
  }

  .shop-hero {
    min-height: 220px !important;
  }

  .shop-hero__desc {
    font-size: 0.9rem;
  }

  .mega-menu__toolbar-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── Extra small (≤360px) ── */
@media (max-width: 360px) {
  .header__actions-group {
    gap: 2px;
  }

  .header__action-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .sale-home .new-arrival-circular-card .circular-product-image {
    width: 100px !important;
    height: 100px !important;
  }

  .bottom-nav__item {
    font-size: 9px;
  }

  .bottom-nav__item i {
    font-size: 1.1rem;
  }
}

/* ── Safe area (notched phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .page-content {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .cart-offcanvas .cart-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Landscape phones ── */
@media (max-height: 500px) and (orientation: landscape) {
  .sale-home .hero-swiper {
    height: 100vh !important;
    min-height: 320px !important;
  }

  .preloader__inner {
    transform: scale(0.85);
  }
}
