/* ──────────────────────────────────────────────────────────
   Libelli — Single Product (Max Conversion & Pro UX)
   Version: 2.5.0 (Junij 2026)
   Scoped pod .lib-product, optimizirano za hitrost in a11y
────────────────────────────────────────────────────────── */

.lib-product {
    /* Lokalne barve in sence */
    --lib-text:   #2c241e;
    --lib-muted:  #685a4f;
    --lib-accent: #857345;
    --lib-ebony:  #575b48;
    --lib-dark:   #2c241e;
    --lib-border: rgba(44, 36, 30, 0.12);
    --lib-radius: 4px; /* Malce mehkejši robovi za modern izgled */
    
    /* Apple-like prehodi */
    --lib-ease:   cubic-bezier(0.25, 0.8, 0.25, 1);
    --lib-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.lib-product *, 
.lib-product *::before, 
.lib-product *::after {
    box-sizing: border-box;
}

/* ── LAYOUT (Mobile First) ─ */
.lib-product-row {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ── GALERIJA ── */
.lib-gallery-col {
    width: 100%;
}

.lib-main-image-frame {
    position: relative;
    border: 1px solid var(--lib-border);
    border-radius: var(--lib-radius);
    overflow: hidden;
    background: #fff;
    aspect-ratio: 4 / 5; /* Ohranja razmerje, preprečuje CLS */
}

.lib-main-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s var(--lib-ease);
}

/* Akcija (Sale badge) */
.lib-sale-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--lib-accent);
    color: #fff;
    border-radius: 20px; /* Pill shape */
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(133, 115, 69, 0.25);
    z-index: 2;
}

/* Sličice (Thumbnails) */
.lib-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.lib-thumb {
    cursor: pointer;
    padding: 0;
    border: none;
    background: none;
    outline: none;
    border-radius: var(--lib-radius);
    aspect-ratio: 4 / 5;
    overflow: hidden;
    transition: transform 0.2s var(--lib-spring);
}

.lib-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid var(--lib-border);
    border-radius: var(--lib-radius);
    opacity: 0.5;
    transition: opacity 0.3s var(--lib-ease), border-color 0.3s var(--lib-ease), transform 0.3s var(--lib-spring);
}

.lib-thumb:hover img,
.lib-thumb:focus-visible img,
.lib-thumb.is-active img {
    opacity: 1;
    border-color: var(--lib-text);
}

.lib-thumb:active img {
    transform: scale(0.96);
}

.lib-thumb:focus-visible {
    outline: 2px solid var(--lib-accent);
    outline-offset: 2px;
}

/* ── PODATKI O IZDELKU ── */
.lib-info-col {
    width: 100%;
}

.lib-title {
    font-family: 'Bellanda', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: normal;
    color: var(--lib-text);
    line-height: 1.1;
    margin: 0 0 16px;
    word-break: break-word;
}

/* Cena */
.lib-price {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--lib-ebony) !important;
    margin: 0 0 24px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-weight: 500;
}

.lib-price del {
    opacity: 0.4;
    font-size: 0.6em;
    text-decoration: line-through;
    color: var(--lib-muted) !important;
    font-weight: 400;
}

.lib-price ins {
    text-decoration: none;
    color: var(--lib-ebony) !important;
}

.lib-price .woocommerce-Price-currencySymbol {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 2px;
    font-weight: 400;
}

/* Kratek opis */
.lib-short-desc {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--lib-muted);
    margin-bottom: 32px;
}

.lib-short-desc strong {
    color: var(--lib-text);
    font-weight: 600;
}

/* Zaloga */
.lib-stock {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lib-stock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(133, 115, 69, 0.15);
}

.lib-stock.in-stock     { color: var(--lib-accent); }
.lib-stock.out-of-stock { color: #d94b4b; }

/* ── ADD TO CART FORM ── */
.lib-info-col form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    margin: 32px 0 24px;
}

.lib-info-col .quantity {
    width: 100%;
    height: 52px;
    margin: 0;
}

.lib-info-col .quantity input[type="number"] {
    width: 100%;
    height: 100%;
    border: 1px solid var(--lib-border);
    border-radius: var(--lib-radius);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--lib-text);
    -moz-appearance: textfield;
    transition: border-color 0.3s var(--lib-ease), box-shadow 0.3s var(--lib-ease);
}

/* Skrijemo privzete spinnerje za čistejši izgled */
.lib-info-col .quantity input[type="number"]::-webkit-inner-spin-button,
.lib-info-col .quantity input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    opacity: 0;
}

.lib-info-col .quantity input[type="number"]:focus {
    border-color: var(--lib-ebony);
    box-shadow: 0 0 0 3px rgba(87, 91, 72, 0.1);
}

/* Gumb v Košarico */
.lib-info-col .single_add_to_cart_button {
    flex-grow: 1;
    min-height: 52px;
    background-color: var(--lib-ebony) !important;
    color: #ffffff !important;
    border-radius: var(--lib-radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none !important;
    cursor: pointer;
    transition: background-color 0.3s var(--lib-ease), transform 0.3s var(--lib-spring), box-shadow 0.3s var(--lib-ease) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 24px;
}

.lib-info-col .single_add_to_cart_button:hover {
    background-color: var(--lib-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44, 36, 30, 0.2) !important;
}

.lib-info-col .single_add_to_cart_button:focus-visible {
    outline: 2px solid var(--lib-accent);
    outline-offset: 4px;
}

.lib-info-col .single_add_to_cart_button.loading,
.lib-info-col .single_add_to_cart_button:disabled {
    opacity: 0.6;
    pointer-events: none;
    transform: translateY(0);
}

/* ── ANIMACIJA LESKA (Max Conversion) ─ */
.lib-info-col .single_add_to_cart_button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    animation: libelli-shine 6s infinite ease-in-out;
    pointer-events: none;
}

@keyframes libelli-shine {
    0%   { left: -100%; }
    20%  { left: 150%; }
    100% { left: 150%; }
}

/* Trust Badges */
.lib-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 20px;
    margin-bottom: 32px;
    border-top: 1px solid var(--lib-border);
}

.lib-trust-badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lib-muted);
}

.lib-trust-badge-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--lib-accent);
    stroke-width: 1.5;
    fill: none;
    flex-shrink: 0;
}

/* ── VARIACIJE ── */
.lib-info-col table.variations {
    width: 100%;
    border: none;
    border-collapse: collapse;
}

.lib-info-col table.variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.lib-info-col table.variations th {
    text-align: left;
    padding: 0 0 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--lib-muted);
    border: none;
}

.lib-info-col table.variations td {
    padding: 0;
    width: 100%;
    border: none;
}

.lib-info-col table.variations select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--lib-border);
    border-radius: var(--lib-radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--lib-text);
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23685a4f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color 0.3s var(--lib-ease), box-shadow 0.3s var(--lib-ease);
    cursor: pointer;
}

.lib-info-col table.variations select:focus {
    border-color: var(--lib-ebony);
    box-shadow: 0 0 0 3px rgba(87, 91, 72, 0.1);
}

.lib-info-col .reset_variations {
    display: inline-block;
    margin-top: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--lib-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: color 0.3s var(--lib-ease), border-color 0.3s var(--lib-ease);
}

.lib-info-col .reset_variations:hover {
    color: var(--lib-text);
    border-bottom-color: var(--lib-text);
}

/* ── META & SHARE ── */
.lib-meta {
    padding-top: 20px;
    border-top: 1px solid var(--lib-border);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--lib-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lib-meta-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--lib-muted);
    margin-right: 5px;
}

.lib-meta a {
    color: var(--lib-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s var(--lib-ease);
}

.lib-meta a:hover {
    color: var(--lib-accent);
}

.lib-share {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--lib-border);
}

.lib-share-icons {
    display: flex;
    gap: 12px;
}

.lib-share-icons a {
    color: var(--lib-muted);
    transition: color 0.3s var(--lib-ease), transform 0.3s var(--lib-spring);
    display: inline-flex;
    padding: 4px;
}

.lib-share-icons a:hover {
    color: var(--lib-text);
    transform: translateY(-2px);
}

.lib-share-icons svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

/* ── ZAVIHKI (Tabs) ── */
.lib-tabs {
    margin-top: 60px;
    border-top: 1px solid var(--lib-border);
    padding-top: 40px;
    width: 100%;
}

.lib-tabs ul.tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--lib-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.lib-tabs ul.tabs::-webkit-scrollbar {
    display: none;
}

.lib-tabs ul.tabs li a {
    display: block;
    padding-bottom: 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--lib-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.3s var(--lib-ease), border-color 0.3s var(--lib-ease);
}

.lib-tabs ul.tabs li.active a,
.lib-tabs ul.tabs li a:hover {
    color: var(--lib-text);
    border-bottom-color: var(--lib-text);
}

.lib-tab-panel {
    margin-bottom: 40px;
}

.lib-tab-panel h2 {
    font-family: 'Bellanda', serif;
    font-size: 1.8rem;
    font-weight: normal;
    margin: 0 0 20px;
    color: var(--lib-text);
}

.lib-tab-panel p,
.lib-tab-panel li {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--lib-muted);
}

/* ── UP-SELLS & RELATED ── */
.lib-product section.up-sells,
.lib-product section.related {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--lib-border);
}

.lib-product section.up-sells > h2,
.lib-product section.related > h2 {
    font-family: 'Bellanda', serif;
    font-size: 1.8rem;
    font-weight: normal;
    color: var(--lib-text);
    margin: 0 0 32px;
}

.lib-product section.up-sells ul.products,
.lib-product section.related ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.lib-product section.up-sells ul.products li.product,
.lib-product section.related ul.products li.product {
    margin: 0;
    width: 100%;
    transition: transform 0.3s var(--lib-spring);
}

.lib-product section.up-sells ul.products li.product:hover,
.lib-product section.related ul.products li.product:hover {
    transform: translateY(-4px);
}

.lib-product section.up-sells ul.products li.product a img,
.lib-product section.related ul.products li.product a img {
    margin-bottom: 12px;
    border-radius: var(--lib-radius);
    aspect-ratio: 4/5;
    object-fit: cover;
    width: 100%;
}

/* ── DESKTOP (min-width: 860px) ── */
@media (min-width: 860px) {
    .lib-product-row {
        flex-direction: row;
        align-items: flex-start;
    }

    .lib-gallery-col {
        width: 48%;
        position: sticky;
        top: 40px;
        max-height: calc(100vh - 80px); /* Preprečuje overflow pri kratkih zaslonih */
        overflow-y: auto;
        padding-right: 10px; /* Prostor za scrollbar */
    }
    
    /* Custom scrollbar za sticky galerijo */
    .lib-gallery-col::-webkit-scrollbar {
        width: 4px;
    }
    .lib-gallery-col::-webkit-scrollbar-thumb {
        background: var(--lib-border);
        border-radius: 4px;
    }

    .lib-info-col {
        width: 52%;
        padding-left: 20px;
    }

    .lib-info-col form.cart {
        flex-wrap: nowrap;
    }

    .lib-info-col .quantity {
        width: 100px;
        flex-shrink: 0;
    }

    .lib-info-col .single_add_to_cart_button {
        flex-grow: 1;
        min-width: unset;
    }

    .lib-product section.up-sells ul.products,
    .lib-product section.related ul.products {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* ── ACCESSIBILITY: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .lib-product * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .lib-info-col .single_add_to_cart_button::after {
        display: none; /* Odstrani lesk animacijo */
    }
}