/* ==========================================================================
   ARY Chase Theme - Responsive Stylesheet
   Breakpoints: 1600px | 1400px | 1200px | 1024px | 992px | 768px | 576px | 480px | 390px | 320px
   ========================================================================== */

/* Prevent horizontal scrolling at ALL sizes (clip keeps position: sticky intact). */
html,
body {
  overflow-x: clip;
}

/* ===== Desktop (min-width: 1200px) =====
   Each narrower min-width rule runs first so the widest wins by cascade. */

@media (min-width: 1200px) {
  :root {
    --container-padding: 32px;
  }

  .site-header__inner {
    gap: 18px;
  }

  .header__search-bar-wrapper {
    max-width: 420px;
  }
}

/* ===== Desktop XL (min-width: 1400px) ===== */

@media (min-width: 1400px) {
  :root {
    --container-max-width: 1480px;
    --container-padding: 40px;
  }

  .site-header__inner {
    gap: 22px;
    padding: 13px 0;
  }

  .header__search-bar-wrapper {
    max-width: 520px;
  }

  .all-categories-nav__trigger {
    padding: 12px 18px;
  }
}

/* ===== Wide Desktop (min-width: 1600px) ===== */

@media (min-width: 1600px) {
  :root {
    --container-max-width: 1600px;
    --container-padding: 48px;
  }

  .site-header__inner {
    gap: 26px;
    padding: 14px 0;
  }

  .header__search-bar-wrapper {
    max-width: 620px;
  }

  .header__action-item-link svg {
    width: 24px;
    height: 24px;
  }
}

/* ===== Desktop (max-width: 1200px) ===== */

@media (max-width: 1200px) {
  :root {
    --container-padding: 30px;
  }

  .site-header__inner {
    gap: 14px;
  }

  .header__search-bar-wrapper {
    max-width: 300px;
  }

  .all-categories-nav__trigger {
    padding: 12px 14px;
  }

  .category-slider__wrapper {
    padding: 20px 30px;
    gap: 24px;
  }

  .category-slider__image {
    width: 130px;
    height: 130px;
  }

  .product-section__grid {
    gap: 16px;
  }

  .beauty-section__inner {
    gap: 24px;
  }

  .service-features__grid {
    gap: 20px;
  }

  /* 8 per view with larger gap */
  .corporate-clients__slider {
    gap: 28px;
  }

  .corporate-clients__item {
    width: calc((100% - 196px) / 8);
    height: 150px;
  }

  .corporate-clients__item img {
    max-height: 81px;
  }

  .site-footer__main {
    gap: 30px;
  }
}

/* ===== Tablet Landscape (max-width: 1024px) ===== */

@media (max-width: 1024px) {
  :root {
    --container-padding: 24px;
    --section-gap: 40px;
  }

  .site-header__inner {
    gap: 12px;
  }

  .header__search-bar-wrapper {
    flex: 1;
    max-width: none;
  }

  .header__action-item-title {
    display: none;
  }

  .all-categories-nav__trigger {
    font-size: var(--font-size-sm);
    padding: 11px 12px;
  }

  .site-footer__main {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .site-footer__bottom-inner {
    flex-wrap: wrap;
    gap: 14px;
  }

  /* 5 logos per view on tablet landscape */
  .corporate-clients__slider {
    gap: 20px;
    padding: 10px 44px;
  }

  .corporate-clients__item {
    width: calc((100% - 80px) / 5);
    height: 130px;
  }

  .corporate-clients__item img {
    max-height: 81px;
  }

  .product-card__content {
    padding: 12px 14px;
  }

  .product-card__title {
    font-size: var(--font-size-md);
  }

  .category-grid__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .beauty-section__inner {
    flex-direction: column;
    gap: 30px;
  }

  .beauty-section__image {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .beauty-section__products .product-card {
    width: calc((100% - 16px) / 2);
  }

  .beauty-section__products .product-card__image {
    height: 180px;
  }

  .mini-banners__grid {
    gap: 16px;
  }

  .service-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__main {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .site-footer__bottom-inner {
    flex-wrap: wrap;
    gap: 14px;
  }

}

/* ===== Small Tablet / Large Phone (max-width: 992px) ===== */

@media (max-width: 992px) {
  :root {
    --container-padding: 22px;
  }

  .site-header__inner {
    gap: 10px;
  }

  .all-categories-nav__trigger {
    padding: 10px 12px;
  }

  .header__search-bar-wrapper {
    max-width: 340px;
  }

  .header__action-item-link svg {
    width: 20px;
    height: 20px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .header__separator {
    height: 26px;
  }
}

/* ===== Tablet Portrait (max-width: 768px) ===== */

@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
    --section-gap: 36px;
    --element-gap: 16px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }

  /* Header: single row → mobile layout */
  .site-header__inner {
    flex-wrap: nowrap;
  }

  /* Show mobile toggle */
  .site-header__mobile-nav {
    display: flex;
  }

  .header__mobile-nav-toggle.active .hamburger {
    background-color: transparent;
  }

  .header__mobile-nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
  }

  .header__mobile-nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
  }

  /* Hide desktop All Categories dropdown */
  .all-categories-nav {
    display: none;
  }

  /* Hide desktop search (show mobile search inside menu) */
  .header__search-bar-wrapper {
    display: none;
  }

  .search-quick-links {
    display: none;
  }

  /* Logo smaller */
  .site-header__logo .header__logo-image {
    height: 34px;
  }

  /* Action list: icons only */
  .header__action-list {
    gap: 12px;
  }

  .header__separator {
    display: none;
  }

  .header__action-item-link svg {
    width: 20px;
    height: 20px;
  }

  .header__action-item-title {
    display: none;
  }

  .mobile-menu__help,
  .mobile-menu__social {
    display: block;
  }

  /* Announcement Bar */
  .announcement-bar__inner {
    font-size: var(--font-size-sm);
    padding: 8px 0;
  }

  /* Hero: show mobile images */
  .hero-slide__image--desktop {
    display: none;
  }

  .hero-slide__image--mobile {
    display: block;
  }

  .hero-slider__wrapper {
    aspect-ratio: 4 / 3;
  }

  .hero-slider__arrow {
    width: 36px;
    height: 36px;
  }

  .hero-slider__arrow--prev {
    left: 8px;
  }

  .hero-slider__arrow--next {
    right: 8px;
  }

  .hero-slider__dots {
    bottom: 12px;
  }

  .hero-dot {
    width: 8px;
    height: 8px;
  }

  /* Products: 2 columns */
  .product-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card__content {
    padding: 10px 12px;
  }

  .product-card__title {
    font-size: var(--font-size-sm);
  }

  .product-card__price {
    font-size: var(--font-size-sm);
  }

  /* Category Slider */
  .category-slider__image {
    width: 100px;
    height: 100px;
  }

  .category-slider__name {
    font-size: var(--font-size-xs);
  }

  /* Beauty Section */
  .beauty-section__image {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }

  .beauty-section__content {
    text-align: center;
    max-width: 100%;
  }

  .beauty-section__products {
    width: 100%;
    overflow-x: auto;
    display: flex;
    gap: 12px;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  /* 1 product visible on mobile */
  .beauty-section__products .product-card {
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .beauty-section__products .product-card__image {
    height: 200px;
  }

  .beauty-section__arrow {
    width: 36px;
    height: 36px;
  }

  /* Category Grid */
  .category-grid__grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .category-grid__title {
    font-size: var(--font-size-md);
  }

  /* Mini Banners */
  .mini-banners__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Corporate Clients: 4 per view on tablet portrait */
  .corporate-clients__slider {
    gap: 18px;
    padding: 10px 40px;
  }

  .corporate-clients__item {
    width: calc((100% - 54px) / 4);
    height: 120px;
  }

  .corporate-clients__item img {
    max-height: 81px;
  }

  /* Service Features */
  .service-features__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .service-feature__title {
    font-size: var(--font-size-sm);
  }

  .service-feature__text {
    font-size: var(--font-size-xs);
  }

  /* Footer */
  .site-footer__main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer__bottom-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .site-footer__copyright {
    font-size: var(--font-size-xs);
  }

  .footer-column__title {
    font-size: var(--font-size-md);
    margin-bottom: 12px;
  }

  .footer-about-text {
    font-size: var(--font-size-sm);
  }
}

/* ===== Mobile (max-width: 576px) ===== */

@media (max-width: 576px) {
  :root {
    --container-padding: 16px;
  }

  .site-header__inner {
    padding: 10px 0;
    gap: 8px;
  }

  .site-header__logo .header__logo-image {
    height: 32px;
  }

  /* Cart label: icon only below 576px */
  .hidden-pocket.hidden-lap {
    display: none;
  }

  .header__action-item-link {
    gap: 0;
  }

  .header__action-item-link svg {
    width: 20px;
    height: 20px;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .header__separator {
    display: none;
  }

  .mobile-menu {
    width: 100%;
  }
}

/* ===== Mobile (max-width: 480px) ===== */

@media (max-width: 480px) {
  :root {
    --container-padding: 16px;
    --section-gap: 28px;
  }

  .site-header__inner {
    padding: 10px 0;
  }

  .site-header__logo .header__logo-image {
    height: 30px;
  }

  /* 1 logo per view on mobile */
  .corporate-clients__slider {
    gap: 16px;
    padding: 10px 38px;
  }

  .corporate-clients__item {
    height: 110px;
  }

  .corporate-clients__item img {
    max-height: 81px;
  }

  .corporate-clients__arrow {
    width: 34px;
    height: 34px;
  }

  .header__action-list {
    gap: 10px;
  }

  .header__action-item-link svg {
    width: 18px;
    height: 18px;
  }

  /* Products: 2 columns, smaller cards */
  .product-section__grid {
    gap: 10px;
  }

  .product-card__image {
    height: 140px;
  }

  .product-card__content {
    padding: 8px 10px;
  }

  .product-card__title {
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Category Slider */
  .category-slider__image {
    width: 80px;
    height: 80px;
  }

  .category-slider__wrapper {
    padding: 16px;
    gap: 16px;
  }

  /* Section Titles */
  .section-title {
    font-size: var(--font-size-xl);
  }

  /* Service Features */
  .service-features__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Footer */
  .footer-newsletter__input-group {
    flex-direction: column;
  }

  .footer-newsletter__input {
    width: 100%;
  }

  .footer-newsletter__submit {
    width: 100%;
  }
}

/* ===== Small Mobile (max-width: 390px) ===== */

@media (max-width: 390px) {
  .product-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .product-card__image {
    height: 120px;
  }

  .product-card__add-btn {
    font-size: 11px;
    padding: 6px 12px;
  }

  .category-slider__image {
    width: 70px;
    height: 70px;
  }

  .category-grid__grid {
    gap: 8px;
  }

  .category-grid__items {
    gap: 4px;
  }

  .category-grid__item {
    font-size: 10px;
  }
}

/* ===== Extra Small (max-width: 320px) ===== */

@media (max-width: 320px) {
  :root {
    --container-padding: 12px;
  }

  .site-header__inner {
    gap: 10px;
  }

  .site-header__logo .header__logo-image {
    height: 26px;
  }

  .product-card__image {
    height: 100px;
  }

  .category-slider__image {
    width: 60px;
    height: 60px;
  }

  .category-grid__title {
    font-size: var(--font-size-sm);
  }
}

/* ===== Touch devices ===== */

@media (hover: none) and (pointer: coarse) {
  .nav-bar__link::after {
    display: none;
  }

  .product-card__actions {
    opacity: 1;
  }
}

/* ===== Landscape phones ===== */

@media (max-width: 768px) and (orientation: landscape) {
  .mobile-menu {
    max-height: 100vh;
  }
}

/* ===== Home product section layouts =====
   Featured: 6 per row. Top Selling: 2 per row.
   These overrides come last so they win over the shared .product-section__grid rules. */

@media (max-width: 1200px) {
  .product-section__grid--6 {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1024px) {
  .product-section__grid--6 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .product-section__grid--6 {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .product-section__grid--6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-section__grid--2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Print ===== */

@media print {
  .announcement-section,
  .site-header,
  .mobile-menu,
  .mobile-menu-overlay,
  .service-features,
  .footer-newsletter,
  .site-footer__bottom {
    display: none !important;
  }
}
