/* Flowyy Essence: responsive layouts (CSS3 media queries).
   Breakpoints: 1100px (mobile navigation), 900px (tablet), 640px (phone), 380px (small phone). */

/* Layout helpers used by pages */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  align-items: start;
}

.checkout-layout .summary {
  top: calc(var(--header-h) + 24px);
}

/* Tablet-wide and below: compact header with a menu toggle */
@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: auto 1fr;
    gap: 16px;
  }

  .main-nav {
    display: none;
    justify-self: stretch;
  }

  .site-header.nav-open .main-nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 4px 20px 28px;
    background: var(--white);
    border-top: 1px solid var(--light);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
    animation: slideDown 0.3s var(--ease);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list > li {
    border-bottom: 1px solid var(--light);
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link[aria-current='page'] {
    font-weight: 600;
  }

  .has-dropdown > .dropdown {
    position: static;
    display: none;
    min-width: 0;
    margin: 0;
    padding: 0 0 10px 14px;
    border: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    left: auto;
  }

  .has-dropdown.open > .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .has-dropdown .dropdown a {
    padding: 10px 0;
    color: #444;
    font-size: 15px;
  }

  .has-dropdown .dropdown a:hover,
  .has-dropdown .dropdown a:focus-visible {
    padding-left: 6px;
    background: transparent;
  }

  .nav-mobile-only {
    display: block;
  }

  .menu-toggle {
    display: grid;
  }

  .header-icons {
    justify-self: end;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero__highlights {
    grid-template-columns: repeat(2, auto);
    justify-content: start;
    gap: 22px 40px;
  }

  .benefit-grid {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 36px;
  }

  .benefit:nth-child(4) {
    border-left: 0;
  }

  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cart-layout .summary,
  .checkout-layout .summary {
    position: static;
    max-width: 560px;
  }

  .shop-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .shop-filters {
    position: static;
    padding: 22px;
    background: var(--off);
    border: 1px solid var(--light);
  }

  .shop-filters .filter-head {
    margin-bottom: 18px;
  }

  .shop-filters .filter-group {
    margin-bottom: 18px;
  }

  .shop-filters fieldset.filter-group {
    display: block;
  }

  .shop-filters .filter-group:not(fieldset) {
    display: inline-block;
    width: calc(50% - 8px);
    vertical-align: top;
    margin-right: 12px;
  }

  .shop-filters .filter-group:last-of-type {
    margin-right: 0;
  }

  .pdp {
    gap: 40px;
  }

  .pdp__media {
    position: static;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cat-card {
    aspect-ratio: 16 / 10;
  }

  .promo {
    grid-template-columns: 1fr;
  }

  .promo__media {
    min-height: 380px;
  }

  .promo__copy {
    padding: 56px 28px 64px;
  }

  .newsletter {
    grid-template-columns: 1fr;
  }

  .newsletter__media {
    min-height: 240px;
  }

  .newsletter__copy {
    padding: 48px 28px 56px;
  }

  .review-track {
    grid-auto-columns: calc((100% - 24px) / 2);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .contact-grid,
  .split,
  .auth-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .split__media {
    aspect-ratio: 16 / 11;
  }

  .value-grid {
    grid-template-columns: 1fr;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .collection-grid .cat-card {
    aspect-ratio: 16 / 10;
  }

  .announce__social {
    display: none;
  }

  .announce__inner {
    justify-content: center;
  }
}

/* Phone */
@media (max-width: 640px) {
  .container {
    width: min(100% - 32px, var(--container));
  }

  .section {
    padding: 56px 0;
  }

  .section-head {
    margin-bottom: 26px;
    align-items: flex-start;
  }

  .section-title {
    font-size: 28px;
  }

  .announce {
    font-size: 11px;
  }

  .announce__inner {
    min-height: 34px;
  }

  .logo__name {
    font-size: 28px;
  }

  .logo__sub {
    font-size: 7.5px;
    letter-spacing: 0.5em;
    padding-left: 0.5em;
  }

  .site-header {
    --header-h: 70px;
  }

  .header-inner {
    min-height: 70px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .hero {
    min-height: 0;
    padding: 56px 0 64px;
    background-position: 62% 20%;
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.8) 100%);
  }

  .hero__brand {
    font-size: 12px;
    letter-spacing: 0.24em;
  }

  .hero__title {
    font-size: 60px;
  }

  .hero__script {
    font-size: 44px;
  }

  .hero__text {
    font-size: 15px;
    margin: 18px 0 26px;
  }

  .hero__highlights {
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
  }

  .hero__hl {
    font-size: 13px;
    gap: 10px;
  }

  .hl-icon {
    width: 46px;
    height: 46px;
  }

  .hl-icon svg {
    width: 20px;
    height: 20px;
  }

  .cat-card {
    aspect-ratio: 4 / 4.6;
  }

  .cat-card__body {
    padding: 22px 20px 24px;
  }

  .cat-card h3,
  .cat-card__title,
  .cat-card h2 {
    font-size: 26px;
  }

  .cat-card p {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
  }

  .product-card__name {
    font-size: 14px;
  }

  .product-card__body {
    padding: 12px 0 10px;
  }

  .product-card > .btn {
    min-height: 46px;
    font-size: 10.5px;
    padding: 0 10px;
    letter-spacing: 0.08em;
  }

  .product-card__badges {
    top: 8px;
    left: 8px;
  }

  .wish-btn {
    width: 34px;
    height: 34px;
    top: 8px;
    right: 8px;
  }

  .promo__media {
    min-height: 300px;
  }

  .promo__title {
    font-size: 44px;
  }

  .benefit-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px 0;
  }

  .benefit {
    border-left: 0;
    padding: 6px 12px;
  }

  .benefit:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .benefit:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    width: 70%;
    margin: 0 auto;
  }

  .benefit h3 {
    font-size: 13px;
  }

  .testimonials {
    padding: 56px 0;
  }

  .carousel-controls {
    align-self: flex-end;
  }

  .review-track {
    grid-auto-columns: 86%;
  }

  .review {
    padding: 26px 22px;
  }

  .newsletter__copy .section-title {
    font-size: 30px;
  }

  .subscribe {
    flex-direction: column;
    gap: 10px;
  }

  .subscribe__input {
    border-right: 1px solid #c9c9c9;
  }

  .subscribe__btn {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-top: 56px;
  }

  .footer-bottom {
    flex-direction: column;
    margin-top: 40px;
  }

  .page-hero {
    padding: 44px 0 40px;
  }

  .page-hero h1 {
    font-size: 36px;
  }

  .breadcrumb ol {
    font-size: 11px;
  }

  .filter-group:not(fieldset) {
    display: block !important;
    width: 100% !important;
    margin-right: 0 !important;
  }

  .shop-filters {
    padding: 18px;
  }

  .results-bar {
    margin-bottom: 18px;
  }

  .load-more {
    margin-top: 32px;
  }

  .cart-item {
    grid-template-columns: 84px 1fr;
    gap: 16px;
    padding: 20px 0;
  }

  .cart-item__img {
    width: 84px;
  }

  .cart-item__total {
    grid-column: 2;
  }

  .cart-item__controls {
    gap: 14px;
  }

  .summary {
    padding: 22px;
  }

  .pdp {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .pdp__name {
    font-size: 30px;
  }

  .pdp-actions .btn {
    width: 100%;
    flex: none;
  }

  .qty--lg button {
    width: 44px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-section legend {
    font-size: 22px;
  }

  .radio-card {
    padding: 14px;
  }

  .auth-card,
  .contact-form {
    padding: 24px;
  }

  .confirm-grid {
    grid-template-columns: 1fr;
  }

  .confirm-card {
    padding: 22px;
  }

  .confirm-actions .btn {
    width: 100%;
  }

  .empty-state {
    padding: 44px 20px;
  }

  .empty-state__title {
    font-size: 24px;
  }

  .search-inner {
    padding-top: 90px;
  }

  .search-input {
    font-size: 22px;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .back-top {
    right: 16px;
    bottom: 16px;
  }

  .value-card {
    padding: 28px 22px;
  }

  .prose h2 {
    font-size: 22px;
  }
}

/* Small phones: keep every control reachable */
@media (max-width: 380px) {
  .header-inner {
    gap: 8px;
  }

  .logo__name {
    font-size: 24px;
  }

  .logo__sub {
    font-size: 6.5px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .icon-btn--wish {
    display: none;
  }

  .hero__highlights {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: 52px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card__media {
    aspect-ratio: 4 / 5;
  }

  .review-track {
    grid-auto-columns: 92%;
  }
}

/* Desktop hover states for dropdowns (pointer devices only, wide screens) */
@media (min-width: 1101px) {
  .has-dropdown:hover > .dropdown,
  .has-dropdown:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
