/*
 * Premium Wagyu — supplemental styles
 * Everything here is behavior theme.json can't express: hover/pseudo-class
 * states, sticky positioning, custom scrollbar, and fine layout details.
 */

html {
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--wp--preset--color--base-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--wp--preset--color--border-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--wp--preset--color--accent);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--wp--preset--color--border-color);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Note: backdrop-filter was intentionally removed above. It creates a CSS
   "containing block" for any position:fixed descendant (like the mobile
   nav's full-screen overlay dialog), trapping it inside the header's own
   small box instead of covering the viewport. Background opacity bumped
   to 0.95 to compensate visually for the lost blur effect. */

.site-header__inner {
    position: relative;
    min-height: 6rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.site-nav .wp-block-navigation-item > a {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.site-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    gap: 0.25rem !important;
}

.site-logo__title a {
    font-family: var(--wp--preset--font-family--serif);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.375rem;
    color: var(--wp--preset--color--text-light);
}

.site-logo__tagline {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.55rem !important;
    color: var(--wp--preset--color--accent);
    margin: 0;
}

.cart-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    color: var(--wp--preset--color--text-light);
    /* The count badge is absolutely positioned at right: -0.75rem, which pushed
       it past the viewport edge and caused a horizontal scrollbar at every
       screen width. Shifting the icon left by the same amount gives the badge
       room to sit flush against the edge instead of overflowing.
       !important is required: a WordPress block-layout rule resets margins on
       header children and would otherwise win the cascade. */
    margin-right: 0.75rem !important;
}
.cart-icon:hover {
    color: var(--wp--preset--color--accent);
}
.cart-icon__label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--wp--preset--color--text-muted);
}
.cart-icon:hover .cart-icon__label {
    color: var(--wp--preset--color--accent);
}
.cart-icon__count {
    position: absolute;
    top: -0.5rem;
    right: -0.75rem;
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--base-dark);
    border-radius: 999px;
    width: 1rem;
    height: 1rem;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 781px) {
    .cart-icon__label {
        display: none;
    }
}

/* WordPress decides whether to show the inline nav or the hamburger based
   purely on whether the nav items fit their own row — it has no idea the
   centered logo/tagline also needs room in the middle of that same row.
   On tablet/landscape-phone widths the two collide. Force the hamburger
   any time there isn't enough width to safely fit both.
   Measured: with the current 6-item menu the inline nav still overlaps the
   logo at 1100px and only clears by ~9px at 1150px, so the switch happens at
   1200px to keep comfortable breathing room. */
@media (max-width: 1200px) {
    .site-nav > .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none !important;
    }
    .site-nav > .wp-block-navigation__responsive-container-open {
        display: flex !important;
    }
}

/* Mobile nav overlay */
.wp-block-navigation__responsive-dialog {
    background-color: var(--wp--preset--color--base-dark) !important;
}
.site-nav .wp-block-navigation-item > a {
    color: var(--wp--preset--color--text-muted);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a {
    font-family: var(--wp--preset--font-family--serif);
    font-size: 1.75rem;
    text-transform: none;
    letter-spacing: normal;
}

/* ---------- Hero ---------- */

.hero-section {
    position: relative;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.hero-heading {
    line-height: 1.1;
}

.hero-heading__muted {
    font-style: italic;
    color: var(--wp--preset--color--text-muted);
}

.hero-subtext {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--wp--preset--color--text-muted);
    animation: hero-bounce 1.5s infinite;
}

@keyframes hero-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -25%); }
}

/* ---------- Shop / Product grid ---------- */

.shop-section {
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.shop-heading {
    text-align: center;
    margin-bottom: 5rem !important;
    gap: 1rem !important;
}

.shop-heading__divider {
    width: 6rem;
    margin-left: auto;
    margin-right: auto;
    border-color: var(--wp--preset--color--accent);
    opacity: 1;
}

.product-grid {
    column-gap: 3rem !important;
    row-gap: 4rem !important;
}

.product-card {
    text-align: center;
}

.product-card__media {
    position: relative;
    overflow: hidden;
    background-color: var(--wp--preset--color--card);
    aspect-ratio: 4 / 5;
    margin-bottom: 1.5rem;
}

.product-card__image {
    margin: 0;
    height: 100%;
    width: 100%;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--base-dark);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    margin: 0;
}

.product-card__quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    justify-content: center !important;
}

.product-card:hover .product-card__quick-add {
    transform: translateY(0);
    opacity: 1;
}

.product-card__quick-add .wp-block-button__link {
    width: 100%;
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    border-color: rgba(212, 175, 55, 0.5);
    color: var(--wp--preset--color--accent);
}
.product-card__quick-add .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--base-dark);
}

.product-card__title {
    margin-bottom: 0.25rem !important;
}

.product-card__meta {
    margin-bottom: 0.25rem !important;
    font-weight: 300;
}

.product-card__price {
    letter-spacing: 0.05em;
}

/* ---------- Heritage ---------- */

.heritage-section {
    padding-top: 6rem;
    padding-bottom: 6rem;
    border-top: 1px solid var(--wp--preset--color--border-color);
}

.heritage-media__image {
    height: 600px;
    width: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: filter 0.7s ease, opacity 0.7s ease;
}

.heritage-media:hover .heritage-media__image {
    filter: grayscale(0%);
    opacity: 1;
}

.heritage-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.heritage-link a {
    border-bottom: 1px solid var(--wp--preset--color--accent);
    padding-bottom: 0.25rem;
    color: var(--wp--preset--color--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.875rem;
}
.heritage-link a:hover {
    color: var(--wp--preset--color--text-light);
    border-color: var(--wp--preset--color--text-light);
}

/* ---------- Footer ---------- */

.site-footer {
    padding-top: 5rem;
    padding-bottom: 2.5rem;
    border-top: 1px solid var(--wp--preset--color--border-color);
    text-align: center;
}

.site-footer__title a {
    font-family: var(--wp--preset--font-family--serif);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.5rem;
}

.site-footer__social {
    justify-content: center;
}

.site-footer__legal .wp-block-navigation-item > a {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--wp--preset--color--text-muted);
}

.site-footer__copyright {
    letter-spacing: 0.05em;
}

/* ---------- New page sections (heritage full page, contact, FAQ) ---------- */

.heritage-page,
.contact-page,
.faq-section {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.heritage-page__body,
.contact-page__body {
    margin-top: 2rem;
}

/* =====================================================================
   Responsive: Mobile
   Everything below tightens up spacing and fixes touch-interaction bugs
   that only show up under ~782px (WordPress's own mobile breakpoint) or
   on touch devices generally.
   ===================================================================== */

/* Product "Quick Add" is hover-only, which makes it unreachable on any
   touch device (no hover event) — pin it visible instead of hidden. */
@media (hover: none), (max-width: 781px) {
    .product-card__quick-add {
        position: static;
        transform: none;
        opacity: 1;
        padding: 1rem 0 0;
    }
    .product-card__quick-add .wp-block-button__link {
        background-color: var(--wp--preset--color--card);
        border-color: var(--wp--preset--color--accent);
    }
}

/* Hero: 100vh overshoots on mobile browsers with a collapsing address
   bar, pushing the button/scroll indicator below the fold. 100svh tracks
   the actually-visible viewport; unsupported browsers keep the vh value. */
@media (max-width: 781px) {
    .hero-section {
        min-height: 100svh !important;
    }
}

@media (max-width: 600px) {
    .shop-section,
    .heritage-section,
    .heritage-page,
    .contact-page,
    .faq-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .shop-heading {
        margin-bottom: 2.5rem !important;
    }

    .product-grid {
        row-gap: 2.5rem !important;
        column-gap: 1.5rem !important;
    }

    .heritage-media__image {
        height: 320px;
    }

    .site-footer {
        padding-top: 3rem;
    }
}

/* Header: absolutely-centered logo can collide with the hamburger/cart
   icons once the tagline pushes its width past the safe zone. */
@media (max-width: 480px) {
    .site-header__inner {
        min-height: 5rem;
    }

    .site-logo {
        max-width: 65vw;
    }

    .site-logo__title a {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    .site-logo__tagline {
        display: none;
    }

    .hero-eyebrow {
        letter-spacing: 0.15em;
        font-size: 0.7rem;
    }
}
