/* ========================================================================== 
   NOSEAMS — Unified internal page spacing
   This stylesheet loads last and is the only place that controls the space
   between the fixed header and the first visible content of internal pages.
   ========================================================================== */

:root {
    --ns-internal-top-gap-desktop: clamp(34px, 3vw, 52px);
    --ns-internal-top-gap-mobile: 34px;
    --ns-internal-bottom-gap-desktop: clamp(72px, 7vw, 110px);
    --ns-internal-bottom-gap-mobile: 64px;
}

/* Header spacer: all internal pages sit below the fixed header. */
body:not(.home):not(.single-product) .ns-main {
    padding-top: var(--ns-header-desktop-height, 132px) !important;
}


/* My Selection must match the original /my-selection/ vertical start in every language.
   The translated WordPress page normally receives the generic .ns-main header spacer;
   removing it here keeps PT and EN aligned without changing other pages. */
body.ns-wishlist-active:not(.home) .ns-main {
    padding-top: 0 !important;
}

body.ns-wishlist-active .ns-wishlist-page {
    padding-top: clamp(170px, 15vh, 230px) !important;
}

/* One shared page rhythm for every internal page wrapper. */
body:not(.home) .ns-page,
body.page .ns-info-page,
body.page .ns-page--legal,
body.search .ns-page,
body.error404 .ns-page,
body.woocommerce-cart .ns-page,
body.woocommerce-cart .ns-page--cart,
body.woocommerce-checkout .ns-page,
body.woocommerce-checkout .ns-page--checkout,
body.woocommerce-account .ns-page,
body.woocommerce-account .ns-page--account,
body.woocommerce-lost-password .ns-page,
body.woocommerce-lost-password .ns-page--account {
    padding-top: var(--ns-internal-top-gap-desktop) !important;
    padding-right: var(--ns-side-space) !important;
    padding-bottom: var(--ns-internal-bottom-gap-desktop) !important;
    padding-left: var(--ns-side-space) !important;
    margin-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
}

/* Remove page-specific top padding from direct content containers. */
body:not(.home) .ns-page__content,
body.page .ns-info-page__inner,
body.page .ns-info-page__content,
body.woocommerce-cart .ns-page__content,
body.woocommerce-checkout .ns-page__content,
body.woocommerce-account .ns-page__content,
body.woocommerce-lost-password .ns-page__content{
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* WooCommerce pages must start on the same line as normal page content. */
body.woocommerce-cart .ns-page__content > .woocommerce,
body.woocommerce-checkout .ns-page__content > .woocommerce,
body.woocommerce-account .ns-page__content > .woocommerce,
body.woocommerce-lost-password .ns-page__content > .woocommerce,
body.woocommerce-account.logged-in .woocommerce,
body.woocommerce-account:not(.logged-in) .woocommerce,
body.woocommerce-lost-password .woocommerce {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
}

/* Account-specific shells must not add an extra offset above the forms/dashboard. */
body.woocommerce-account .ns-account-page,
body.woocommerce-lost-password .ns-account-page,
body.woocommerce-account:not(.logged-in) .woocommerce .ns-account-page,
body.woocommerce-lost-password .woocommerce .ns-account-page {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation {
    margin-top: 0 !important;
}

/* About keeps its custom template, but follows the same header rhythm. */
body.ns-about-active:not(.home) .ns-main {
    padding-top: 0 !important;
}

body.ns-about-active .ns-about-brand {
    padding-top: calc(var(--ns-header-desktop-height, 132px) + var(--ns-internal-top-gap-desktop)) !important;
}

/* Shop/category archives follow the same start line. */
.ns-shop-archive {
    padding-top: var(--ns-internal-top-gap-desktop) !important;
}

body.woocommerce-order-received .ns-order-received-page {
    padding-top: var(--ns-internal-top-gap-desktop) !important;
}

@media (max-width: 960px) {
    body:not(.home):not(.single-product) .ns-main {
        padding-top: var(--ns-header-mobile-height, 58px) !important;
    }

    body:not(.home) .ns-page,
    body.page .ns-info-page,
    body.page .ns-page--legal,
    body.search .ns-page,
    body.error404 .ns-page,
    body.woocommerce-cart .ns-page,
    body.woocommerce-cart .ns-page--cart,
    body.woocommerce-checkout .ns-page,
    body.woocommerce-checkout .ns-page--checkout,
    body.woocommerce-account .ns-page,
    body.woocommerce-account .ns-page--account,
    body.woocommerce-lost-password .ns-page,
    body.woocommerce-lost-password .ns-page--account {
        padding-top: var(--ns-internal-top-gap-mobile) !important;
        padding-bottom: var(--ns-internal-bottom-gap-mobile) !important;
    }

    /* Policy pages and Shipping & Returns use the same 22px mobile content
       gutter as the footer. Keep this explicit because header.css redefines
       --ns-side-space after the page styles have loaded. */
    body.page .ns-page--legal,
    body.page .ns-info-page--shipping {
        padding-right: 22px !important;
        padding-left: 22px !important;
    }

    body.woocommerce-cart .ns-page__content > .woocommerce,
    body.woocommerce-checkout .ns-page__content > .woocommerce,
    body.woocommerce-account .ns-page__content > .woocommerce,
    body.woocommerce-lost-password .ns-page__content > .woocommerce,
    body.woocommerce-account.logged-in .woocommerce,
    body.woocommerce-account:not(.logged-in) .woocommerce,
    body.woocommerce-lost-password .woocommerce,
    body.woocommerce-account .ns-account-page,
    body.woocommerce-lost-password .ns-account-page {
        margin-top: 0 !important;
        padding-top: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body.ns-about-active .ns-about-brand {
        padding-top: calc(var(--ns-header-mobile-height, 58px) + var(--ns-internal-top-gap-mobile)) !important;
    }

    .ns-shop-archive,
    body.woocommerce-order-received .ns-order-received-page {
        padding-top: var(--ns-internal-top-gap-mobile) !important;
    }
}

/* My Selection mobile: keep EN and PT aligned and bring the page content higher.
   This overrides the generic mobile header spacer only for this page. */
@media (max-width: 960px) {
    body.ns-wishlist-active:not(.home) .ns-main {
        padding-top: 0 !important;
    }

    body.ns-wishlist-active .ns-wishlist-page {
        padding-top: 92px !important;
    }
}

@media (max-width: 520px) {
    body.ns-wishlist-active .ns-wishlist-page {
        padding-top: 84px !important;
    }
}

/* Account login/register needs a little more breathing room than compact account dashboards. */
body.woocommerce-account:not(.logged-in) .ns-page,
body.woocommerce-account:not(.logged-in) .ns-page--account {
    padding-top: clamp(64px, 4.4vw, 86px) !important;
}

body.woocommerce-account:not(.logged-in) .ns-page__content,
body.woocommerce-account:not(.logged-in) .ns-page__content > .woocommerce,
body.woocommerce-account:not(.logged-in) .woocommerce,
body.woocommerce-account:not(.logged-in) .woocommerce .ns-account-page,
body.woocommerce-account:not(.logged-in) #customer_login,
body.woocommerce-account:not(.logged-in) .ns-account-auth-grid {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

@media (max-width: 960px) {
    body.woocommerce-account:not(.logged-in) .ns-page,
    body.woocommerce-account:not(.logged-in) .ns-page--account {
        padding-top: 48px !important;
    }
}


/* Dedicated Order Tracking page: clean Noseams styling for the plugin shortcode. */
body.ns-track-order-active .ns-page--track-order {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: clamp(76px, 6.5vw, 118px) !important;
    padding-right: var(--ns-side-space) !important;
    padding-left: var(--ns-side-space) !important;
    text-align: center;
}

body.ns-track-order-active .ns-page--track-order > h1 {
    width: min(100%, 760px);
    margin: 0 auto clamp(32px, 3vw, 46px) !important;
    color: var(--ns-black);
    font-size: clamp(30px, 3.2vw, 48px) !important;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content {
    width: min(100%, 640px);
    max-width: 640px;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: center;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content form,
body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-form-track-order,
body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-track-order-form,
body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-tracking-form,
body.ns-track-order-active .ns-page--track-order .ns-page__content .woo-orders-tracking-form,
body.ns-track-order-active .ns-page--track-order .ns-page__content .track-order-form,
body.ns-track-order-active .ns-page--track-order .ns-page__content .form-track-order {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="text"],
body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="search"],
body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="number"],
body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="email"] {
    width: 100%;
    min-width: 0;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 1px solid var(--ns-line) !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: var(--ns-white) !important;
    box-shadow: none !important;
    color: var(--ns-black) !important;
    font-size: 12px !important;
    line-height: 44px !important;
    outline: 0 !important;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content input::placeholder {
    color: #7a7472;
    opacity: 1;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content button,
body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="submit"],
body.ns-track-order-active .ns-page--track-order .ns-page__content .button,
body.ns-track-order-active .ns-page--track-order .ns-page__content a.button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 136px;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    border: 1px solid var(--ns-black) !important;
    border-radius: 0 !important;
    background: var(--ns-black) !important;
    box-shadow: none !important;
    color: var(--ns-white) !important;
    font-size: 11px !important;
    font-weight: 700;
    line-height: 1 !important;
    letter-spacing: 0.14em;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content button:hover,
body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="submit"]:hover,
body.ns-track-order-active .ns-page--track-order .ns-page__content .button:hover,
body.ns-track-order-active .ns-page--track-order .ns-page__content a.button:hover {
    background: var(--ns-black) !important;
    color: var(--ns-white) !important;
    opacity: 0.86;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content p,
body.ns-track-order-active .ns-page--track-order .ns-page__content .description,
body.ns-track-order-active .ns-page--track-order .ns-page__content .desc {
    max-width: 520px;
    margin: 18px auto 0 !important;
    color: #4b4748;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content table {
    width: 100%;
    margin-top: 34px;
    border-collapse: collapse;
    color: var(--ns-black);
    font-size: 12px;
    text-align: left;
}

body.ns-track-order-active .ns-page--track-order .ns-page__content th,
body.ns-track-order-active .ns-page--track-order .ns-page__content td {
    padding: 12px 0;
    border-bottom: 1px solid var(--ns-line);
}

body.ns-track-order-active .ns-page--track-order .ns-page__content a:not(.button) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 960px) {
    body.ns-track-order-active .ns-page--track-order {
        padding-top: 46px !important;
        padding-right: 22px !important;
        padding-left: 22px !important;
    }

    body.ns-track-order-active .ns-page--track-order > h1 {
        width: min(100%, 420px);
        margin-bottom: 28px !important;
        font-size: 26px !important;
        letter-spacing: 0.07em;
    }

    body.ns-track-order-active .ns-page--track-order .ns-page__content {
        width: min(100%, 420px);
    }

    body.ns-track-order-active .ns-page--track-order .ns-page__content form,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-form-track-order,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-track-order-form,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .vi-wot-tracking-form,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .woo-orders-tracking-form,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .track-order-form,
    body.ns-track-order-active .ns-page--track-order .ns-page__content .form-track-order {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="text"],
    body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="search"],
    body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="number"],
    body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="email"] {
        height: 42px !important;
        border-right: 1px solid var(--ns-line) !important;
        line-height: 42px !important;
    }

    body.ns-track-order-active .ns-page--track-order .ns-page__content button,
    body.ns-track-order-active .ns-page--track-order .ns-page__content input[type="submit"],
    body.ns-track-order-active .ns-page--track-order .ns-page__content .button,
    body.ns-track-order-active .ns-page--track-order .ns-page__content a.button {
        width: 100%;
        min-width: 0;
        height: 42px !important;
    }
}

/* ========================================================================== 
   NOSEAMS — Short page states centred in the available screen
   Applies only when the page content is genuinely compact: empty cart,
   empty checkout notice, tracking form, empty wishlist and empty search.
   Normal pages with products/forms/tables keep their existing layout.
   ========================================================================== */

body.ns-short-content-active.ns-empty-cart-active .ns-page--cart,
body.ns-short-content-active.ns-empty-checkout-active .ns-page--checkout,
body.ns-track-order-active .ns-page--track-order,
body.search .ns-page:has(.ns-search-page__empty),
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) {
    min-height: calc(100svh - var(--ns-header-desktop-height, 132px)) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: clamp(36px, 5vh, 72px) !important;
    padding-bottom: clamp(72px, 9vh, 132px) !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

body.ns-short-content-active.ns-empty-cart-active .ns-page--cart .ns-page__content,
body.ns-short-content-active.ns-empty-checkout-active .ns-page--checkout .ns-page__content,
body.ns-track-order-active .ns-page--track-order .ns-page__content,
body.search .ns-page:has(.ns-search-page__empty) .ns-page__content,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__header,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__empty {
    width: min(100%, 640px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty,
body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty--page,
body.ns-short-content-active.ns-empty-cart-active .wp-block-woocommerce-empty-cart-block,
body.ns-short-content-active.ns-empty-checkout-active .woocommerce,
body.ns-short-content-active.ns-empty-checkout-active .woocommerce-info,
body.search .ns-page:has(.ns-search-page__empty) .ns-search-page__empty,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__empty {
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 22px !important;
    text-align: center !important;
}

body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty h1,
body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty--page h1,
body.search .ns-page:has(.ns-search-page__empty) h1,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__title {
    text-align: center !important;
}

body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty p,
body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty--page p,
body.search .ns-page:has(.ns-search-page__empty) .ns-search-page__empty,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__intro,
body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__empty {
    max-width: 520px !important;
    text-align: center !important;
}

body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty .button,
body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty--page .button,
body.ns-short-content-active.ns-empty-cart-active .wp-block-woocommerce-empty-cart-block .button,
body.ns-short-content-active.ns-empty-checkout-active .woocommerce-info .button {
    align-self: center !important;
}

@media (max-width: 960px) {
    body.ns-short-content-active.ns-empty-cart-active .ns-page--cart,
    body.ns-short-content-active.ns-empty-checkout-active .ns-page--checkout,
    body.ns-track-order-active .ns-page--track-order,
    body.search .ns-page:has(.ns-search-page__empty),
    body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) {
        min-height: calc(100svh - var(--ns-header-mobile-height, 58px)) !important;
        padding-top: 34px !important;
        padding-right: 22px !important;
        padding-bottom: 72px !important;
        padding-left: 22px !important;
    }

    body.ns-short-content-active.ns-empty-cart-active .ns-page--cart .ns-page__content,
    body.ns-short-content-active.ns-empty-checkout-active .ns-page--checkout .ns-page__content,
    body.ns-track-order-active .ns-page--track-order .ns-page__content,
    body.search .ns-page:has(.ns-search-page__empty) .ns-page__content,
    body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__header,
    body.ns-wishlist-active .ns-wishlist-page:has(.ns-wishlist-page__empty:not([hidden])) .ns-wishlist-page__empty {
        width: min(100%, 420px) !important;
    }

    body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty .button,
    body.ns-short-content-active.ns-empty-cart-active .ns-cart-empty--page .button,
    body.ns-short-content-active.ns-empty-cart-active .wp-block-woocommerce-empty-cart-block .button,
    body.ns-short-content-active.ns-empty-checkout-active .woocommerce-info .button {
        width: 100% !important;
        max-width: 320px !important;
    }
}
