/* ============================================
   SWA TYNDO Konfigurator — Styles
   ============================================ */

.swa-tyndo-konfigurator {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0b1c3c;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 40px;
}

@media (max-width: 768px) {
    .swa-tyndo-konfigurator {
        flex-direction: column;
    }
}

/* ── Preview ────────────────────────────────── */

.swa-tyndo-preview {
    flex: 1 1 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Zlatni okvir oko previewa */
.swa-tyndo-preview-frame {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    border: 1px solid #ede9e4;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Badge s uštedama — lijevi gornji kut okvira */
.swa-tyndo-usteda-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #917d65;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    /*border-radius: 14px 0 14px 0;*/
    line-height: 1.3;
    z-index: 5;
    white-space: nowrap;
}

.swa-tyndo-usteda-badge .woocommerce-Price-amount {
    color: #fff;
    font-weight: 700;
}

.swa-tyndo-preview-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-height: 600px;
    width: 100%;
    max-width: clamp(200px, 20vh, 400px);
}

.swa-tyndo-shade-img-wrap,
.swa-tyndo-base-img-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.swa-tyndo-shade-img-wrap {
    position: absolute;
    left: 0;
    z-index: 2;
    bottom: var(--swa-tyndo-shade-bottom, 200px);
    align-items: flex-end;
    transform: scale(calc(var(--swa-tyndo-shade-zoom, 100) / 100));
    transform-origin: bottom center;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.swa-tyndo-base-img-wrap {
    position: relative;
    z-index: 1;
    align-items: flex-end;
    transform: scale(calc(var(--swa-tyndo-base-zoom, 100) / 100));
    transform-origin: bottom center;
    transition: transform 0.3s ease;
}

img[alt~="Round"] {
    max-width: 120% !important;
}

.swa-tyndo-shade-img-wrap img,
.swa-tyndo-base-img-wrap img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(0);
    opacity: 1;
}

.swa-tyndo-shade-img-wrap img.swa-tyndo-slide-out,
.swa-tyndo-base-img-wrap img.swa-tyndo-slide-out {
    opacity: 0;
    transform: translateY(-20px);
}

.swa-tyndo-shade-img-wrap img.swa-tyndo-slide-prepare,
.swa-tyndo-base-img-wrap img.swa-tyndo-slide-prepare {
    transition: none !important;
    opacity: 0;
    transform: translateY(20px);
}

/* Tekst disclaimer ispod slike */
.swa-tyndo-disclaimer {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* ── Kontrole ───────────────────────────────── */

.swa-tyndo-controls {
    flex: 1 1 350px;
    display: flex;
    flex-direction: column;
}

.swa-tyndo-header {
    margin-bottom: 30px;
}

.swa-tyndo-naziv {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 10px 0;
    transition: opacity 0.2s ease;
    color: #0b1c3c;
}

.swa-tyndo-cijena-wrap {
    margin-bottom: 20px;
}

/* Wrapper za prikaz cijene — sve u jednom redu */
.swa-tyndo-cijena {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 4px;
}

/* Sale / krajnja cijena — smećkasto-zlatna boja */
.swa-tyndo-price-sale {
    font-size: 26px;
    font-weight: 500;
    color: #917d65;
    letter-spacing: -0.3px;
}

/* Regularna cijena s precrtkavanjem — crna/tamna */
.swa-tyndo-price-regular {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    text-decoration: line-through;
    text-decoration-color: #000000;
}

/* Badge pilule za popuste: -12%, -10% — pravokutni s tankim smećkasto-zlatnim rubom */
.swa-tyndo-price-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid #d1c5b4;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    color: #917d65;
    letter-spacing: 0.2px;
    background: #fff;
    white-space: nowrap;
}

/* ── Selektori ─────────────────────────────── */

.swa-tyndo-selector {
    margin-bottom: 30px;
}

.swa-tyndo-selector-label {
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: #0b1c3c;
    margin: 0 0 12px 0;
}

.swa-tyndo-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.swa-tyndo-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 80px;
}

.swa-tyndo-option:hover {
    border-color: #0b1c3c;
}

.swa-tyndo-option.active {
    border-color: #0b1c3c;
    box-shadow: 0 0 0 1px #0b1c3c;
}

.swa-tyndo-option img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
}

.swa-tyndo-option span {
    font-size: 11px;
    font-weight: 500;
    color: #555;
    text-align: center;
    line-height: 1.3;
}

.swa-tyndo-option.active span {
    color: #0b1c3c;
    font-weight: 700;
}

/* Popust badge na postolje gumbima — okrugli smeđi krug s centriranim tekstom */
.swa-tyndo-discount-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: #917d65;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    white-space: nowrap;
    z-index: 3;
    box-sizing: border-box;
}

/* ── Akcija ────────────────────────────────── */

.swa-tyndo-action {
    margin-top: 10px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* Red s količinom, gumbom i ikonama */
.swa-tyndo-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Odabir količine */
.swa-tyndo-qty-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    /*border-radius: 50px;*/
    overflow: hidden;
    flex-shrink: 0;
    max-width: 150px;
}

.swa-tyndo-qty-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 48px;
    font-size: 18px;
    font-weight: 500;
    color: #0b1c3c;
    cursor: pointer;
    transition: background 0.15s ease;
    line-height: 1;
    padding: 0;
}

.swa-tyndo-qty-btn:hover {
    background: #f4f4f4;
}

.swa-tyndo-qty-input {
    width: 42px !important;
    height: 48px;
    border: none !important;
    border-left: 1px solid #e8e8e8 !important;
    border-right: 1px solid #e8e8e8 !important;
    border-radius: 0 !important;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #0b1c3c;
    -moz-appearance: textfield;
    appearance: textfield;
    background: transparent;
}

.swa-tyndo-qty-input::-webkit-inner-spin-button,
.swa-tyndo-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Gumb dodaj u košaricu */
.swa-tyndo-add-to-cart {
    flex: 1 1 auto;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    /* Sentence case — samo prvo slovo veliko, ostatak malim: */
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.swa-tyndo-add-to-cart:hover {
    background: #333;
}

.swa-tyndo-add-to-cart:active {
    transform: scale(0.97);
}

.swa-tyndo-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.swa-tyndo-add-to-cart.swa-tyndo-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Gumbi sa strane (favorit + usporedba) */
.swa-tyndo-side-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Favorit gumb — isti vizualni tretman kao u swa-favoriti pluginu */
.swa-tyndo-side-actions .wc-favorites-button,
.swa-tyndo-side-actions .swa-tyndo-fav-btn {
    fill: none;
    stroke: #676767;
    stroke-width: 20px;
    cursor: pointer;
    display: block;
    width: 26px;
    height: 26px;
    transition: stroke 0.2s, fill 0.2s;
}

.swa-tyndo-side-actions .wc-favorites-button:hover,
.swa-tyndo-side-actions .swa-tyndo-fav-btn:hover {
    stroke: #e91e8c;
}

.swa-tyndo-side-actions .wc-favorites-button.favorite-active,
.swa-tyndo-side-actions .swa-tyndo-fav-btn.favorite-active {
    fill: red;
    stroke: none;
}

/* Usporedba gumb — isti vizualni tretman kao u swa-usporedba pluginu */
.swa-tyndo-side-actions .wc-compare-button,
.swa-tyndo-side-actions .swa-tyndo-compare-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #676767;
    transition: color 0.2s;
}

.swa-tyndo-side-actions .wc-compare-button svg path,
.swa-tyndo-side-actions .swa-tyndo-compare-btn svg path {
    stroke: #676767;
    transition: stroke 0.2s;
}

.swa-tyndo-side-actions .wc-compare-button:hover svg path,
.swa-tyndo-side-actions .swa-tyndo-compare-btn:hover svg path {
    stroke: #0594D5;
}

.swa-tyndo-side-actions .wc-compare-button.compare-active svg path,
.swa-tyndo-side-actions .swa-tyndo-compare-btn.compare-active svg path {
    stroke: #0594D5;
}

/* Šifra artikla */
.swa-tyndo-sku-wrap {
    margin-top: 14px;
    font-size: 14px;
    color: #555;
    display: flex;
    gap: 4px;
    align-items: baseline;
}

.swa-tyndo-sku-label {
    font-weight: 500;
}

.swa-tyndo-sku-value {
    font-weight: 400;
}

/* Feedback poruka */
.swa-tyndo-feedback {
    margin-top: 16px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.swa-tyndo-feedback.success {
    background: #eaf7ec;
    color: #1a7a2e;
}

.swa-tyndo-feedback.error {
    background: #fdecea;
    color: #c0392b;
}

/* ── Responsive ────────────────────────────── */

@media (max-width: 600px) {
    .swa-tyndo-konfigurator {
        padding: 20px 12px;
    }

    .swa-tyndo-option img {
        width: 48px;
        height: 48px;
    }

    .swa-tyndo-option {
        min-width: 64px;
        padding: 6px;
    }

    .swa-tyndo-naziv {
        font-size: 20px;
    }

    .swa-tyndo-action-row {
        flex-wrap: wrap;
    }

    .swa-tyndo-add-to-cart {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ── Stilizacija za inline selektor (Napajanje) ── */
.swa-tyndo-selector-inline {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 30px;
}

.swa-tyndo-selector-inline .swa-tyndo-selector-label {
    margin-bottom: 0;
    min-width: 90px;
    flex-shrink: 0;
}

.swa-tyndo-selector-inline .swa-tyndo-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.swa-tyndo-selector-inline .swa-tyndo-option {
    min-width: unset;
    width: 70px;
    height: 70px;
    padding: 6px;
    border-radius: 8px;
    justify-content: center;
    border-color: #e0e0e0;
	margin-top: 10px;
}

.swa-tyndo-selector-inline .swa-tyndo-option img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 0;
}

.swa-tyndo-selector-inline .swa-tyndo-option span {
    display: none; /* Sakrij tekst kako bismo imali samo ikone u gumbima */
}

/* Onemogućeno stanje za gumbe opcija */
.swa-tyndo-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    border-color: #f0f0f0;
    background-color: #fafafa;
}

/* Pristupačnost - screen reader tekst */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

@media (max-width: 600px) {
    .swa-tyndo-selector-inline {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .swa-tyndo-selector-inline .swa-tyndo-selector-label {
        min-width: 75px;
        font-size: 14px;
    }
    
    .swa-tyndo-selector-inline .swa-tyndo-option {
        width: 42px;
        height: 42px;
    }
    
    .swa-tyndo-selector-inline .swa-tyndo-option img {
        width: 26px;
        height: 26px;
    }
}