/**
 * VinVic Pro — design system na froncie (shortcode / WooCommerce).
 * Ładowany warunkowo — patrz VinVic_Loader::should_inject_frontend_design_system().
 */
:root {
    --vvfs-bg: #ffffff;
    --vvfs-text: #111827;
    --vvfs-text-dim: #64748b;
    --vvfs-accent: #111827;
    --vvfs-border: #f1f5f9;
    --vvfs-radius: 24px;
    --vvfs-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    --vvfs-font: var(--vv-ui-font, "Inter", system-ui, -apple-system, sans-serif);
}

[class*="vinvic-"] img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow),
[class*="vv-"] img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow),
.vv-clean-shortcode img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow) {
    border-radius: 16px !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
}

[class*="vinvic-"]:hover img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow),
[class*="vv-"]:hover img:not(.leaflet-tile):not(.leaflet-marker-icon):not(.leaflet-marker-shadow) {
    transform: scale(1.03) !important;
}

/* --- GLOBAL SHORTCODE WRAPPER --- */
.vv-clean-shortcode {
    background: var(--vvfs-bg) !important;
    color: var(--vvfs-text) !important;
    border-radius: var(--vvfs-radius) !important;
    font-family: var(--vvfs-font) !important;
    border: 1px solid var(--vvfs-border) !important;
    box-shadow: var(--vvfs-shadow) !important;
    padding: 24px;
    margin: 20px 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Dyrygent (vv-hybrid) w module HUB — bez drugiej „karty” z design systemu */
.vv-arch-wrap .vv-hybrid-master.vv-clean-shortcode,
.vv-variants-compact .vv-hybrid-master.vv-clean-shortcode {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Nagłówki H1–H6 — kontrast względem tła modułu (--vvfs-text po ensure_readable w PHP) */
.vv-clean-shortcode :is(h1, h2, h3, h4, h5, h6),
.vv-arch-wrap :is(h1, h2, h3, h4, h5, h6),
.vv-hub-fragment :is(h1, h2, h3, h4, h5, h6),
.vv-mega-product-landing :is(h1, h2, h3, h4, h5, h6),
.vv-mega-product-landing .vv-product-title,
.vv-mega-product-landing .vv-smart-slider-title,
.vv-mega-full-desc :is(h1, h2, h3, h4, h5, h6),
.vv-hub-desc-content :is(h1, h2, h3, h4, h5, h6),
[class*="vv-"] .vv-section-fragment :is(h1, h2, h3, h4, h5, h6) {
    color: var(--vvfs-text, inherit) !important;
    -webkit-text-fill-color: var(--vvfs-text, inherit) !important;
}

.vv-clean-shortcode :is(h1, h2, h3),
.vv-arch-wrap :is(h1, h2, h3),
.vv-hub-fragment :is(h1, h2, h3),
.vv-mega-full-desc :is(h1, h2, h3) {
    letter-spacing: -0.04em !important;
    font-weight: 900 !important;
}

.vv-clean-shortcode :is(h4, h5, h6),
.vv-arch-wrap :is(h4, h5, h6),
.vv-hub-fragment :is(h4, h5, h6),
.vv-mega-full-desc :is(h4, h5, h6) {
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

/* Metadane SKU / kategorie — nie dziedziczą ciemnego --vv-meta-txt z :root na ciemnej karcie */
.vv-arch-wrap .vv-custom-meta,
.vv-hub-fragment .vv-custom-meta {
    color: var(--vvfs-text, inherit) !important;
    background: transparent !important;
}
.vv-arch-wrap .vv-custom-meta .vv-meta-pair > span:first-of-type,
.vv-hub-fragment .vv-custom-meta .vv-meta-pair > span:first-of-type {
    color: var(--vv-mh-label, color-mix(in srgb, var(--vvfs-text, #94a3b8) 62%, transparent)) !important;
}
.vv-arch-wrap .vv-custom-meta .vv-meta-val,
.vv-arch-wrap .vv-custom-meta .vv-meta-val a,
.vv-hub-fragment .vv-custom-meta .vv-meta-val,
.vv-hub-fragment .vv-custom-meta .vv-meta-val a {
    color: var(--vv-mh-val, var(--vvfs-text, inherit)) !important;
    -webkit-text-fill-color: var(--vv-mh-val, var(--vvfs-text, inherit)) !important;
}
.vv-arch-wrap .vv-product-meta-taxo--after-codes,
.vv-hub-fragment .vv-product-meta-taxo--after-codes {
    border-top-color: color-mix(in srgb, var(--vvfs-text, #64748b) 14%, transparent) !important;
}

/* Cena produktu + cena za kg */
.vv-arch-wrap .vv-price-big .woocommerce-Price-amount,
.vv-arch-wrap .vv-price-big .woocommerce-Price-amount bdi,
.vv-arch-wrap .vv-price-big .woocommerce-Price-currencySymbol,
.vv-hub-fragment .vv-price-big .woocommerce-Price-amount bdi {
    color: var(--vvfs-text, inherit) !important;
    -webkit-text-fill-color: var(--vvfs-text, inherit) !important;
}
.vv-arch-wrap .vv-unit-price,
.vv-hub-fragment .vv-unit-price {
    color: color-mix(in srgb, var(--vvfs-text, #94a3b8) 78%, transparent) !important;
    opacity: 1 !important;
}

/* Slidery powiązane + karty listingu (archiwum / kategoria) */
.vv-smart-slider-wrap .vv-slider-item-price .woocommerce-Price-amount,
.vv-smart-slider-wrap .vv-slider-item-price .woocommerce-Price-amount bdi,
.vv-smart-slider-wrap .vv-slider-item-price .woocommerce-Price-currencySymbol,
.vv-mega-product-landing .vv-slider-item-price .woocommerce-Price-amount bdi {
    color: var(--vvfs-accent, var(--vv-accent, #df0000)) !important;
    -webkit-text-fill-color: var(--vvfs-accent, var(--vv-accent, #df0000)) !important;
}
/* Karty listingu — promocja (del/ins); bez jednego koloru na wszystkie kwoty */
.vv-listing-card .vv-listing-card-price ins .woocommerce-Price-amount,
.vv-listing-card .vv-listing-card-price ins .woocommerce-Price-amount bdi {
    color: var(--vv-listing-price-sale, var(--vv-listing-price, var(--vv-accent, inherit))) !important;
    -webkit-text-fill-color: var(--vv-listing-price-sale, var(--vv-listing-price, var(--vv-accent, inherit))) !important;
}

/* Archiwum / kategoria — tło strony (zmienne z archive-product-vinvic.php lub :root) */
.vv-full-template.vv-full-template-archive {
    background: var(--vv-listing-page-bg, var(--vvfs-bg, #f8fafc));
    color: var(--vv-listing-page-text, var(--vvfs-text, #0f172a));
}
.vv-full-template-archive .vv-template-title {
    color: var(--vv-listing-page-text, var(--vvfs-text, #0f172a));
}
.vv-full-template-archive .vv-template-description,
.vv-full-template-archive .woocommerce-breadcrumb {
    color: var(--vv-listing-page-muted, #64748b);
}
.vv-full-template-archive .woocommerce-breadcrumb a {
    color: var(--vv-listing-page-accent, var(--vv-accent, #334155));
}

/* Karta produktu (mega landing) — tło strony jak listingu */
.vv-full-template.vv-full-template-single {
    background: var(--vv-listing-page-bg, var(--vvfs-bg, #f8fafc));
    color: var(--vv-listing-page-text, var(--vvfs-text, #0f172a));
}
body.single-product,
body.woocommerce.single-product {
    background: var(--vv-listing-page-bg, var(--vvfs-bg, #f8fafc));
}
body.single-product #content-wrap,
body.single-product .site-content {
    background: var(--vv-listing-page-bg, var(--vvfs-bg, #f8fafc));
}
.vv-full-template-single .woocommerce-breadcrumb,
.vv-full-template-single .site-breadcrumbs {
    color: var(--vv-listing-page-muted, #64748b);
}
.vv-full-template-single .woocommerce-breadcrumb a,
.vv-full-template-single .site-breadcrumbs a {
    color: var(--vv-listing-page-accent, var(--vv-accent, #334155));
}

/* Ilość: listingu (.vv-listing-qty) i koszyk boczny (.vvscp-qty-ctrl) — nie HUB --subtle */
.vv-listing-qty.vv-vinvic-qty:not(.vv-hub-atc-qty--subtle),
.vv-listing-card-actions .vv-listing-qty:not(.vv-hub-atc-qty--subtle) {
    background: var(--vv-listing-qty-wrap-bg, rgba(15, 23, 42, 0.04)) !important;
    border-color: var(--vv-listing-qty-wrap-bd, rgba(15, 23, 42, 0.12)) !important;
}
.vv-listing-qty:not(.vv-hub-atc-qty--subtle) .vv-listing-qty-btn {
    background: var(--vv-listing-qty-btn-bg, #111827) !important;
    color: var(--vv-listing-qty-btn-txt, #fff) !important;
}
.vv-listing-qty:not(.vv-hub-atc-qty--subtle) .vv-listing-qty-input {
    color: var(--vv-listing-qty-num-txt, inherit) !important;
    -webkit-text-fill-color: var(--vv-listing-qty-num-txt, inherit) !important;
}

/* Karta: „Wybierz wariant” (produkt zmienny) */
body.woocommerce .vv-listing-link-btn.button,
body.woocommerce a.vv-listing-link-btn.button,
body.woocommerce-page .vv-listing-link-btn.button,
body.woocommerce-page a.vv-listing-link-btn.button {
    background: var(--vv-listing-link-bg, var(--vv-listing-qty-wrap-bg, #fff)) !important;
    color: var(--vv-listing-link-txt, var(--vv-listing-page-accent, var(--vv-listing-page-text, #111827))) !important;
    -webkit-text-fill-color: var(--vv-listing-link-txt, var(--vv-listing-page-accent, var(--vv-listing-page-text, #111827))) !important;
    border: 2px solid var(--vv-listing-link-bd, var(--vv-listing-page-border, rgba(15, 23, 42, 0.2))) !important;
    box-shadow: none !important;
}
.vvscp-cart-box .vvscp-qty-ctrl.vv-vinvic-qty,
#vvscp-cart-dynamic-content .vvscp-qty-ctrl.vv-vinvic-qty {
    background: var(--vvscp-qty-wrap-bg, var(--vv-listing-qty-wrap-bg, #fff)) !important;
    border-color: var(--vvscp-qty-wrap-bd, var(--vv-listing-qty-wrap-bd, #ddd)) !important;
}
.vvscp-cart-box .vvscp-qty-ctrl .vvscp-qty-act,
#vvscp-cart-dynamic-content .vvscp-qty-ctrl .vvscp-qty-act {
    background: var(--vvscp-qty-btn-bg, var(--vv-listing-qty-btn-bg, #111827)) !important;
    color: var(--vvscp-qty-btn-txt, var(--vv-listing-qty-btn-txt, #fff)) !important;
    border: none !important;
}
.vvscp-cart-box .vvscp-qty-ctrl .vvscp-qty-input,
#vvscp-cart-dynamic-content .vvscp-qty-ctrl .vvscp-qty-input {
    background: transparent !important;
    border: none !important;
    color: var(--vvscp-qty-num-txt, var(--vv-listing-qty-num-txt, inherit)) !important;
    -webkit-text-fill-color: var(--vvscp-qty-num-txt, var(--vv-listing-qty-num-txt, inherit)) !important;
}

/* --- GLOBAL RESET & ISOLATION (ANTI-ADMIN TABLE) --- */
[class*="vinvic-"] table,
[class*="vv-"] table,
.vv-clean-shortcode table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 10px 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

[class*="vinvic-"] td,
[class*="vinvic-"] th,
[class*="vv-"] td,
[class*="vv-"] th,
.vv-clean-shortcode td,
.vv-clean-shortcode th {
    padding: 10px !important;
    border: 1px solid var(--vvfs-border, rgba(0, 0, 0, 0.05)) !important;
    background: transparent !important;
    color: var(--vvfs-text) !important;
    font-size: 13px !important;
    text-align: left !important;
    line-height: 1.5 !important;
}

[class*="vinvic-"] tr,
[class*="vv-"] tr,
.vv-clean-shortcode tr {
    background: transparent !important;
    border: none !important;
}

/* --- PREMIUM BUTTON SYSTEM --- */
.vv-btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--vvfs-accent);
    color: #ffffff !important;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 800;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.15);
    border: none !important;
    font-size: 14px;
    cursor: pointer;
}

.vv-btn-premium:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(17, 24, 39, 0.25);
    filter: brightness(1.1);
}

/* [vv_all_reviews] — szerokość jak obraz hero (desktop breakout, mobile bez 100vw) */
.vv-reviews-container.vv-reviews-container--alignwide {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

@media (min-width: 1025px) {
    .vv-reviews-container.vv-reviews-container--alignwide {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding-left: max(20px, env(safe-area-inset-left, 0px));
        padding-right: max(20px, env(safe-area-inset-right, 0px));
    }

    .vv-mega-product-landing .vv-reviews-container.vv-reviews-container--alignwide {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 1024px) {
    .vv-reviews-container.vv-reviews-container--alignwide {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
