/**
 * Components
 */

/* --- Buttons --- */
.wp-block-button__link {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}

.wp-block-button__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--cosmic-blue) !important;
    color: var(--wp--preset--color--white) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--cosmic-blue) !important;
    color: var(--wp--preset--color--white) !important;
    border-color: var(--wp--preset--color--charcoal) !important;
}

/* Link Effects */
a:where(:not(.wp-block-button__link)) {
    color: var(--wp--preset--color--cosmic-blue);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.3s;
}

a:where(:not(.wp-block-button__link)):hover {
    background-size: 100% 1px;
}

/* --- Technical Pills (Internal & Style) --- */
.has-internal-pill {
    border-radius: 24px;
    overflow: hidden;
}

.is-style-technical-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-family: var(--wp--preset--font-family--roboto-mono) !important;
    font-size: 0.65rem !important;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--wp--preset--color--cosmic-blue-light);
    margin-bottom: 1.5rem !important;
}

.is-dark-section .is-style-technical-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Technical Cards --- */
.is-technical-card,
.is-technical-card-dark {
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    position: relative;
    transform: translateY(0);
}

.is-technical-card {
    background-color: var(--wp--preset--color--white);
    color: var(--wp--preset--color--charcoal);
    border: 1px solid var(--wp--preset--color--border-gray);
}

.is-technical-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.12);
}

.is-technical-card-dark {
    background-color: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    border: 1px solid var(--glass-border);
}

.is-technical-card-dark:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.4);
}

.is-technical-card p:not(.is-tech-index) {
    color: inherit;
}

.is-technical-card-dark p:not(.is-tech-index) {
    color: inherit;
    opacity: 0.8;
}

.is-technical-card .wp-block-group {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.is-tech-index,
.is-tech-label {
    font-family: var(--wp--preset--font-family--roboto-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--cosmic-blue-light);
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.is-tech-label {
    text-transform: uppercase;
}

.is-technical-card .wp-block-separator {
    background-color: currentColor;
    opacity: 0.1;
    height: 1px;
    margin: 1.5rem 0 !important;
    border-bottom: 1px solid;
}

/* Map Card */
.has-map-container {
    border-radius: 12px;
    overflow: hidden;
    filter: grayscale(100%);
    border: 1px solid var(--tech-border-light);
}

.has-map-container iframe {
    width: 100%;
    height: 300px;
    border: 0;
}

/* --- Split Card (Scroll Driven) --- */
.is-split-card {
    background: var(--wp--preset--color--white);
    border-radius: 2em;
    overflow: hidden;
    color: var(--wp--preset--color--charcoal);
    height: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease;
    border: 4px solid var(--glass-border);
    /* Animation */
    animation: card-active-effect linear both;
    animation-timeline: view(x);
    animation-range: cover 0% cover 100%;
    transform-origin: left center;
}

.is-split-card:hover {
    transform: scale(1);
}

.is-split-card[id] {
    scroll-margin-top: 250px;
}

.is-split-card .wp-block-cover {
    height: auto !important;
    min-height: 100% !important;
    align-self: stretch;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 0 24px 24px !important;
    position: relative !important;
    overflow: hidden !important;
}

.is-split-card .wp-block-cover__image-background {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 1.75em;
}

/* Scroll Marker for Split Card */
.is-split-card::scroll-marker {
    content: attr(data-marker-content);
    background: var(--glass-bg);
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--wp--preset--font-family--inter);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 38px;
    /* Remove link underline effect */
    text-decoration: none !important;
    background-image: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

.is-split-card::scroll-marker:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--wp--preset--color--white);
}

.is-split-card::scroll-marker:target-current {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--charcoal);
    border-color: var(--wp--preset--color--white);
    font-weight: 600;
}

@media (min-width: 782px) {
    .is-split-card {
        flex-direction: row;
        align-items: stretch;
    }

    .is-split-card>* {
        flex: 1;
        width: 80%;
        display: flex;
        flex-direction: column;
    }

    .is-split-card>.wp-block-group {
        align-items: flex-start;
        text-align: left;
        justify-content: flex-end;
    }

    .is-split-card .wp-block-cover {
        border-radius: 0 24px 24px 0 !important;
    }
}

/* First slide should appear active at load (CSS fallback for scroll-driven animation) */
.is-style-horizontal-scroll>.is-split-card:first-child {
    background-color: var(--wp--preset--color--white);
    color: var(--wp--preset--color--charcoal);
    opacity: 1;
    transform: scale(1);
}

/* --- Horizontal Scroll Container --- */
.is-style-horizontal-scroll {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    position: relative;
    scroll-padding-left: 2rem;
    /* Anchor for absolute buttons */
}

.is-style-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.is-style-horizontal-scroll>* {
    flex: 0 0 65%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Mobile */
@media (min-width: 782px) {
    .is-style-horizontal-scroll>* {
        flex: 0 0 70%;
    }
}

/* Hero Specific Override */
.is-carousel-slide {
    scroll-snap-align: center;
    flex: 0 0 85%;
}

@media (min-width: 782px) {
    .is-carousel-slide {
        flex: 0 0 35%;
    }
}

/* Scroll Markers Group */
.is-style-horizontal-scroll::scroll-marker-group {
    display: flex;
    gap: 1em;
    margin: 0 var(--wp--preset--spacing--20) 3rem;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    align-items: center;
    box-sizing: border-box;
    height: 60px;
    scrollbar-width: none;
}

.is-style-horizontal-scroll::scroll-marker-group::-webkit-scrollbar {
    display: none;
}

/* Scroll Buttons (Arrows) */
.is-style-horizontal-scroll::scroll-button(inline-start),
.is-style-horizontal-scroll::scroll-button(inline-end) {
    position: absolute;
    top: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.is-style-horizontal-scroll::scroll-button(inline-start):hover,
.is-style-horizontal-scroll::scroll-button(inline-end):hover {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--charcoal);
    border-color: var(--wp--preset--color--white);
}

.is-style-horizontal-scroll::scroll-button(inline-start) {
    right: 60px;
    content: "←";
}

.is-style-horizontal-scroll::scroll-button(inline-end) {
    right: var(--wp--preset--spacing--40);
    content: "→";
}

/* Dark Grid Variant */
.is-style-dark-grid {
    background-color: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    position: relative;
    overflow: hidden;
}

.is-style-dark-grid::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.is-style-dark-grid>* {
    position: relative;
    z-index: 1;
}

/* --- Vertical Services (Quechua Style) --- */
.is-layout-vertical-services {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--40);
}

.is-style-vertical-scroll {
    height: 85vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    border-radius: 32px;
    background: var(--wp--preset--color--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    position: relative;
    padding: 0 !important;
}

.is-style-vertical-scroll::-webkit-scrollbar {
    display: none;
}

.is-vertical-slide {
    height: 100%;
    width: 100%;
    min-height: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
}

.is-vertical-slide .wp-block-cover__inner-container {
    width: 100%;
    padding: var(--wp--preset--spacing--60) !important;
    z-index: 2;
}

/* Sticky Sidebar Layout */
@media (min-width: 782px) {
    .is-layout-vertical-services {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        grid-template-areas: "stack";
        gap: 0;
        align-items: start;
        position: relative;
        padding-top: 0.75em;
    }

    .is-layout-vertical-services>* {
        grid-area: stack;
        width: 100%;
    }

    .is-style-vertical-scroll {
        min-width: 0;
        z-index: 1;
    }

    .is-sticky-sidebar {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: sticky;
        top: 0;
        height: 85vh;
        z-index: 50;
        pointer-events: none;
        /* Click through */
        padding: 4rem;
    }

    .is-sticky-sidebar>* {
        pointer-events: auto;
    }

    /* Restore click */

    .is-sticky-sidebar .services-nav-container,
    .is-sticky-sidebar .services-nav-container .services-nav {
        align-self: flex-end;
        text-align: right;
        align-items: flex-end;
        display: flex;
        flex-direction: column;
        pointer-events: auto;
    }

    .is-sticky-sidebar>.wp-block-group:first-child {
        align-self: flex-start;
        text-align: left;
    }
}

/* Vertical Styles Mobile Fallback */
@media (max-width: 781px) {
    .is-style-vertical-scroll {
        height: auto;
        overflow-y: auto;
        scroll-snap-type: x mandatory;
        display: flex;
        flex-direction: row;
        overflow-x: scroll;
        scroll-padding-left: var(--wp--preset--spacing--40);
        padding-bottom: 2rem !important;
    }

    .is-vertical-slide {
        height: 65vh;
        flex: 0 0 85%;
        border-radius: 24px;
        scroll-snap-align: center;
        margin-right: var(--wp--preset--spacing--20) !important;
    }

    .is-vertical-slide:first-child {
        margin-left: var(--wp--preset--spacing--40) !important;
    }
}

/* Nav Pills inside Vertical Service */
.is-nav-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    color: var(--wp--preset--color--charcoal);
    text-decoration: none;
    font-family: var(--wp--preset--font-family--outfit);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    opacity: 0.5;
    width: fit-content;
}

.is-nav-pill:hover,
.is-nav-pill.is-active,
.is-nav-pill:target {
    opacity: 1;
    background: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding-left: 2rem;
}

/* Arrow Animation */
.is-nav-pill::before {
    content: "←";
    position: absolute;
    left: 0.8rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 400;
    pointer-events: none;
}

.is-nav-pill:hover::before,
.is-nav-pill.is-active::before {
    opacity: 1;
    transform: translateX(0);
}

/* --- Poster Aesthetic --- */
.has-light-gray-tech-background-color {
    background-color: #f4f4f4 !important;
}

.is-poster-slide {
    position: relative !important;
    isolation: isolate;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    overflow: hidden !important;
}

.is-poster-bg-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    pointer-events: none !important;
    line-height: 0.8 !important;
    color: transparent !important;
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.08);
    opacity: 1 !important;
    white-space: nowrap !important;
}

.is-poster-object {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.is-poster-object img {
    width: auto !important;
    max-width: 90% !important;
    max-height: 60vh !important;
    object-fit: contain !important;
    transform: scale(0.9);
    border-radius: 3em;
    background: rgba(255, 255, 255, 0.65);
    filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.25));
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-poster-content {
    position: relative !important;
    z-index: 3 !important;
    max-width: 450px !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.is-poster-slide:hover .is-poster-object img {
    transform: scale(1);
    background: transparent;
}

.is-poster-slide:hover .is-poster-bg-text {
    -webkit-text-stroke-color: rgba(0, 0, 0, 0.15);
}

/* --- Narrative Route --- */
.scroll-snap-container {
    position: relative;
    padding-top: 60px;
    padding-bottom: 240px;
    background-color: var(--wp--preset--color--white);
    overflow: hidden;
    background-image: linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

.narrative-route-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
    color: var(--wp--preset--color--charcoal);
}

.route-path-line {
    stroke-width: 1px;
}

.narrative-section {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    display: flex;
    width: 100%;
}

.narrative-content {
    max-width: 380px;
    position: relative;
}

.narrative-content p {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--wp--preset--color--charcoal);
}

.narrative-image img {
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.max-w-narrative-image {
    max-width: 450px !important;
    height: auto !important;
}

.max-w-narrative-image-small {
    max-width: 350px !important;
    height: auto !important;
}

.narrative-marker-text {
    display: inline-block;
    font-family: var(--wp--preset--font-family--roboto-mono);
    font-size: 0.8rem;
    color: var(--wp--preset--color--charcoal);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0 5px;
    background: var(--wp--preset--color--white);
}

/* Positioning Variants */
.narrative-section.is-left {
    justify-content: flex-start;
    padding-left: 15%;
}

.narrative-section.is-left .narrative-content {
    margin-right: auto;
}

.narrative-section.is-right {
    justify-content: flex-end;
    padding-right: 15%;
}

.narrative-section.is-right .narrative-content {
    margin-left: auto;
    text-align: right;
}

.narrative-section.is-center {
    justify-content: center;
    text-align: center;
    padding-top: 6rem;
}

@media (max-width: 768px) {
    .narrative-section {
        margin-bottom: 20px;
        justify-content: center !important;
        padding: 0 20px !important;
        text-align: center !important;
    }

    .narrative-content {
        text-align: center !important;
        max-width: 100%;
    }

    .narrative-route-svg {
        display: none;
    }
}

/* --- Navigation Enhancements --- */
.wp-block-navigation .wp-block-navigation-item.current-menu-item>.wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-link.current-menu-item>.wp-block-navigation-item__content {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.wp-block-navigation .wp-block-navigation-item.current-menu-item>.wp-block-navigation-item__content::before,
.wp-block-navigation .wp-block-navigation-item.current-menu-item>.wp-block-navigation-item__content::after {
    font-family: var(--wp--preset--font-family--roboto-mono);
    font-size: 0.9em;
    font-weight: 400;
}

.wp-block-navigation .wp-block-navigation-item.current-menu-item>.wp-block-navigation-item__content::before {
    content: "[";
}

.wp-block-navigation .wp-block-navigation-item.current-menu-item>.wp-block-navigation-item__content::after {
    content: "]";
}

/* --- Contact Form --- */
.novamotion-modern-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 782px) {
    .novamotion-modern-form {
        grid-template-columns: 1fr 1fr;
    }
}

.novamotion-modern-form .form-group-full {
    grid-column: 1 / -1;
}

.novamotion-modern-form .form-group-half {
    grid-column: span 1;
}

/* --- Customer Account Icon Fix --- */
.wp-block-woocommerce-customer-account {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-block-woocommerce-customer-account a {
    display: flex;
    color: currentColor;
    text-decoration: none;
}

.wp-block-woocommerce-customer-account svg {
    width: 1.5em;
    height: 1.5em;
    fill: none;
}

.wp-block-woocommerce-customer-account:hover {
    opacity: 0.7;
}

.novamotion-modern-form label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: #888;
}

.novamotion-modern-form input,
.novamotion-modern-form textarea {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    padding: 0.5rem 0;
    font-family: var(--wp--preset--font-family--outfit), sans-serif;
    font-size: 1.2rem;
    outline: none;
    color: var(--wp--preset--color--charcoal);
    transition: border-color 0.3s ease;
}

.novamotion-modern-form input:focus,
.novamotion-modern-form textarea:focus {
    border-color: var(--wp--preset--color--charcoal);
}

.novamotion-modern-form textarea {
    resize: vertical;
    min-height: 80px;
}

.novamotion-modern-form button[type="submit"] {
    background: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-family: var(--wp--preset--font-family--outfit), sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.novamotion-modern-form button[type="submit"]:hover {
    background: black;
    transform: translateY(-2px);
}

/* Base Gallery Wrapper */
.wc-block-product-gallery {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    height: auto !important;
    /* Prevent excessive growth */
    align-items: flex-start !important;
    /* Avoid stretching children */
}

/* Large Image Container */
.wc-block-product-gallery-large-image {
    width: 100% !important;
    order: 1;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #f9f9f9;
    position: relative;
    max-height: 80vh;
    /* Safety cap */
}

.wc-block-product-gallery-large-image__container {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.wc-block-product-gallery-large-image img,
.wc-block-product-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

/* Thumbnails Section */
.wc-block-product-gallery-thumbnails {
    width: 100% !important;
    order: 2;
    overflow: hidden;
    height: auto !important;
    max-height: 150px !important;
    /* Vital hard cap to prevent 3000px growth */
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

.wc-block-product-gallery-thumbnails__scrollable {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    list-style: none !important;
    overflow-x: auto !important;
    scrollbar-width: none;
}

.wc-block-product-gallery-thumbnails__thumbnail {
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 80px !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    transition: transform 0.2s ease;
}

.wc-block-product-gallery-thumbnails__thumbnail:hover {
    transform: translateY(-2px);
}

.wc-block-product-gallery-thumbnails__thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Active/Selected Thumbnail */
.wc-block-product-gallery-thumbnails__thumbnail .wc-block-product-gallery-thumbnails__thumbnail__image--is-active {
    outline: 2px solid var(--wp--preset--color--charcoal) !important;
    outline-offset: -2px;
    border-radius: 6px !important;
}

/* Sale Badge alignment */
.wc-block-product-sale-badge {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 10;
}

/* Attributes visibility fix */
.wp-block-woocommerce-product-details.has-technical-attributes {
    display: block !important;
    visibility: visible !important;
    min-height: 50px;
    /* Ensure space if loading */
}

/* Attributes display */
.woocommerce-product-attributes {
    display: table !important;
    width: 100% !important;
}

.woocommerce div.product form.cart .variations {
    margin-bottom: 0 !important;
}

.woocommerce div.product form.cart .variations td,
.woocommerce div.product form.cart .variations th {
    line-height: 0;
}

.woocommerce div.product form.cart table td {
    padding: 0.2em 0 !important;
}

.woocommerce div.product form.cart .woocommerce-variation-description p {
    font-size: 16px;
}

/* Add to Cart refinements */

.wp-block-add-to-cart-form .cart {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wp-block-add-to-cart-form .quantity input {
    height: 48px;
    border-radius: 50px;
    border: 1px solid #ddd;
    width: 60px;
    text-align: center;
    font-family: var(--wp--preset--font-family--outfit);
}

.wp-block-add-to-cart-form button.single_add_to_cart_button {
    height: 48px;
    background: var(--wp--preset--color--cosmic-blue);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0 2.5rem;
    font-family: var(--wp--preset--font-family--outfit);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    flex-grow: 1;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wp-block-add-to-cart-form button.single_add_to_cart_button:hover {
    background: var(--wp--preset--color--charcoal);
}

/* --- WooCommerce Product Details (Technical) --- */
.wc-block-product-tabs,
.woocommerce-tabs {
    display: none !important;
}

/* Specific technical heading with border */
.has-border-bottom-tech {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.8rem !important;
    display: inline-block !important;
    width: 450px !important;
    max-width: 100% !important;
}

.wc-block-product-attributes {
    margin-top: 0;
    border: none !important;
}

.woocommerce-product-attributes {
    width: 100% !important;
    border-collapse: collapse !important;
    display: table !important;
}

.woocommerce-product-attributes-item {
    display: table-row !important;
    border: none !important;
}

.woocommerce-product-attributes-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.woocommerce-product-attributes-item__label,
.woocommerce-product-attributes-item__value {
    display: table-cell !important;
    padding: 0.3rem 0 !important;
    vertical-align: baseline;
}

.woocommerce-product-attributes-item__label {
    font-family: var(--wp--preset--font-family--jetbrains-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--wp--preset--color--tech-gray);
    width: 151px;
    /* Fixed width to pull values closer */
    font-weight: 400;
    text-align: left;
    background: transparent !important;
}

.woocommerce-product-attributes-item__value {
    font-family: var(--wp--preset--font-family--outfit);
    font-size: 0.9rem;
    color: var(--wp--preset--color--charcoal);
    font-weight: 600;
    text-align: left;
    font-style: italic;
    background: transparent !important;
}

.woocommerce-product-attributes-item__value p {
    margin: 0 !important;
}

/* Hide Redundant WooCommerce Titles */
.wc-block-components-product-reviews__title,
.woocommerce-reviews-title,
.woocommerce-Reviews-title,
.woocommerce-reviews h2,
.woocommerce-product-reviews h2 {
    display: none !important;
}

.wc-block-components-product-reviews .wc-block-components-review-list {
    margin-bottom: 4rem !important;
}

/* Hide redundant inner review title if exists */
.wc-block-components-product-reviews__title,
.woocommerce-Reviews-title {
    display: none !important;
}

.wc-block-components-review-list-item {
    margin-bottom: 2.5rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1.5rem;
}

.wc-block-components-review-list-item__text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--wp--preset--color--charcoal);
    font-weight: 500;
}

.wc-block-components-review-list-item__meta {
    font-family: var(--wp--preset--font-family--jetbrains-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--wp--preset--color--tech-gray);
    margin-top: 0.5rem;
}

/* Review Form Refinement */
.comment-respond {
    background: rgba(0, 0, 0, 0.015);
    padding: 2.5rem;
    border-radius: 4px;
}

.comment-reply-title {
    display: inline-block;
    font-family: var(--wp--preset--font-family--jetbrains-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--tech-gray);
    margin-bottom: 2rem !important;
}

.comment-form p {
    margin-bottom: 1.5rem;
}

.comment-form label {
    display: block;
    font-family: var(--wp--preset--font-family--jetbrains-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--wp--preset--color--tech-gray);
    margin-bottom: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    font-family: var(--wp--preset--font-family--outfit);
    font-size: 1rem;
    color: var(--wp--preset--color--charcoal);
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--charcoal);
}

.comment-form select {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    padding: 0.5rem;
    font-family: var(--wp--preset--font-family--outfit);
}

.comment-form .submit {
    margin-top: 1rem;
    padding: 1rem 3rem !important;
    border-radius: 9999px !important;
    font-family: var(--wp--preset--font-family--outfit) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    background: var(--wp--preset--color--charcoal) !important;
    color: white !important;
    border: none !important;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Star Rating Styling - Individual clickable stars */
.stars span {
    display: flex;
    gap: 4px;
    height: 1.5rem;
    align-items: center;
}

.stars span a {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    text-indent: -999em;
    display: inline-block;
    overflow: hidden;
}

.stars span a::before {
    content: "\f155";
    /* Dashicon star-empty (outline) */
    font-family: dashicons !important;
    text-indent: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    color: var(--wp--preset--color--charcoal);
    opacity: 1;
    /* Crisp outline */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s ease;
}

.stars span a:hover::before,
.stars span a.active::before {
    content: "\f154";
    /* Dashicon star-filled */
    color: var(--wp--preset--color--charcoal);
}

/* Fix Quantity Input */
.quantity input.qty {
    width: 3.5rem !important;
    height: 3rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: transparent !important;
    text-align: center !important;
    font-family: var(--wp--preset--font-family--outfit) !important;
    font-weight: 600 !important;
    margin-right: 0.5rem !important;
}

/* Hide Redundant WooCommerce Titles */
.wc-block-components-product-reviews__title,
.woocommerce-reviews-title,
.woocommerce-Reviews-title {
    display: none !important;
}

.wc-block-components-review-list-item__rating {
    display: flex;
    gap: 0.25rem;
    color: var(--wp--preset--color--charcoal);
}

/* Specific product price refinement */
.has-charcoal-color.wp-block-woocommerce-product-price {
    font-family: var(--wp--preset--font-family--outfit);
    letter-spacing: -0.02em;
}

.wp-block-woocommerce-product-price ins {
    text-decoration: none;
    font-weight: 700;
}

.wp-block-woocommerce-product-price del {
    font-size: 0.8em;
    opacity: 0.5;
    margin-right: 0.5em;
}

/* --- Shop Filters --- */
.shop-filter-bar {
    position: relative;
    z-index: 100;
}

.filter-dropdown-wrapper {
    position: relative;
}

.filter-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    color: inherit;
    padding: 0;
    transition: opacity 0.3s ease;
}

.filter-trigger:hover {
    opacity: 0.6;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--border-gray);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.filter-dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown a {
    display: block;
    padding: 8px 20px;
    font-size: 0.75rem;
    color: var(--wp--preset--color--charcoal);
    background-image: none !important;
    /* No underline */
    transition: background 0.2s ease;
}

.filter-dropdown a:hover {
    background: #f8f8f8;
}

/* --- Logo Rows & Technical Spacing --- */
.is-style-tech-logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 0;
}

.is-style-tech-logo-row img {
    max-height: 140px;
    width: auto;
    filter: grayscale(1) opacity(0.85);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-style-tech-logo-row img:hover {
    filter: grayscale(0) invert(0) opacity(1);
    transform: scale(1.05);
}

.has-charcoal-background-color .has-technical-separator {
    opacity: 0.5;
}

.has-charcoal-background-color .has-technical-separator span,
.has-background .has-technical-separator span {
    color: var(--wp--preset--color--cosmic-blue-light);
    font-weight: 500;
}

/* --- Navigation --- */
.main-navigation-group {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 500;
    font-style: normal;
}

.main-navigation-group p {
    margin: 0 !important;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.nav-logo-link:hover {
    opacity: 0.7;
}


.nav-logo {
    height: 12px !important;
    width: auto;
}

/* --- Global Layout Fixes --- */
html,
body {
    max-width: 100%;
    overflow-x: clip;
    position: relative;
}

header,
.wp-block-template-part-header {
    width: 100% !important;
    max-width: 100% !important;
}

.wp-block-site-title {
    white-space: nowrap !important;
}

@media (max-width: 781px) {
    .is-hidden-mobile {
        display: none !important;
    }

    .wp-block-site-title {
        font-size: 1.1rem !important;
    }
}

/* Remove Gutenberg's default margin from main when it's the first content container */
.wp-site-blocks>main:first-of-type {
    margin-block-start: 0 !important;
}