/* WCCV Frontend - v1.2.4
   Identičan izgled WooVariation Swatches + teme sajta (#5EB4FF akcent)
*/

/* ===== Wrapper i polja ===== */
.wccv-fields-wrapper { margin: 0 0 20px; }
.wccv-field { margin-bottom: 16px; }

/* Label - kao WVS .label th */
.wccv-field .label {
    margin-bottom: 8px;
}
.wccv-field .label label {
    font-weight: 700;
    font-size: 14px;
    color: #222;
    display: inline;
    cursor: default;
}

/* ===== Info ikona (identično .ram-info-icon sa sajta) ===== */
.ram-info-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 13px;
    background: #666;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    position: relative;
    font-weight: bold;
    vertical-align: middle;
}
.ram-info-icon .ram-info-popup {
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background: #fff;
    color: #333;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 999;
    top: 25px;
    left: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
    transition: opacity .3s ease;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}
/* Novi redovi unutar popupa */
.ram-info-icon .ram-info-popup p {
    margin: 0 0 8px;
    padding: 0;
}
.ram-info-icon .ram-info-popup p:last-child {
    margin-bottom: 0;
}
.ram-info-icon .ram-info-popup br {
    display: block;
    content: '';
    margin-bottom: 4px;
}
.ram-info-icon:hover .ram-info-popup,
.ram-info-icon:focus .ram-info-popup { visibility: visible; opacity: 1; }
@media (max-width: 768px) {
    .ram-info-icon .ram-info-popup {
        position: fixed !important;
        top: 50% !important; left: 50% !important;
        transform: translate(-50%,-50%) !important;
        width: 90% !important; max-width: 320px;
        z-index: 10000 !important;
    }
}

/* ===== UL lista (identično .variable-items-wrapper) ===== */
.wccv-items-wrapper {
    list-style: none;
    margin: 0; padding: 0;
}

/* ===== RADIO items - identično WVS radio-variable-items-wrapper ===== */
.wccv-radio-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.wccv-radio-item {
    display: block;
    cursor: pointer;
    padding: 0;
    margin: 0;
}
/* Radio input wrapper - identično .variable-item-radio-input-wrapper */
.wccv-radio-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    user-select: none;
    width: 100%;
}
.wccv-radio-input-wrapper input[type="radio"] {
    margin: 0;
    width: 16px; height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #5EB4FF;
}
/* Tekst bez underline */
.wccv-radio-value-wrapper {
    text-decoration: none;
    font-weight: 700;
}
.wccv-radio-item.is-active .wccv-radio-value-wrapper,
.wccv-radio-item:hover .wccv-radio-value-wrapper {
    color: #000;
}

/* ===== BUTTON items - identično WVS button-variable-items-wrapper ===== */
.wccv-button-items {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.wccv-button-item {
    display: block;
    width: 100%;
    cursor: pointer;
    margin: 0;
    list-style: none;
}
/* Razmak pre 3. stavke (Standard grupa) - identično .variable-items-wrapper li:nth-of-type(3) */
.wccv-button-item.wccv-group-break {
    margin-top: 16px !important;
}
.wccv-item-span-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    line-height: 1.25;
    font-size: 14px;
    font-weight: 400;
    color: #222;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.wccv-button-item:hover .wccv-item-span-button {
    border-color: #888;
}
.wccv-button-item.is-active .wccv-item-span-button {
    border-color: #5EB4FF;
    box-shadow: inset 0 0 0 1px #5EB4FF;
    font-weight: 600;
    color: #000;
}

/* ===== SWATCH items ===== */
.wccv-swatch-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wccv-swatch-item {
    width: 36px; height: 36px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 0 1px #ccc inset;
    transition: transform .12s, box-shadow .12s;
    list-style: none;
}
.wccv-swatch-item.wccv-swatch-text {
    width: auto; height: auto;
    padding: 8px 14px;
    background: #fff;
    border: 2px solid #ccc;
    box-shadow: none;
    font-size: 13px; color: #222;
}
.wccv-swatch-item.wccv-swatch-text.is-active {
    border-color: #5EB4FF;
    box-shadow: inset 0 0 0 1px #5EB4FF;
}
.wccv-swatch-item.is-active:not(.wccv-swatch-text) {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #5EB4FF;
}
.wccv-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: #222; color: #fff;
    padding: 4px 10px; border-radius: 4px;
    font-size: 11px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .15s; z-index: 100;
}
.wccv-swatch-item:hover .wccv-swatch-tooltip { opacity: 1; }

/* ===== Dropdown ===== */
.wccv-field-dropdown select {
    width: 100%; max-width: 360px;
    padding: 9px 12px;
    border: 1px solid #ccc; border-radius: 4px;
    font-size: 14px; background: #fff;
}

/* ===== Prikaz cene - #5EB4FF kao na sajtu ===== */
.wccv-price-display {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.wccv-price-display .wccv-price-label {
    font-weight: 600; color: #555; font-size: 14px;
}
.wccv-price-display .wccv-price-value {
    font-weight: 700;
    font-size: 1.5em;
    color: #5EB4FF;   /* identično .woocommerce div.product span.price */
    line-height: 1;
}
.wccv-price-display .woocommerce-Price-amount {
    color: inherit; font-size: inherit; font-weight: inherit;
}
.wccv-price-display.is-incomplete .wccv-price-value {
    font-size: 15px; color: #bbb; font-weight: 400;
}

/* ===== Out of stock ===== */
.wccv-fields-wrapper p.out-of-stock {
    color: #b32d2e; font-weight: 600; font-size: 14px;
}

.wccv-fields-wrapper {
    font-family: 'Montserrat', sans-serif;
}

/* Razmak između polja (npr. između Veličina i Platno/Ram) */
.wccv-field + .wccv-field {
    margin-top: 24px;
}

/* Razmak između labela i opcija unutar polja */
.wccv-field .label {
    margin-bottom: 10px;
}

/* Veći razmak ispod labele samo za drugi field (Platno/Ram) */
.wccv-field + .wccv-field .label {
    margin-bottom: 20px;
}

.wccv-swatch-item.wccv-swatch-text .wccv-item-span {
    font-weight: 600;
}

/* Razmak između opcija u swatch listi - svaka li dobija mali margin */
.wccv-swatch-items .wccv-swatch-item + .wccv-swatch-item {
    margin-top: 4px;
}

/* Veći razmak pre 3. opcije (između Standard i Premium grupe) */
.wccv-swatch-items .wccv-swatch-item:nth-child(3) {
    margin-top: 12px;
}
.wccv-radio-item.wccv-disabled,
.wccv-button-item.wccv-disabled,
.wccv-swatch-item.wccv-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.wccv-radio-item.wccv-disabled .wccv-radio-input-wrapper,
.wccv-radio-item.wccv-disabled input[type="radio"] {
    cursor: not-allowed;
}
/* Precrtana linija preko disabled dugmadi */
.wccv-button-item.wccv-disabled .wccv-item-span-button {
    position: relative;
    color: #999;
}
.wccv-button-item.wccv-disabled .wccv-item-span-button::after {
    content: '';
    position: absolute;
    left: 8px; right: 8px;
    top: 50%;
    height: 1px;
    background: #bbb;
}

/* ===== Add to cart - disabled stanje ===== */
form.cart button.single_add_to_cart_button.wccv-btn-disabled,
form.cart button.single_add_to_cart_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #ccc !important;
    color: #666 !important;
}

/* ===== Poruka o nedostupnoj ceni ===== */
.wccv-no-price {
    font-size: 14px;
    color: #b32d2e;
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .wccv-price-display .wccv-price-value { font-size: 1.3em; }
}

/* ===== WC native UI cleanup ===== */
body.wccv-active .variations_form table.variations,
body.wccv-active .variations_form .reset_variations,
body.wccv-active .single_variation_wrap,
body.wccv-active .grouped_form,
body.wccv-active table.group_table {
    display: none !important;
}
