/*
 * BERTA v1.5.2 — mobile desktop-fidelity pass.
 * On phones the landing keeps the same visual composition as desktop,
 * only reduced in scale. We intentionally avoid the old one-column reflow.
 */

/* Keep the fixed couture header below the WordPress admin toolbar while logged in. */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .overlay-nav { top: 46px; }
}

@media (max-width: 768px) {
  :root {
    --berta-mobile-gap: clamp(5px, 1.8vw, 9px);
    --berta-mobile-edge: clamp(9px, 3.1vw, 14px);
    --berta-section-y: clamp(30px, 9vw, 46px);
  }

  body {
    font-size: clamp(10px, 3.15vw, 13px);
  }

  .container {
    width: calc(100% - (var(--berta-mobile-edge) * 2));
  }

  /* Header stays purpose-built for touch, while retaining the desktop visual weight. */
  .site-header__inner {
    height: 54px;
    padding-inline: var(--berta-mobile-edge);
  }

  .site-header__brand {
    top: 50%;
    max-width: 46vw;
  }

  .site-brand__text {
    font-size: clamp(15px, 5vw, 20px);
    letter-spacing: .25em;
    padding-left: .25em;
  }

  .site-header__right .icon-button {
    width: 31px;
    height: 31px;
  }

  .site-header__right .icon-button svg {
    width: 15px;
    height: 15px;
  }

  .menu-toggle {
    width: 31px;
    height: 31px;
  }

  .menu-toggle__line {
    width: 17px;
  }

  .site-header__right > .language-switcher {
    top: 5px;
    left: 7px;
    font-size: 7px;
  }

  /* HERO — landscape desktop composition instead of a tall portrait crop. */
  .hero {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .hero__media {
    inset: 0;
    background-size: cover;
    background-position: center center;
  }

  .hero__overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,.10) 0%, rgba(0,0,0,.08) 44%, rgba(0,0,0,.60) 100%);
  }

  html[lang^="en"] .hero__content,
  html[lang^="fa"] .hero__content,
  .hero__content {
    bottom: 17%;
    max-width: 56%;
  }

  html[lang^="en"] .hero__content {
    left: var(--berta-mobile-edge) !important;
  }

  html[lang^="fa"] .hero__content {
    right: var(--berta-mobile-edge) !important;
  }

  .hero__eyebrow,
  html[lang^="en"] .hero__eyebrow,
  html[lang^="fa"] .hero__eyebrow {
    margin-bottom: 4px !important;
    font-size: clamp(6px, 1.9vw, 8px);
    line-height: 1.35;
  }

  .hero__title,
  html[lang^="en"] .hero__title,
  html[lang^="fa"] .hero__title {
    margin-bottom: clamp(6px, 2vw, 10px) !important;
    font-size: clamp(14px, 5.5vw, 24px);
    line-height: 1.02;
    white-space: nowrap;
  }

  .hero__content .button,
  html[lang^="fa"] .hero__content .button {
    min-height: 0;
    padding: clamp(5px, 1.55vw, 7px) clamp(8px, 2.8vw, 13px);
    font-size: clamp(6px, 1.8vw, 8px);
    border-width: 1px;
  }

  .hero__controls,
  html[lang^="fa"] .hero__controls {
    bottom: 4.5%;
    gap: 4px;
  }

  .hero__controls { right: var(--berta-mobile-edge); }
  html[lang^="fa"] .hero__controls { left: var(--berta-mobile-edge) !important; }

  .hero__arrow {
    padding: 2px;
    font-size: 10px;
  }

  .hero__dots { gap: 3px; }
  .hero__dot { width: 12px; }
  .hero__dot.is-active { width: 18px; }

  /* COLLECTIONS — keep the desktop three-card composition. */
  .collections-section {
    padding-top: clamp(28px, 9vw, 42px);
    padding-bottom: clamp(30px, 9.5vw, 46px);
  }

  .collections-intro,
  .products-intro {
    width: min(82%, 540px);
    padding: 0;
  }

  .collections-intro { margin-bottom: clamp(18px, 5.5vw, 28px); }
  .products-intro { margin-bottom: clamp(16px, 5vw, 26px); }

  .collections-intro h2,
  .products-intro h2 {
    font-size: clamp(15px, 5vw, 22px);
  }

  .collections-intro__copy,
  .products-intro__copy {
    width: min(100%, 460px);
    margin-top: clamp(6px, 2.2vw, 10px);
    font-size: clamp(8px, 2.45vw, 11px);
    line-height: 1.55;
  }

  html[lang^="fa"] .collections-intro__copy,
  html[lang^="fa"] .products-intro__copy {
    line-height: 1.75;
  }

  .collections-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--berta-mobile-gap);
  }

  .collections-grid .collection-card:last-child {
    grid-column: auto;
    width: auto;
  }

  .collection-card__media {
    aspect-ratio: 3 / 4;
  }

  .collection-card__title {
    margin-top: clamp(4px, 1.4vw, 7px);
    font-size: clamp(6px, 1.8vw, 8px);
    line-height: 1.35;
    letter-spacing: .055em;
  }

  .collection-card__overlay span {
    font-size: clamp(5px, 1.55vw, 7px);
  }

  /* EDITORIAL — preserve the 50/50 desktop split. */
  .editorial-section {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .editorial-section__media {
    min-height: 0;
    aspect-ratio: auto;
  }

  .editorial-section__media img {
    height: 100%;
    min-height: 100%;
    object-fit: cover;
  }

  .editorial-section__content {
    min-height: clamp(230px, 72vw, 390px);
    padding: clamp(12px, 4vw, 22px);
  }

  .editorial-section__inner {
    max-width: 100%;
  }

  .editorial-section .eyebrow {
    margin-bottom: clamp(4px, 1.5vw, 7px);
    font-size: clamp(6px, 1.7vw, 8px);
  }

  .editorial-section h2 {
    margin-bottom: clamp(7px, 2.2vw, 12px);
    font-size: clamp(14px, 4.7vw, 22px);
    line-height: 1.08;
  }

  .editorial-section p:not(.eyebrow) {
    margin-bottom: clamp(8px, 2.5vw, 13px);
    font-size: clamp(8px, 2.35vw, 10.5px);
    line-height: 1.55;
  }

  html[lang^="fa"] .editorial-section p:not(.eyebrow) {
    line-height: 1.75;
  }

  .editorial-section .text-link {
    font-size: clamp(6px, 1.7vw, 8px);
  }

  /* ARRIVALS — show the same four-card row at a glance. */
  .products-section {
    padding-top: clamp(30px, 9vw, 44px);
    padding-bottom: clamp(30px, 9vw, 44px);
  }

  .products-rail,
  .products-rail.is-centered {
    justify-content: flex-start;
    gap: var(--berta-mobile-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .products-rail.is-centered {
    justify-content: center;
  }

  .product-card {
    flex: 0 0 calc((100% - (var(--berta-mobile-gap) * 3)) / 4);
    max-width: none;
  }

  .product-card h3 {
    margin-top: clamp(4px, 1.4vw, 7px);
    font-size: clamp(5.5px, 1.7vw, 7.5px);
    line-height: 1.35;
    letter-spacing: .045em;
  }

  .product-card p {
    font-size: clamp(6px, 1.8vw, 8px);
  }

  .product-card__quick {
    display: none;
  }

  /* JOURNAL — same wide editorial frame as desktop instead of a portrait block. */
  .journal-showcase {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 7.2;
  }

  .journal-showcase__image {
    object-position: center center;
  }

  .journal-showcase__content {
    bottom: 28%;
    width: min(72%, 520px);
  }

  .journal-showcase__eyebrow {
    margin-bottom: clamp(5px, 1.8vw, 8px);
    font-size: clamp(6px, 1.8vw, 8px);
  }

  .journal-showcase__cta {
    padding-bottom: 2px;
    font-size: clamp(6px, 1.75vw, 8px);
  }

  .journal-showcase__controls {
    bottom: 7%;
    gap: 4px;
  }

  .journal-showcase__arrow {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .journal-showcase__dots { gap: 3px; }
  .journal-showcase__dot { width: 14px; }
  .journal-showcase__dot.is-active { width: 21px; }

  /* Contact remains centered, but scaled with the desktop rhythm. */
  .contact-section {
    padding-block: clamp(34px, 10vw, 52px);
  }

  .contact-section__inner {
    width: min(80%, 520px);
  }

  .contact-section h2 {
    font-size: clamp(16px, 5vw, 23px);
  }

  .contact-section__copy {
    width: min(100%, 430px);
    margin-top: 7px;
    font-size: clamp(8px, 2.3vw, 10px);
    line-height: 1.6;
  }

  .contact-section__details {
    flex-direction: row;
    gap: 5px 13px;
    margin-top: 10px;
  }

  .contact-section__phone,
  .contact-section__email {
    font-size: clamp(7px, 2vw, 9px);
  }

  .contact-section__cta {
    margin-top: 12px;
    min-height: 0;
    padding: 6px 11px;
    font-size: clamp(6px, 1.8vw, 8px);
  }

  /* Footer keeps the desktop four-column architecture. */
  .site-footer {
    padding: clamp(24px, 7vw, 34px) 0 14px;
  }

  .site-footer__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--berta-mobile-gap);
    padding-bottom: clamp(20px, 6vw, 30px);
  }

  .site-footer__column {
    gap: 4px;
    min-width: 0;
  }

  .site-footer__column h2 {
    margin-bottom: 4px;
    font-size: clamp(5.5px, 1.65vw, 7px);
    letter-spacing: .08em;
  }

  .site-footer__column a,
  .site-footer__pending-link {
    font-size: clamp(5px, 1.5vw, 6.5px);
    line-height: 1.35;
    letter-spacing: .04em;
    overflow-wrap: anywhere;
  }

  .site-footer__bottom {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    font-size: clamp(5px, 1.45vw, 6.5px);
    letter-spacing: .05em;
  }

  .site-footer__selectors {
    gap: 5px;
  }

  .site-footer__selectors button {
    font-size: clamp(5px, 1.45vw, 6.5px);
  }

  /* Existing mobile rules that forced vertical layouts must not win. */
  .section {
    padding-block: var(--berta-section-y);
  }
}

@media (max-width: 420px) {
  .hero__content {
    max-width: 60%;
  }

  .editorial-section__content {
    min-height: clamp(220px, 74vw, 315px);
  }
}


/* v1.5.3 — mobile logo correction: keep the BERTA mark clean, centered and unsquashed. */
@media (max-width: 768px) {
  .site-header__brand {
    top: 50%;
    max-width: none;
    width: auto;
    min-width: 0;
    padding-inline: 8px;
    overflow: visible;
  }

  .site-brand,
  .custom-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: none;
    overflow: visible;
  }

  .custom-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: min(124px, 40vw);
    max-height: 30px;
    object-fit: contain;
    object-position: center;
  }

  .site-brand__text {
    font-size: clamp(18px, 5.2vw, 23px);
    letter-spacing: .22em;
    padding-left: .22em;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .site-header__inner {
    grid-template-columns: 36px 1fr 36px;
  }

  .site-header__brand {
    max-width: calc(100vw - 96px);
    padding-inline: 6px;
  }

  .custom-logo {
    max-width: min(116px, 42vw);
    max-height: 28px;
  }

  .site-brand__text {
    font-size: clamp(17px, 5vw, 20px);
    letter-spacing: .20em;
    padding-left: .20em;
  }
}
