:root {
    --safe-top: max(0.85rem, env(safe-area-inset-top));
    --safe-right: max(0.85rem, env(safe-area-inset-right));
    --safe-bottom: max(0.85rem, env(safe-area-inset-bottom));
    --safe-left: max(0.85rem, env(safe-area-inset-left));
    --mobile-nav-width: min(22rem, calc(100vw - 1.5rem));
    --mobile-surface: rgba(246, 241, 236, 0.96);
    --mobile-surface-dark: rgba(48, 20, 24, 0.92);
    --mobile-shadow: 0 22px 44px rgba(18, 18, 18, 0.2);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
picture,
video,
canvas,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(44, 74, 66, 0.14);
}

a,
button {
    touch-action: manipulation;
}

body.mobile-nav-enabled {
    position: relative;
}

.mobile-nav-toggle,
.mobile-nav-backdrop {
    display: none;
}

@media (max-width: 860px) {
    body.mobile-nav-enabled .nav-bar {
        position: fixed !important;
        top: var(--safe-top);
        left: var(--safe-left);
        right: auto !important;
        width: var(--mobile-nav-width);
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
        overflow-y: auto;
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0.12rem !important;
        padding: 4.25rem 1.05rem 1.1rem !important;
        background: var(--mobile-surface) !important;
        border: 1px solid rgba(44, 74, 66, 0.16);
        border-radius: 1.1rem;
        box-shadow: var(--mobile-shadow);
        transform: translateX(calc(-100% - 1rem));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s linear 0.28s;
        z-index: 320;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    body.page-detail.mobile-nav-enabled .nav-bar {
        background: var(--mobile-surface-dark) !important;
        border-color: rgba(248, 230, 225, 0.16);
    }

    body.has-mobile-nav-open .nav-bar {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.28s ease, opacity 0.28s ease;
    }

    body.mobile-nav-enabled .nav-bar::before {
        content: "Navigate";
        position: absolute;
        top: 1.15rem;
        left: 1.05rem;
        font-size: 0.72rem;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: rgba(44, 74, 66, 0.62);
    }

    body.page-detail.mobile-nav-enabled .nav-bar::before {
        color: rgba(248, 230, 225, 0.72);
    }

    body.mobile-nav-enabled .nav-bar a {
        width: 100%;
        padding: 0.82rem 0.15rem;
        font-size: 1.02rem !important;
        line-height: 1.2;
        border-bottom: 1px solid rgba(44, 74, 66, 0.12);
    }

    body.page-detail.mobile-nav-enabled .nav-bar a {
        color: rgba(248, 230, 225, 0.92) !important;
        border-bottom-color: rgba(248, 230, 225, 0.14);
    }

    body.mobile-nav-enabled .nav-bar a:last-child,
    body.mobile-nav-enabled .nav-dropdown a:last-child {
        border-bottom: 0;
    }

    body.mobile-nav-enabled .nav-item-dropdown {
        width: 100%;
        display: block;
    }

    body.mobile-nav-enabled .nav-item-dropdown::after {
        display: none;
    }

    body.mobile-nav-enabled .nav-dropdown {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        min-width: 0 !important;
        width: 100%;
        padding: 0.2rem 0 0.55rem 0.9rem !important;
        border-top: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.mobile-nav-enabled .nav-dropdown a {
        padding: 0.48rem 0;
        font-size: 0.92rem !important;
        letter-spacing: 0.05em !important;
        white-space: normal;
    }

    body.mobile-nav-enabled .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        border: 0;
        padding: 0;
        background: rgba(17, 17, 17, 0.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
        z-index: 300;
    }

    body.has-mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-nav-enabled .mobile-nav-toggle {
        position: fixed;
        top: var(--safe-top);
        left: var(--safe-left);
        width: 3rem;
        height: 3rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        border: 1px solid rgba(44, 74, 66, 0.14);
        border-radius: 999px;
        background: rgba(246, 241, 236, 0.96);
        color: #23443d;
        box-shadow: 0 12px 28px rgba(18, 18, 18, 0.12);
        z-index: 330;
        cursor: pointer;
        transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    }

    body.page-detail.mobile-nav-enabled .mobile-nav-toggle {
        background: rgba(61, 20, 27, 0.92);
        border-color: rgba(248, 230, 225, 0.16);
        color: rgba(248, 230, 225, 0.94);
    }

    body.mobile-nav-enabled .mobile-nav-toggle:active {
        transform: scale(0.97);
    }

    body.mobile-nav-enabled .mobile-nav-toggle-bar,
    body.mobile-nav-enabled .mobile-nav-toggle-bar::before,
    body.mobile-nav-enabled .mobile-nav-toggle-bar::after {
        content: "";
        display: block;
        width: 1.1rem;
        height: 1.5px;
        border-radius: 999px;
        background: currentColor;
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    body.mobile-nav-enabled .mobile-nav-toggle-bar {
        position: relative;
    }

    body.mobile-nav-enabled .mobile-nav-toggle-bar::before {
        position: absolute;
        top: -0.35rem;
        left: 0;
    }

    body.mobile-nav-enabled .mobile-nav-toggle-bar::after {
        position: absolute;
        top: 0.35rem;
        left: 0;
    }

    body.has-mobile-nav-open .mobile-nav-toggle-bar {
        transform: rotate(45deg);
    }

    body.has-mobile-nav-open .mobile-nav-toggle-bar::before {
        transform: translateY(0.35rem) rotate(-90deg);
    }

    body.has-mobile-nav-open .mobile-nav-toggle-bar::after {
        opacity: 0;
    }

    body.has-mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-nav-enabled .navq-tools {
        top: calc(var(--safe-top) + 0.02rem) !important;
        right: var(--safe-right) !important;
        gap: 0.3rem !important;
        padding: 0.22rem;
        border-radius: 999px;
        background: rgba(246, 241, 236, 0.9);
        border: 1px solid rgba(44, 74, 66, 0.12);
        box-shadow: 0 12px 28px rgba(18, 18, 18, 0.1);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    body.mobile-nav-enabled .navq-tool {
        min-width: 2.5rem;
        min-height: 2.5rem;
        padding: 0.4rem !important;
    }

    body.mobile-nav-enabled .navq-icon,
    body.mobile-nav-enabled .navq-tool {
        width: 1.45rem !important;
        height: 1.45rem !important;
    }

    body.mobile-nav-enabled .navq-inline-count {
        font-size: 0.95rem;
    }

    body.mobile-nav-enabled .navq-mini-cart,
    body.mobile-nav-enabled .navq-mini-saved {
        right: 0 !important;
        width: min(18rem, calc(100vw - 1.6rem)) !important;
    }

    [aria-label="Legal quick links"] {
        width: calc(100vw - 1rem);
        max-width: 22rem;
        bottom: calc(var(--safe-bottom) + 0.2rem) !important;
        padding: 0.55rem 0.85rem !important;
        background: rgba(246, 241, 236, 0.88);
        border: 1px solid rgba(44, 74, 66, 0.12);
        border-radius: 999px;
        box-shadow: 0 14px 30px rgba(18, 18, 18, 0.14);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    [aria-label="Legal quick links"] a {
        padding: 0.32rem 0;
        line-height: 1.2;
    }
}

@media (max-width: 860px) {
    html.page-home,
    html.page-about,
    html.page-detail,
    html.page-book-confirmation,
    html.page-payment-confirmation {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    body.page-home,
    body.page-about,
    body.page-shop,
    body.page-cart,
    body.page-legal,
    body.page-book-confirmation,
    body.page-payment-confirmation {
        overflow-y: auto !important;
    }

    html.page-home,
    html.page-about,
    html.page-book-confirmation,
    html.page-payment-confirmation,
    body.page-home,
    body.page-about,
    body.page-book-confirmation,
    body.page-payment-confirmation {
        height: auto !important;
        min-height: 100%;
    }

    body.page-home {
        scroll-snap-type: none !important;
        scroll-behavior: auto;
    }

    body.page-home .section-hero,
    body.page-home .section-break,
    body.page-home .section-founder,
    body.page-home .section-shop {
        height: auto !important;
        min-height: 100svh;
        overflow: hidden;
    }

    body.page-home .section-hero {
        padding: calc(var(--safe-top) + 4rem) 0.95rem calc(var(--safe-bottom) + 1.5rem) !important;
    }

    body.page-home .hero-photo {
        height: min(60svh, 31rem) !important;
    }

    body.page-home .hero-logo {
        bottom: 1rem;
        right: 1rem;
    }

    body.page-home .hero-tagline {
        justify-content: flex-start !important;
        padding: 0 !important;
    }

    body.page-home .hero-tagline p {
        max-width: none !important;
        text-align: left !important;
        font-size: clamp(1rem, 4.4vw, 1.18rem);
        line-height: 1.52;
    }

    body.page-home .section-break {
        padding: calc(var(--safe-top) + 4rem) 0.95rem calc(var(--safe-bottom) + 2.4rem);
    }

    body.page-home .break-frame {
        height: min(58svh, 28rem);
    }

    body.page-home .section-founder {
        flex-direction: column !important;
    }

    body.page-home .founder-text-col,
    body.page-home .founder-photo-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }

    body.page-home .founder-text-col {
        padding: calc(var(--safe-top) + 4rem) 1.1rem 1.5rem !important;
        overflow: visible;
    }

    body.page-home .founder-title {
        margin-bottom: 1.5rem;
        font-size: clamp(1.95rem, 10vw, 2.7rem);
    }

    body.page-home .founder-body,
    body.page-home .founder-quote {
        margin-right: 0 !important;
        font-size: clamp(1rem, 4.15vw, 1.1rem) !important;
        line-height: 1.65;
    }

    body.page-home .founder-photo-col {
        min-height: 54svh;
    }

    body.page-home .founder-photo-logo {
        top: 1rem;
        right: 1rem;
        width: clamp(7rem, 26vw, 9.5rem);
    }

    body.page-home .section-shop {
        display: flex;
        align-items: stretch;
        justify-content: flex-end;
        min-height: 100svh;
    }

    body.page-home .shop-overlay {
        top: auto;
        bottom: calc(var(--safe-bottom) + 1.4rem);
        gap: 0.8rem;
        padding: 0 1rem 0.4rem;
    }

    body.page-home .shop-title {
        font-size: clamp(1.3rem, 6.5vw, 2rem) !important;
        text-align: center;
        line-height: 1.18;
    }

    body.page-home .scroll-dots {
        display: none !important;
    }

    body.page-about {
        overflow-x: hidden;
    }

    body.page-about {
        height: auto !important;
    }

    body.page-about .about-shell {
        padding: calc(var(--safe-top) + 4.5rem) 1rem calc(var(--safe-bottom) + 3.5rem) !important;
    }

    body.page-about .main-layout {
        gap: 1.6rem;
    }

    body.page-about .about-copy {
        font-size: clamp(1rem, 4.2vw, 1.1rem);
        line-height: 1.65;
    }

    body.page-about .about-photo-col {
        gap: 0.9rem;
    }

    body.page-about .about-images-grid {
        width: 100%;
        gap: 0.7rem;
    }

    body.page-about .bottom-info-row {
        gap: 0.7rem;
        padding-bottom: 1rem;
    }

    body.page-shop .shop-shell {
        padding: calc(var(--safe-top) + 4.6rem) 0.85rem calc(var(--safe-bottom) + 3.6rem) !important;
    }

    body.page-shop .shop-heading {
        padding-inline: 0.2rem;
    }

    body.page-shop .shop-heading h1 {
        font-size: clamp(1.65rem, 9vw, 2.2rem) !important;
        line-height: 1.08;
    }

    body.page-shop .shop-heading p {
        font-size: clamp(1.02rem, 5vw, 1.24rem) !important;
        line-height: 1.45;
    }

    body.page-shop .shop-layout {
        gap: 1rem;
    }

    body.page-shop .filter-panel,
    body.page-shop .catalog-panel {
        padding: 1rem;
        border-radius: 1rem;
        background: rgba(255, 255, 255, 0.5);
        box-shadow: 0 14px 30px rgba(30, 22, 18, 0.06);
    }

    body.page-shop .catalog-tools {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.65rem;
        flex-wrap: wrap;
    }

    body.page-shop .sort-menu,
    body.page-shop .filter-trigger {
        width: 100%;
    }

    body.page-shop .sort-trigger,
    body.page-shop .filter-toggle,
    body.page-shop .sort-options button {
        min-height: 2.8rem;
    }

    body.page-shop .dress-grid {
        gap: 1rem;
    }

    body.page-shop .dress-card,
    body.page-shop .dress-tile {
        min-width: 0;
    }

    html.page-detail,
    body.page-detail {
        overflow-y: auto !important;
        height: auto !important;
    }

    body.page-detail .shell {
        min-height: 100svh;
        height: auto !important;
        padding: calc(var(--safe-top) + 4.3rem) 0.9rem calc(var(--safe-bottom) + 2rem) !important;
        gap: 1rem;
    }

    body.page-detail .frame {
        inset: 0.35rem;
    }

    body.page-detail .topbar {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 0.7rem;
        padding-right: 4.1rem;
    }

    body.page-detail .head-center {
        flex-wrap: wrap;
        gap: 0.55rem 0.9rem;
        white-space: normal;
    }

    body.page-detail .icons {
        justify-self: start;
        gap: 0.85rem;
    }

    body.page-detail .back-link {
        font-size: 0.72rem;
        padding: 0.35rem 0;
    }

    body.page-detail .icon-btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
    }

    body.page-detail .stage {
        grid-template-columns: 1fr !important;
        gap: 1.15rem !important;
        padding-bottom: 1rem;
    }

    body.page-detail .gallery {
        order: 1;
        width: 100% !important;
        max-width: 32rem;
        margin: 0 auto;
        aspect-ratio: 16 / 23;
        height: auto !important;
    }

    body.page-detail .meta-left,
    body.page-detail .meta-right {
        width: 100% !important;
        max-width: none;
        margin-bottom: 0;
        padding: 0;
        font-size: clamp(1.02rem, 4.3vw, 1.2rem) !important;
    }

    body.page-detail .meta-left {
        order: 2;
    }

    body.page-detail .meta-right {
        order: 3;
    }

    body.page-detail .currency {
        gap: 0.8rem;
        flex-wrap: wrap;
        font-size: 0.95rem;
    }

    body.page-detail .price {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }

    body.page-detail .action-link {
        font-size: clamp(1.18rem, 5vw, 1.45rem);
        padding: 0.15rem 0;
    }

    body.page-detail .footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        padding-bottom: 0.6rem;
    }

    body.page-cart .checkout-shell {
        min-height: 100svh;
        padding-top: calc(var(--safe-top) + 4.6rem) !important;
        padding-bottom: calc(var(--safe-bottom) + 4rem) !important;
    }

    body.page-cart .checkout-panel {
        width: min(100%, calc(100% - 1rem));
        padding: 1.2rem 0.95rem 1.4rem;
        border-radius: 1rem;
    }

    body.page-cart .panel-cols {
        gap: 1.4rem;
    }

    body.page-cart .field,
    body.page-cart .notes-field {
        gap: 0.3rem 0.55rem;
        margin-bottom: 0.7rem;
    }

    body.page-cart .field label,
    body.page-cart .notes-field label {
        font-size: 0.92rem;
    }

    body.page-cart .field input,
    body.page-cart .field select,
    body.page-cart .field textarea,
    body.page-cart .notes-field textarea {
        min-height: 2.85rem;
        padding: 0.45rem 0.5rem;
    }

    body.page-cart .cart-card,
    body.page-cart .summary {
        border-radius: 0.9rem;
    }

    body.page-cart .cart-items {
        max-height: none;
        overflow: visible;
    }

    body.page-cart .cart-item {
        grid-template-columns: auto 52px minmax(0, 1fr) !important;
        gap: 0.65rem;
        align-items: start;
        padding: 0.85rem 0;
    }

    body.page-cart .item-info {
        min-width: 0;
    }

    body.page-cart .item-name {
        font-size: 1rem;
        line-height: 1.2;
    }

    body.page-cart .item-price {
        font-size: 0.85rem;
    }

    body.page-cart .item-select {
        width: 1rem;
        height: 1rem;
        margin-top: 0.25rem;
    }

    body.page-cart .item-qty-col {
        grid-column: 2 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        padding-left: 0.1rem;
    }

    body.page-cart .item-controls {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    body.page-cart .qty-btn {
        min-width: 2rem;
        min-height: 2rem;
    }

    body.page-cart .remove-btn {
        min-height: 2rem;
    }

    html.page-book,
    body.page-book {
        min-height: 100%;
    }

    body.page-book .photo-wrap {
        flex-basis: min(54svh, 27rem) !important;
    }

    body.page-book .back-link {
        top: calc(var(--safe-top) + 0.2rem);
        left: 1rem;
        padding: 0.45rem 0;
        font-size: 0.72rem;
    }

    body.page-book .logo-corner {
        right: 1rem;
        bottom: 1rem;
    }

    body.page-book .form-section {
        padding: 1.4rem 1rem calc(var(--safe-bottom) + 1.8rem) !important;
        gap: 1.1rem;
    }

    body.page-book .form-title h1 {
        font-size: clamp(1.55rem, 8vw, 2.1rem) !important;
        line-height: 1.08;
    }

    body.page-book .field label {
        font-size: 1.02rem;
    }

    body.page-book .field input[type="text"] {
        min-height: 2.8rem;
        padding: 0.45rem 0;
        font-size: 1rem;
    }

    body.page-book .cal-btn {
        min-width: 2.6rem;
        min-height: 2.6rem;
        margin-left: 0.2rem;
    }

    body.page-book .submit-wrap {
        width: 100%;
    }

    body.page-book .submit-btn {
        width: 100%;
        text-align: left;
        font-size: 1rem;
        padding: 0.5rem 0;
    }

    body.page-book .cal-popup {
        width: min(18rem, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
    }

    body.page-book-confirmation,
    body.page-payment-confirmation {
        min-height: 100svh;
    }

    body.page-book-confirmation .back-link,
    body.page-payment-confirmation .back-link {
        top: calc(var(--safe-top) + 0.2rem);
        left: 1rem;
        font-size: 0.72rem;
        padding: 0.45rem 0;
    }

    body.page-book-confirmation .photo-wrap,
    body.page-payment-confirmation .brand-header {
        height: auto;
    }

    body.page-book-confirmation .photo-wrap {
        height: min(52svh, 24rem);
    }

    body.page-book-confirmation .message-section {
        min-height: calc(100svh - min(52svh, 24rem));
        padding: 1.5rem 1rem calc(var(--safe-bottom) + 2rem);
    }

    body.page-book-confirmation .msg-primary {
        font-size: clamp(1.28rem, 6.2vw, 1.7rem);
        line-height: 1.15;
    }

    body.page-book-confirmation .msg-secondary {
        font-size: 0.82rem;
        line-height: 1.5;
        letter-spacing: 0.16em;
    }

    body.page-payment-confirmation .page-layer {
        padding-top: calc(var(--safe-top) + 4.8rem);
        padding-bottom: calc(var(--safe-bottom) + 3.4rem);
    }

    body.page-payment-confirmation .brand-header {
        padding-inline: 1rem;
        margin-bottom: 1rem;
    }

    body.page-payment-confirmation .main-content {
        padding-inline: 1rem !important;
    }

    body.page-payment-confirmation .receipt-card {
        padding: 1.15rem 0.95rem 1.3rem;
        border-radius: 1rem;
    }

    body.page-payment-confirmation .receipt-rows {
        gap: 0.8rem;
    }

    body.page-payment-confirmation .receipt-row {
        grid-template-columns: 1fr !important;
        gap: 0.18rem;
    }

    body.page-payment-confirmation .receipt-row-label {
        white-space: normal;
        font-size: 0.76rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    body.page-payment-confirmation .receipt-row-value {
        font-size: 0.96rem;
    }

    body.page-legal .shell {
        margin-top: calc(var(--safe-top) + 4.6rem) !important;
        gap: 1rem;
        padding-bottom: calc(var(--safe-bottom) + 3.2rem);
    }

    body.page-legal .toc {
        padding: 1rem;
        border-radius: 1rem;
    }

    body.page-legal .toc a {
        padding: 0.55rem 0;
        display: block;
    }

    body.page-legal section {
        border-radius: 1rem;
        box-shadow: 0 14px 30px rgba(20, 20, 20, 0.06);
    }
}
