/* Victor Scientific Co. — premium storefront finishing layer.
 * Deliberately additive: existing layout geometry, colors from Admin settings,
 * product pricing and cart controls remain authoritative.
 */
:root {
    --vsc-premium-radius: 16px;
    --vsc-premium-border: rgba(15, 23, 42, .085);
    --vsc-premium-shadow: 0 8px 26px rgba(15, 23, 42, .055);
    --vsc-premium-shadow-hover: 0 18px 42px rgba(15, 23, 42, .115);
    --vsc-premium-ease: cubic-bezier(.2, .7, .2, 1);
}

body.vsc-premium-storefront {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.vsc-premium-storefront :where(button, .btn, .vsc-cart-btn, .vsc-order-btn, .vsc-icon-btn) {
    transition: transform 160ms var(--vsc-premium-ease),
                box-shadow 180ms var(--vsc-premium-ease),
                border-color 160ms ease,
                background-color 160ms ease;
}

body.vsc-premium-storefront :where(.btn-primary, .vsc-order-btn) {
    box-shadow: 0 5px 14px color-mix(in srgb, var(--site-primary, #0b3b82) 18%, transparent);
}

@media (hover: hover) and (pointer: fine) {
    body.vsc-premium-storefront :where(.btn-primary, .vsc-order-btn):hover {
        transform: translateY(-1px);
        box-shadow: 0 9px 20px color-mix(in srgb, var(--site-primary, #0b3b82) 24%, transparent);
    }
}

body.vsc-premium-storefront :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .form-control, .form-select) {
    border-color: var(--site-border, #dfe4ea);
    border-radius: 10px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

body.vsc-premium-storefront :where(input, select, textarea, .form-control, .form-select):focus {
    border-color: var(--site-primary, #0b3b82);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-primary, #0b3b82) 13%, transparent);
    outline: 0;
}

body.vsc-premium-storefront :where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--site-primary, #0b3b82);
    outline-offset: 3px;
}

/* The new shared product card keeps its existing sizing and price layout. */
body.vsc-premium-storefront .vsc-product-card {
    border-color: var(--site-border, var(--vsc-premium-border));
    border-radius: 18px;
    box-shadow: var(--vsc-premium-shadow);
    background: #fff;
}

body.vsc-premium-storefront .vsc-product-card__media {
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

body.vsc-premium-storefront .vsc-product-card__body {
    background: #fff;
}

body.vsc-premium-storefront .vsc-product-card h3 a {
    text-decoration: none;
    text-underline-offset: 3px;
}

body.vsc-premium-storefront .vsc-product-card h3 a:hover {
    text-decoration: underline;
}

body.vsc-premium-storefront .vsc-product-card .vsc-product-actions :where(button, a) {
    min-height: 40px;
}

body.vsc-premium-storefront :where(.vsc-featured-category, .vsc-brand-card, .campaign-product-card) {
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .045);
    transition: transform 150ms var(--vsc-premium-ease), border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    body.vsc-premium-storefront :where(.vsc-featured-category, .vsc-brand-card, .campaign-product-card):hover {
        transform: translateY(-2px);
    }
}

body.vsc-premium-storefront :where(.section-head h2, .section-head .title, .related-title h5) {
    letter-spacing: -.018em;
    text-wrap: balance;
}

body.vsc-premium-storefront .breadcrumb {
    border-radius: 999px;
}

/* Lightweight scroll indicator; only transform is updated on the compositor. */
.vsc-scroll-progress {
    position: fixed;
    z-index: 1200;
    inset: 0 0 auto;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
}
.vsc-scroll-progress.is-active { opacity: 1; }
.vsc-scroll-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--site-primary, #0b3b82), var(--site-secondary, #1456a0), #42b8bd);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Scroll reveal only activates after JS has confirmed IntersectionObserver support. */
[data-vsc-reveal-state="hidden"] {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
}
[data-vsc-reveal-state="visible"] {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition: opacity 170ms cubic-bezier(.2,.7,.2,1), transform 170ms cubic-bezier(.2,.7,.2,1);
    backface-visibility: hidden;
}

@media (max-width: 767.98px) {
    body.vsc-premium-storefront .vsc-product-card { border-radius: 15px; }
    .vsc-scroll-progress { height: 2px; }
    [data-vsc-reveal-state="visible"] {
        transition-duration: 150ms;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.vsc-premium-storefront *,
    body.vsc-premium-storefront *::before,
    body.vsc-premium-storefront *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    [data-vsc-reveal-state="hidden"] { opacity: 1; transform: none; }
}


/* --------------------------------------------------------------------------
   Phase 2 — refined interaction and motion layer.
   Existing component geometry, pricing, controls and theme colors are retained.
   -------------------------------------------------------------------------- */

body.vsc-premium-storefront :where(
    button, .btn, a.btn, .vsc-cart-btn, .vsc-order-btn, .vsc-icon-btn,
    .order-btn, .order-btn-link, .cart-icon-btn, .cart-icon-link
) {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.vsc-premium-storefront :where(
    button, .btn, a.btn, .vsc-cart-btn, .vsc-order-btn, .vsc-icon-btn,
    .order-btn, .order-btn-link, .cart-icon-btn, .cart-icon-link
):active {
    transform: translateY(1px) scale(.985);
}

body.vsc-premium-storefront :where(
    button, .btn, .vsc-cart-btn, .vsc-order-btn, .vsc-icon-btn
):disabled,
body.vsc-premium-storefront :where(
    button, .btn, .vsc-cart-btn, .vsc-order-btn, .vsc-icon-btn
)[aria-disabled="true"] {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.vsc-premium-storefront :where(
    .vsc-product-card, .vsc-featured-category, .vsc-brand-card,
    .campaign-product-card, .main_product_inner .product_item,
    .product_item.wist_item
):focus-within {
    border-color: var(--site-primary, #0b3b82);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .095);
}

@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
    body.vsc-premium-storefront :where(
        .vsc-product-card, .vsc-featured-category, .vsc-brand-card,
        .campaign-product-card, .main_product_inner .product_item,
        .product_item.wist_item
    ) {
        transition:
            transform 190ms var(--vsc-premium-ease),
            box-shadow 190ms var(--vsc-premium-ease),
            border-color 150ms ease;
    }

    body.vsc-premium-storefront :where(
        .vsc-product-card, .vsc-featured-category, .vsc-brand-card,
        .campaign-product-card, .main_product_inner .product_item,
        .product_item.wist_item
    ):hover {
        border-color: color-mix(in srgb, var(--site-primary, #0b3b82) 24%, var(--site-border, #dfe4ea));
    }

    body.vsc-premium-storefront .vsc-product-card:hover .vsc-product-card__media img,
    body.vsc-premium-storefront .main_product_inner .product_item:hover .pro_img img,
    body.vsc-premium-storefront .product_item.wist_item:hover .pro_img img {
        transform: scale(1.025);
    }
}

/* Reveal is progressive enhancement: without JS/observer, content stays visible. */
[data-vsc-reveal-state="visible"] {
    transition-delay: var(--vsc-reveal-delay, 0ms);
}

@media (hover: none) {
    body.vsc-premium-storefront :where(
        .vsc-product-card, .vsc-featured-category, .vsc-brand-card,
        .campaign-product-card, .main_product_inner .product_item,
        .product_item.wist_item
    ):active {
        box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.vsc-premium-storefront *,
    body.vsc-premium-storefront *::before,
    body.vsc-premium-storefront *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }

    [data-vsc-reveal-state="hidden"],
    [data-vsc-reveal-state="visible"] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .vsc-scroll-progress {
        display: none !important;
    }
}

/* Phase 7.2 — international scientific-commerce image and catalogue system.
   Product artwork remains uncropped; the media frame, not the source image, is square. */
body.vsc-premium-storefront .vsc-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(12px, 1.15vw, 18px);
}

body.vsc-premium-storefront .vsc-product-card {
    min-width: 0;
    height: 100%;
    border-radius: 14px;
}

body.vsc-premium-storefront .vsc-product-card__media {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    place-items: center;
    overflow: hidden;
    padding: clamp(10px, 1.15vw, 17px);
    border-bottom: 1px solid #edf0f3;
    background: #fff;
}

body.vsc-premium-storefront .vsc-product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

body.vsc-premium-storefront .vsc-product-card__body {
    min-width: 0;
    flex: 1 1 auto;
}

/* Do not turn a final odd mobile card into a horizontal feature card. */
body.vsc-premium-storefront.victor-homepage .vsc-product-grid > .vsc-product-card:last-child:nth-child(odd) {
    display: flex !important;
    width: auto !important;
    grid-column: auto !important;
    grid-template-columns: none !important;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-grid > .vsc-product-card:last-child:nth-child(odd) .vsc-product-card__media {
    display: grid !important;
    min-height: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #edf0f3 !important;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-grid > .vsc-product-card:last-child:nth-child(odd) .vsc-product-card__media img {
    height: 100% !important;
}

/* Legacy related-product cards use the same square, contain-fit image language. */
body.vsc-premium-storefront .related-product-section .pro_img,
body.vsc-premium-storefront .related-product-section .pro_img > a {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    background: #fff;
}

body.vsc-premium-storefront .related-product-section .pro_img img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

@media (min-width: 1600px) {
    body.vsc-premium-storefront .vsc-product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.vsc-premium-storefront .vsc-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 767.98px) {
    body.vsc-premium-storefront .vsc-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.vsc-premium-storefront .vsc-product-card__media {
        padding: 9px;
    }

    body.vsc-premium-storefront .vsc-product-card__body {
        padding: 10px;
    }
}

/* Picture wrapper preserves the 8:3 desktop ratio and enables the
   dedicated 8:5 mobile artwork only after every active slide has one. */
body.vsc-premium-storefront.victor-homepage .vsc-slide__picture {
    display: block;
    width: 100%;
    height: 100%;
}

body.vsc-premium-storefront.victor-homepage .vsc-slide__picture img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 767.98px) {
    body.vsc-premium-storefront.victor-homepage .vsc-main-slider--mobile-artwork {
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 8 / 5;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-main-slider--mobile-artwork .vsc-slider-stage {
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 8 / 5 !important;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-main-slider--mobile-artwork .vsc-slide__picture img {
        object-fit: contain;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.vsc-premium-storefront .vsc-product-card,
    body.vsc-premium-storefront .vsc-product-card__media,
    body.vsc-premium-storefront .vsc-product-card__media img {
        transition: none !important;
        transform: none !important;
    }
}

/* Phase 7.5 — single-row desktop product shelves with native horizontal scrolling. */
body.vsc-premium-storefront.victor-homepage .vsc-section-head__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 0;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel {
    position: relative;
    width: 100%;
    min-width: 0;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track {
    --vsc-carousel-gap: clamp(11px, 1.05vw, 16px);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--vsc-carousel-gap) * 4)) / 5);
    grid-template-columns: none;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: var(--vsc-carousel-gap);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 2px 14px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    touch-action: pan-y;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track::-webkit-scrollbar {
    display: none;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track > .vsc-product-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    grid-column: auto;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track .vsc-product-card__media {
    padding: clamp(14px, 1.35vw, 20px);
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
    -webkit-user-select: none;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track.is-dragging a {
    cursor: grabbing;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track a,
body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track button {
    user-select: text;
    -webkit-user-select: text;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls {
    display: none;
    align-items: center;
    gap: 7px;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls:not([hidden]) {
    display: inline-flex;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--site-border, #dce4ee);
    border-radius: 50%;
    background: #fff;
    color: var(--site-primary, #0b3b82);
    box-shadow: 0 3px 10px rgba(15, 35, 60, .07);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls button:hover:not(:disabled) {
    border-color: var(--site-primary, #0b3b82);
    background: var(--site-primary, #0b3b82);
    color: #fff;
    transform: translateY(-1px);
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls button:disabled {
    opacity: .38;
    cursor: not-allowed;
    box-shadow: none;
}

body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls .vsc-icon {
    width: 18px;
    height: 18px;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track {
        grid-auto-columns: calc((100% - (var(--vsc-carousel-gap) * 2)) / 3);
    }
}

@media (max-width: 767.98px) {
    body.vsc-premium-storefront.victor-homepage .vsc-section-head__actions {
        width: 100%;
        justify-content: flex-start;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__controls {
        display: none !important;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track {
        display: grid;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        overflow: visible;
        padding: 0;
        scroll-snap-type: none;
        cursor: auto;
        touch-action: auto;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track > .vsc-product-card {
        width: auto;
        height: auto;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track .vsc-product-card__media {
        padding: 9px;
    }

    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track img {
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.vsc-premium-storefront.victor-homepage .vsc-product-carousel__track {
        scroll-behavior: auto !important;
        scroll-snap-type: none !important;
    }
}

/* Phase 7.5 — restore carousel items previously hidden by the old Latest Products cap. */
body.vsc-premium-storefront.victor-homepage #latest-products .vsc-product-carousel__track > .vsc-product-card:nth-child(n+6) {
    display: flex !important;
}


/* Phase 7.7 — smoothness tuning: keep subtle motion, avoid expensive repaint effects. */
body.vsc-premium-storefront .vsc-product-card,
body.vsc-premium-storefront .vsc-featured-category,
body.vsc-premium-storefront .vsc-brand-card,
body.vsc-premium-storefront .campaign-product-card,
body.vsc-premium-storefront .main_product_inner .product_item,
body.vsc-premium-storefront .product_item.wist_item {
    transition-property: transform, opacity, border-color;
    transition-duration: 150ms;
}
body.vsc-premium-storefront .vsc-product-card :where(a,button),
body.vsc-premium-storefront .related-product-section :where(a,button) {
    transition-property: transform, color, background-color, border-color;
    transition-duration: 140ms;
}
.footer_nav { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (max-width:767.98px) {
    [data-vsc-reveal-state="hidden"] { transform: translate3d(0,4px,0); }
    .footer_nav { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
}

/* Keep legacy navigation motion, but shorten its duration and avoid animating unrelated layout properties. */
body.vsc-premium-storefront :where(
    .categories .side-category,
    .categories ul li a,
    .sub-category,
    .sidebar-menu .sidebar-submenu,
    .sidebar-menu .sidebar-childmenu,
    .main-menu ul li a,
    .search_product li,
    .footer-menu ul li a
) {
    transition-duration: 180ms !important;
    transition-timing-function: ease-out !important;
}
