/* ============================================================
   cart.css — Saya Group Cart Page
   Baziran na prototipu: korpa.html
   ============================================================ */

/* ─── Breadcrumb (shared with checkout) ─── */
.breadcrumb {
    background: var(--white);
    border-bottom: 1px solid var(--border, #E0E0E0);
    padding: 12px 0;
}
.breadcrumb__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mid-gray, #888);
}
.breadcrumb__inner a { color: var(--mid-gray, #888); transition: color 0.2s; text-decoration: none; }
.breadcrumb__inner a:hover { color: var(--primary); }
.breadcrumb__sep { color: #ccc; }
.breadcrumb__current { color: var(--secondary); font-weight: 500; }

/* ─── Progress Steps (shared with checkout) ─── */
.checkout-progress {
    background: var(--white);
    border-bottom: 1px solid var(--border, #E0E0E0);
    padding: 20px 0;
}
.checkout-progress__inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: var(--border, #E0E0E0);
    z-index: 0;
}
.progress-step.done:not(:last-child)::after { background: var(--primary); }
.progress-step__dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border, #E0E0E0);
    color: var(--mid-gray, #888);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 1;
    position: relative;
}
.progress-step.active .progress-step__dot { background: var(--primary); color: #fff; }
.progress-step.done .progress-step__dot { background: var(--secondary); color: #fff; }
.progress-step__label { font-size: 11px; font-weight: 600; color: var(--mid-gray, #888); text-align: center; white-space: nowrap; }
.progress-step.active .progress-step__label { color: var(--primary); }
.progress-step.done .progress-step__label { color: var(--secondary); }

/* pg-content je 820px na info stranicama — cart treba punu širinu */
.woocommerce-cart .pg-content,
.woocommerce-checkout .pg-content {
    max-width: unset;
}

/* ─── Main Layout ─── */
.cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

/* ─── Empty State ─── */
.cart-empty {
    background: #fff;
    border-radius: 12px;
    padding: 64px 32px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.cart-empty__icon { font-size: 3rem; margin-bottom: 16px; }
.cart-empty__title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}
.cart-empty__text { font-size: 15px; color: var(--mid-gray, #888); margin-bottom: 24px; }

/* ─── Cart Panel ─── */
.cart-panel {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.cart-panel__header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border, #E0E0E0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-panel__title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 18px;
    font-weight: 600;
}
.cart-panel__count { font-size: 13px; color: var(--mid-gray, #888); }

/* ─── Cart Item ─── */
.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 16px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border, #E0E0E0);
    align-items: start;
    transition: background 0.2s;
}
.cart-item:last-of-type { border-bottom: none; }
.cart-item:hover { background: #fafafa; }

.cart-item__img {
    width: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-gray, #F5F5F5);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.cart-item__img-main {
    flex: 1;
    min-height: 72px;
    overflow: hidden;
}
.cart-item__img-main a { display: block; width: 100%; height: 100%; }
.cart-item__img-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item__img-solo {
    height: 54px;
    border-top: 2px solid var(--border, #E0E0E0);
    background: #fff;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item__img-solo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }

.cart-item__info { min-width: 0; }
.cart-item__brand {
    font-size: 11px;
    font-weight: 600;
    color: var(--mid-gray, #888);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}
.cart-item__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 4px;
    line-height: 1.3;
}
.cart-item .cart-item__name a { color: var(--secondary); text-decoration: none; }
.cart-item .cart-item__name a:hover { color: var(--primary); }
.cart-item__sku { font-size: 12px; color: var(--mid-gray, #888); margin-bottom: 10px; }
.cart-item__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cart-item__meta-tag {
    font-size: 12px;
    color: var(--mid-gray, #888);
    background: var(--light-gray, #F5F5F5);
    padding: 3px 8px;
    border-radius: 4px;
}
.cart-item__calc-meta { margin-bottom: 8px; }
.cart-item__price-col .price-on-request {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    font-style: italic;
}
.cart-item__calc-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--primary, #C8184A);
    background: rgba(200, 24, 74, 0.06);
    border: 1px solid rgba(200, 24, 74, 0.18);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.01em;
}
.cart-item__actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.cart-item__wishlist {
    font-size: 12px;
    color: var(--mid-gray, #888);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    font-family: var(--font-main);
    padding: 0;
}
.cart-item__wishlist:hover { color: var(--primary); }

.cart-item__sep {
    color: var(--border, #E0E0E0);
    font-size: 12px;
    user-select: none;
}

.cart-item__remove {
    font-size: 12px;
    color: #e53e3e;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-main);
    transition: opacity 0.2s;
    padding: 0;
}
.cart-item__remove:hover { opacity: 0.7; }

/* Mobilno: cenovna zona dobija svoj red, odvojena tankom linijom od opisa.
   flex-wrap + flex-bas:100% na m² bloku gura preračun u zasebnu liniju iznad,
   a total (levo) i qty (desno) padaju u čist red ispod. Desktop se resetuje
   na blok raspored u @media (min-width:600px). */
.cart-item__price-col {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 10px;
    text-align: left;
    min-width: unset;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #E0E0E0);
}
.cart-item__unit-price { font-size: 12px; color: var(--mid-gray, #888); margin-bottom: 4px; }
.cart-item__total-price { font-size: 18px; font-weight: 700; color: var(--secondary); }

/* Pločice (m²): cena po m² + konverzija u kutiju, u jednom bloku da ne razbije
   responsive raspored .cart-item__price-col (mobilno flex-red / desktop blok). */
.cart-item__price-m2 { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; flex-basis: 100%; }
.cart-item__price-m2 .cart-item__unit-price { margin-bottom: 0; }
.cart-item__box-note { font-size: 11px; color: var(--mid-gray, #888); line-height: 1.35; }

/* ─── Qty Control ─── */
.qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border, #E0E0E0);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin-left: 0;
    margin-top: 0;
}
.qty-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.qty-btn:hover { background: var(--light-gray, #F5F5F5); }
.qty-input {
    width: 48px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--border, #E0E0E0);
    border-right: 1px solid var(--border, #E0E0E0);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--secondary);
    background: #fff;
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }

/* ─── Coupon Row ─── */
.coupon-row {
    padding: 16px;
    background: var(--light-gray, #F5F5F5);
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--border, #E0E0E0);
}
.coupon-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border, #E0E0E0);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-main);
    background: #fff;
    color: var(--secondary);
}
.coupon-input:focus { outline: none; border-color: var(--primary); }
.coupon-input::placeholder { color: #bbb; }

/* ─── Cart Footer ─── */
.cart-footer {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--border, #E0E0E0);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-main);
    white-space: nowrap;
    text-decoration: none;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark, #a01f56); transform: translateY(-1px); }
.btn--outline-dark { background: transparent; color: var(--secondary); border: 1.5px solid var(--secondary); }
.btn--outline-dark:hover { background: var(--secondary); color: #fff; }
.btn--ghost { background: transparent; color: var(--mid-gray, #888); border: 1.5px solid var(--border, #E0E0E0); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ─── Order Summary ─── */
.order-summary {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: static;
    order: -1;
}
.order-summary__title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, #E0E0E0);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}
.summary-row__label { color: var(--mid-gray, #888); }
.summary-row__value { font-weight: 600; }
.summary-divider { height: 1px; background: var(--border, #E0E0E0); margin: 16px 0; }
.summary-row--total { font-size: 16px; }
.summary-row--total .summary-row__value { color: var(--primary); font-size: 22px; font-weight: 700; }
.summary-row--savings .summary-row__value { color: #38a169; }

/* ─── Delivery (u summary) ─── */
.delivery-section { margin: 20px 0; }
.delivery-section__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}
.delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--border, #E0E0E0);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.delivery-option:last-child { margin-bottom: 0; }
.delivery-option:hover { border-color: var(--primary); background: #fdf5f9; }
.delivery-option.selected { border-color: var(--primary); background: #fdf5f9; }
.delivery-option input[type="radio"] { margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.delivery-option__label { flex: 1; }
.delivery-option__name { font-size: 14px; font-weight: 600; color: var(--secondary); }
.delivery-option__desc { font-size: 12px; color: var(--mid-gray, #888); margin-top: 2px; }
.delivery-option__price { font-size: 14px; font-weight: 700; color: var(--secondary); flex-shrink: 0; }
.delivery-option__price.free { color: #38a169; }

/* ─── Checkout Button ─── */
.checkout-btn {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 16px;
}
.checkout-btn svg { width: 18px; height: 18px; }
.checkout-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--mid-gray, #888);
    text-align: center;
    margin-top: 12px;
}

/* ─── Trust Badges ─── */
.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-medium, #eee);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 14px;
}

.trust-badge__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--background, #F9F7F5);
    border: 1px solid var(--gray-medium, #eee);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.trust-badge__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trust-badge__text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.trust-badge__text span {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ─── WooCommerce notices ─── */
.woocommerce-NoticeGroup { margin-bottom: 20px; }
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 14px;
    list-style: none;
    margin: 0 0 16px;
}
.woocommerce-error { background: #fff5f5; border-left: 4px solid #e53e3e; color: #c53030; }
.woocommerce-message { background: #f0fff4; border-left: 4px solid #38a169; color: #276749; }
.woocommerce-info { background: #ebf8ff; border-left: 4px solid #3182ce; color: #2b6cb0; }

/* ─── Remove Undo Toast ─── */
.cart-undo-toast {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--secondary, #1A1A1A);
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.35s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: normal;
    width: calc(100% - 32px);
    flex-wrap: wrap;
    pointer-events: none;
}
.cart-undo-toast.show {
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}
.cart-undo-btn {
    background: var(--primary, #C52669);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    font-family: var(--font-main);
}
.cart-undo-btn:hover { background: var(--primary-dark, #a01f56); }

/* ─── Responsive (mobile-first) ─── */

@media (min-width: 600px) {
    .cart-page {
        padding: 32px 24px 80px;
    }
    .cart-panel__header,
    .cart-item,
    .coupon-row,
    .cart-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
    .cart-item {
        grid-template-columns: 110px 1fr auto;
    }
    .cart-item__img {
        width: 110px;
    }
    .cart-item__img-main {
        min-height: 90px;
    }
    .cart-item__img-solo {
        height: 62px;
    }
    .cart-item__price-col {
        grid-column: auto;
        display: block;
        text-align: right;
        min-width: 110px;
        /* reset mobilne cenovne zone — desktop ostaje nepromenjen */
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    .cart-item__total-price { font-size: 17px; }
    .qty-btn { width: 32px; height: 32px; font-size: 16px; }
    .qty-input { width: 44px; height: 32px; }
    .qty-control {
        margin-left: auto;
        margin-top: 10px;
    }
    .cart-undo-toast {
        white-space: nowrap;
        width: auto;
        flex-wrap: nowrap;
        bottom: 24px;
    }
}

@media (min-width: 900px) {
    .cart-page {
        grid-template-columns: 1fr 360px;
    }
    .order-summary {
        position: sticky;
        top: 24px;
        order: 0;
    }
}
