/* ==========================================================================
   ATELJE MANUFAKTURA — prodavnica
   Kartice, stranica proizvoda, kružići boja, korpa, porudžbina, zahvalnica.
   Koristi tokene iz style.css.
   ========================================================================== */

:root {
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-snappy: cubic-bezier(0.23, 1, 0.32, 1);
    --ok: #2F6B3B;
    --warn: #A8741A;
    --surface: #FFFFFF;
    --z-sticky-bar: 90;
    --z-header: 100;
    --z-drawer: 300;
    --z-toast: 400;
    --header-h: 104px;
}
@media (max-width: 900px) { :root { --header-h: 80px; } }

/* --------------------------------------------------------------------------
   Pristupačnost
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: calc(var(--z-header) + 10);
    padding: 0.75rem 1.1rem;
    background: var(--noir);
    color: var(--cream);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
}
.skip-link:focus { top: 1rem; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--wine);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Zaglavlje: logo na telefonu, kursor nad poljima forme
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .site-header .container { padding-block: 0.75rem; }
    .logo img { height: 52px; }
}
@media (max-width: 400px) { .logo img { height: 42px; } }
@media (min-width: 901px) and (pointer: fine) {
    body.cursor-ready input:not([type="checkbox"]):not([type="radio"]),
    body.cursor-ready textarea { cursor: text !important; }
}
.cursor-ring.is-text, .cursor-dot.is-text { opacity: 0 !important; }
html.is-drawer-open .cursor-ring { border-color: var(--cream); }

/* --------------------------------------------------------------------------
   Zaglavlje: korpa
   -------------------------------------------------------------------------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.cart-button {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink);
    transition: background-color 200ms ease, transform 160ms var(--ease-snappy);
}
.cart-button:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
    .cart-button:hover { background: rgba(140, 25, 26, 0.06); color: var(--wine); }
}
.cart-button__icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.cart-button__count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--wine);
    color: var(--cream);
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.cart-button__count[hidden] { display: none; }
.cart-button__count.is-bump { animation: badgeBump 320ms var(--ease-snappy); }
@keyframes badgeBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.28); }
    100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Dugmad i kontrole
   -------------------------------------------------------------------------- */
.btn-block { width: 100%; justify-content: center; }
.btn-block::after,
.pdp-buy__add::after,
.btn-no-arrow::after { display: none; }
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink);
    transition: background-color 180ms ease, transform 160ms var(--ease-snappy);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.icon-btn:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: rgba(12, 11, 10, 0.06); } }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
    transition: color 180ms ease, text-decoration-color 180ms ease;
}
.link-btn:hover { color: var(--wine); text-decoration-color: currentColor; }
.link-btn--muted { color: var(--ink-soft); font-size: 0.8rem; }

/* Stepper količine */
.qty {
    display: inline-flex;
    align-items: center;
    height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    flex-shrink: 0;
}
.qty__btn {
    width: 44px;
    height: 100%;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--ink);
    border-radius: 999px;
    transition: color 160ms ease, transform 140ms var(--ease-snappy);
}
.qty__btn:active { transform: scale(0.88); }
.qty__btn:disabled { color: var(--smoke); cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .qty__btn:hover:not(:disabled) { color: var(--wine); } }
.qty__input,
.qty__value {
    width: 36px;
    text-align: center;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.98rem;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm { height: 36px; }
.qty--sm .qty__btn { width: 32px; font-size: 1rem; }
.qty--sm .qty__value { width: 26px; font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   Kartica proizvoda
   -------------------------------------------------------------------------- */
.product-grid { gap: var(--space-7) var(--space-5); }
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    transform: none !important;
}
.product-card.is-entering { animation: cardIn 520ms var(--ease-out) both; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.product-card__link { display: block; color: inherit; }
.product-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    margin-bottom: var(--space-4);
    background: var(--cream-warm);
    border-radius: var(--radius);
    overflow: hidden;
}
.product-card__media::after,
.product-card__cta,
.product-card__category { display: none; }
.product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 420ms ease, transform 900ms var(--ease-out);
}
.product-card__img--alt { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
    .product-card:hover .product-card__img { transform: scale(1.03); }
    .product-card:not(.is-previewing):hover .product-card__img--alt { opacity: 1; }
}
.product-card.is-soldout .product-card__img { opacity: 0.55; }
.product-card__badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: rgba(247, 243, 239, 0.94);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.product-card__body { display: flex; flex-direction: column; gap: 0.35rem; }
.product-card__name {
    font-family: var(--font-serif);
    font-size: 1.22rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--ink);
    text-wrap: balance;
}
.product-card__meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    max-width: none;
}
.product-card__price {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.product-card__was { font-size: 0.85rem; color: var(--smoke); }
.product-card__colors { font-size: 0.82rem; color: var(--ink-soft); }

@media (max-width: 560px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 0.85rem; }
    .product-card__name { font-size: 1.05rem; }
    .product-card__media { margin-bottom: 0.7rem; }
    .product-card__colors { display: none; }
    .card-swatch { width: 26px; height: 26px; }
    .card-swatch span { width: 17px; height: 17px; }
}

.card-swatches {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0.55rem;
    margin-left: -4px;
}
.card-swatch {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.card-swatch span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(12, 11, 10, 0.12);
    transition: box-shadow 160ms ease, transform 160ms var(--ease-snappy);
}
@media (hover: hover) and (pointer: fine) {
    .card-swatch:hover span { box-shadow: 0 0 0 1.5px var(--cream), 0 0 0 2.5px var(--ink); }
}
.card-swatch.is-out span { opacity: 0.4; }
.card-swatches__more {
    margin-left: 0.25rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Stranica proizvoda
   -------------------------------------------------------------------------- */
.pdp { padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(3rem, 7vw, 6rem); }
.pdp__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

/* Galerija */
.pdp-gallery { min-width: 0; }
.pdp-gallery__stage { position: relative; }
.pdp-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: var(--radius-lg);
    background: var(--cream-warm);
    transition: opacity 120ms ease;
    overscroll-behavior-x: contain;
}
.pdp-gallery__track::-webkit-scrollbar { display: none; }
.pdp-gallery__track.is-swapping { opacity: 0.25; }
.pdp-gallery__slide {
    flex: 0 0 100%;
    aspect-ratio: 4 / 5;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.pdp-gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.pdp-gallery__count {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(247, 243, 239, 0.92);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    pointer-events: none;
}
.pdp-gallery__count[hidden], .pdp-gallery__thumbs[hidden] { display: none; }
.pdp-gallery__thumbs {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px;
}
.pdp-thumb {
    flex: 0 0 76px;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    opacity: 0.55;
    box-shadow: 0 0 0 1px transparent;
    transition: opacity 180ms ease, box-shadow 180ms ease;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumb.is-active { opacity: 1; box-shadow: 0 0 0 1.5px var(--ink); }
@media (hover: hover) and (pointer: fine) { .pdp-thumb:hover { opacity: 0.9; } }

/* Informacije */
.pdp-info {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    min-width: 0;
}
.pdp-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: var(--space-4);
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.pdp-crumbs a { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color 160ms ease, text-decoration-color 160ms ease; }
.pdp-crumbs a:hover { color: var(--wine); text-decoration-color: currentColor; }
.pdp-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2rem, 1.35rem + 2vw, 2.9rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-wrap: balance;
    margin-bottom: var(--space-3);
}
.pdp-price {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: var(--space-2);
}
.pdp-price__now {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.pdp-price__was { color: var(--smoke); font-size: 1rem; }
.pdp-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: var(--space-5);
}
.pdp-stock__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pdp-stock--preorder .pdp-stock__dot { background: var(--warn); }
.pdp-stock--out_of_stock .pdp-stock__dot { background: var(--rose); }

.pdp-label {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: var(--space-3);
}
.pdp-label strong { color: var(--ink); font-weight: 600; }
.pdp-swatches { border: 0; padding: 0; margin: 0 0 var(--space-5); min-width: 0; }

/* Kružići boja */
.swatch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 4px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 180ms ease, transform 140ms var(--ease-snappy);
}
.swatch:active { transform: scale(0.94); }
.swatch__fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--cream-deep);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(12, 11, 10, 0.1);
}
.swatch.is-selected { box-shadow: inset 0 0 0 1.5px var(--ink); }
@media (hover: hover) and (pointer: fine) {
    .swatch:not(.is-selected):hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
    .swatch::before {
        content: attr(data-name);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 6px);
        padding: 0.3rem 0.6rem;
        border-radius: 4px;
        background: var(--noir);
        color: var(--cream);
        font-size: 0.74rem;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transform: translate(-50%, 4px);
        transform-origin: bottom center;
        transition: opacity 150ms ease, transform 150ms var(--ease-snappy);
        z-index: 2;
    }
    .swatch:hover::before { opacity: 1; transform: translate(-50%, 0); }
}
.swatch.is-out .swatch__fill { opacity: 0.4; }
.swatch.is-out::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    height: 1.5px;
    background: var(--ink);
    transform: rotate(-45deg);
    opacity: 0.6;
}

/* Kupovina */
.pdp-buy {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.pdp-buy__add {
    flex: 1;
    height: 54px;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.85rem;
}
.pdp-buy__add.is-added { background: var(--noir); border-color: var(--noir); }
.pdp-buy__add.is-added span::before {
    content: '';
    display: inline-block;
    width: 0.9em;
    height: 0.5em;
    margin-right: 0.55em;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-0.2em) rotate(-45deg);
}

.pdp-buy[hidden], .pdp-contact[hidden], .pdp-inquiry[hidden], .pdp-sticky [hidden] { display: none !important; }

/* Po porudžbini / rasprodato: upit umjesto korpe */
.pdp-inquiry {
    margin-bottom: var(--space-5);
    padding: 1.15rem 1.25rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
}
.pdp-inquiry__text {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 1rem;
    max-width: none;
}
.pdp-inquiry__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pdp-inquiry__actions .btn {
    flex: 1 1 200px;
    justify-content: center;
    border-radius: 999px;
    padding-block: 0.95rem;
    font-size: 0.8rem;
}

.pdp-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-bottom: var(--space-5);
}
.pdp-contact__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-size: 0.9rem;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}
.pdp-contact__link:hover { color: var(--wine); text-decoration-color: currentColor; }
.pdp-contact__link i { font-size: 1.05rem; }

.pdp-perks {
    border-top: 1px solid var(--line);
    margin-bottom: var(--space-2);
}
.pdp-perks li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
}
.pdp-perks i { width: 18px; text-align: center; color: var(--wine); font-size: 0.95rem; }

.pdp-details details { border-bottom: 1px solid var(--line); }
.pdp-details details[hidden] { display: none; }
.pdp-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.05rem 0;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}
.pdp-details summary::-webkit-details-marker { display: none; }
.pdp-details summary::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 220ms var(--ease-snappy);
}
.pdp-details details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.pdp-details__body {
    padding-bottom: 1.2rem;
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 60ch;
}

.pdp-related { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.pdp-related__title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: var(--fs-xl);
    margin-bottom: var(--space-6);
}

/* Traka za kupovinu na dnu (telefon) */
.pdp-sticky { display: none; }
@media (max-width: 900px) {
    .pdp-sticky {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-sticky-bar);
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
        background: rgba(247, 243, 239, 0.97);
        border-top: 1px solid var(--line);
        transform: translateY(110%);
        transition: transform 280ms var(--ease-drawer);
    }
    .pdp-sticky.is-visible { transform: none; transition-duration: 380ms; }
    .pdp-sticky__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .pdp-sticky__name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pdp-sticky__meta { font-size: 0.8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
    .pdp-sticky .btn { padding: 0.85rem 1.3rem; border-radius: 999px; font-size: 0.78rem; }
    .pdp-sticky .btn::after { display: none; }
}

@media (max-width: 900px) {
    .pdp__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
    .pdp-info { position: static; }
    .pdp-gallery { margin-inline: calc(-1 * clamp(1.25rem, 4vw, 3rem)); }
    .pdp-gallery__track { border-radius: 0; }
    .pdp-gallery__thumbs { display: none; }
    .pdp { padding-top: 0; }
}
@media (min-width: 901px) { .pdp-gallery__count { display: none; } }

/* --------------------------------------------------------------------------
   Bočni panel korpe
   -------------------------------------------------------------------------- */
html.is-drawer-open { overflow: hidden; }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-drawer) - 1);
    background: rgba(12, 11, 10, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; transition-duration: 320ms; }
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    width: min(440px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--cream);
    box-shadow: -18px 0 48px rgba(12, 11, 10, 0.14);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 240ms var(--ease-drawer), visibility 0s linear 240ms;
    outline: none;
}
.cart-drawer.is-open {
    transform: none;
    visibility: visible;
    transition: transform 400ms var(--ease-drawer), visibility 0s;
}
.cart-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 0.6rem 1.5rem;
}
.cart-drawer__head h2 {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.75rem;
}
.cart-drawer__count {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}
.ship-progress { padding: 0 1.5rem 1rem; }
.ship-progress[hidden] { display: none; }
.ship-progress__text { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.55rem; max-width: none; }
.ship-progress__text strong { color: var(--ink); font-weight: 600; }
.ship-progress__bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.ship-progress__bar span {
    display: block;
    height: 100%;
    background: var(--wine);
    transform-origin: left center;
    transition: transform 520ms var(--ease-out);
}
.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
    border-top: 1px solid var(--line);
    overscroll-behavior: contain;
}
.cart-lines { list-style: none; }
.cart-line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--line);
}
.cart-line.is-new { animation: lineFlash 1400ms ease-out; }
@keyframes lineFlash {
    0%, 30% { background: var(--gold-soft); }
    100% { background: transparent; }
}
.cart-line__media {
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream-warm);
}
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__info { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; min-width: 0; }
.cart-line__name {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--ink);
}
.cart-line__name:hover { color: var(--wine); }
.cart-line__variant { font-size: 0.82rem; color: var(--ink-soft); }
.cart-line__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
}
.cart-line__price { font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.cart-drawer__foot {
    padding: 1.1rem 1.5rem calc(1.1rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: var(--cream);
}
.cart-drawer__foot[hidden] { display: none; }
.cart-drawer__total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-drawer__total span { font-size: 0.92rem; color: var(--ink-soft); }
.cart-drawer__total strong { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-drawer__note { font-size: 0.8rem; color: var(--ink-soft); max-width: none; }
.cart-drawer__foot .btn { border-radius: 999px; padding-block: 1.05rem; }
.cart-drawer__foot .link-btn { align-self: center; }

.cart-empty { padding: 3rem 0; text-align: center; }
.cart-empty__title { font-family: var(--font-serif); font-style: italic; font-size: 1.6rem; margin: 0 auto 0.5rem; }
.cart-empty__text { color: var(--ink-soft); font-size: 0.95rem; margin: 0 auto 1.5rem; }

/* --------------------------------------------------------------------------
   Stranica korpe i porudžbine
   -------------------------------------------------------------------------- */
.checkout { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); }
.checkout__head { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.checkout__head h1 {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.4rem, 1.6rem + 3vw, 3.8rem);
    line-height: 1;
}
.checkout__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.checkout-step { padding-block: 0; }
.checkout-step + .checkout-step { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.checkout-step__title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.6rem;
    margin-bottom: var(--space-5);
}
.checkout-step__num {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--wine);
    color: var(--wine);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    flex-shrink: 0;
}
.checkout .cart-lines { border-top: 1px solid var(--line); }
.checkout .cart-line { grid-template-columns: 92px minmax(0, 1fr); }
.checkout .cart-line.is-stale { opacity: 0.55; }
.cart-line__warning { font-size: 0.8rem; color: var(--wine); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 1.25rem;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--ink);
}
.field label .opt { font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
.field input,
.field textarea {
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #8A7F76; }
.field input:focus, .field textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(12, 11, 10, 0.06);
    outline: none;
}
.field.has-error input, .field.has-error textarea { border-color: var(--rose); }
.field__error { font-size: 0.8rem; color: #B42318; }
.field__error:empty { display: none; }
.field__hint { font-size: 0.8rem; color: var(--ink-soft); }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.95rem 1.1rem;
    margin-bottom: var(--space-5);
    border-radius: var(--radius-lg);
    background: rgba(217, 53, 45, 0.07);
    color: #8F1D16;
    font-size: 0.92rem;
    line-height: 1.5;
}
.form-alert[hidden] { display: none; }
.form-alert--info { background: rgba(201, 169, 110, 0.14); color: var(--ink); }

/* Pregled porudžbine (desno) */
.summary {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    padding: clamp(1.4rem, 3vw, 2rem);
    background: var(--surface);
    border-radius: var(--radius-lg);
}
.summary__title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; margin-bottom: var(--space-4); }
.summary__items { list-style: none; margin-bottom: var(--space-4); }
.summary__item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.55rem 0;
}
.summary__thumb { position: relative; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; background: var(--cream-warm); }
.summary__thumb img { width: 100%; height: 100%; object-fit: cover; }
.summary__qty {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--cream);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.summary__name { font-size: 0.9rem; line-height: 1.35; }
.summary__name small { display: block; color: var(--ink-soft); font-size: 0.78rem; }
.summary__price { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary__rows { border-top: 1px solid var(--line); padding-top: var(--space-4); display: grid; gap: 0.55rem; }
.summary__row { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--ink-soft); }
.summary__row span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.summary__row--total {
    align-items: baseline;
    margin-top: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    font-size: 1rem;
    color: var(--ink);
    font-weight: 600;
}
.summary__row--total span:last-child { font-size: 1.35rem; }
.summary__free { color: var(--ok) !important; font-weight: 600; }
.summary .ship-progress { padding: var(--space-4) 0 0; }
.pay-method {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-block: var(--space-5);
    padding: 1rem;
    border: 1px solid var(--ink);
    border-radius: var(--radius-lg);
}
.pay-method__dot {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    border: 5px solid var(--ink);
    flex-shrink: 0;
}
.pay-method strong { display: block; font-size: 0.95rem; }
.pay-method span { font-size: 0.84rem; color: var(--ink-soft); }
.summary__submit {
    height: 58px;
    border-radius: 999px;
    font-size: 0.86rem;
}
.summary__submit .spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(247, 243, 239, 0.35);
    border-top-color: var(--cream);
    animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.summary__fine { margin-top: var(--space-3); font-size: 0.78rem; color: var(--ink-soft); text-align: center; max-width: none; }
.summary__trust { margin-top: var(--space-5); display: grid; gap: 0.6rem; font-size: 0.84rem; color: var(--ink-soft); }
.summary__trust li { display: flex; gap: 0.6rem; align-items: center; }
.summary__trust i { color: var(--wine); width: 16px; text-align: center; }

.checkout-empty { text-align: center; padding: clamp(3rem, 8vw, 6rem) 0; }
.checkout-empty h2 { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: var(--fs-xl); margin-bottom: var(--space-3); }
.checkout-empty p { margin: 0 auto var(--space-5); color: var(--ink-soft); }

@media (max-width: 960px) {
    .checkout__grid { grid-template-columns: minmax(0, 1fr); }
    .summary { position: static; }
}
@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
    .checkout .cart-line { grid-template-columns: 76px minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Zahvalnica
   -------------------------------------------------------------------------- */
.thanks { padding-block: clamp(3rem, 8vw, 6rem); }
.thanks__inner { max-width: 640px; margin-inline: auto; }
.thanks__mark { width: 64px; height: 64px; margin-bottom: var(--space-5); }
.thanks__mark circle { fill: none; stroke: var(--wine); stroke-width: 1.5; }
.thanks__mark path {
    fill: none;
    stroke: var(--wine);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawCheck 600ms var(--ease-out) 250ms forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.thanks h1 {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem);
    line-height: 1;
    margin-bottom: var(--space-4);
    text-wrap: balance;
}
.thanks__lead { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: var(--space-6); }
.thanks__number {
    display: inline-flex;
    gap: 0.6rem;
    align-items: baseline;
    padding: 0.6rem 1rem;
    margin-bottom: var(--space-6);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.thanks__number strong { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; color: var(--ink); }
.thanks__card { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: var(--space-6); }
.thanks__address { font-size: 0.92rem; line-height: 1.6; color: var(--ink-soft); padding-top: var(--space-4); margin-top: var(--space-4); border-top: 1px solid var(--line); }
.thanks__steps { list-style: none; counter-reset: step; display: grid; gap: var(--space-4); margin-bottom: var(--space-7); }
.thanks__steps li { display: grid; grid-template-columns: 30px 1fr; gap: 0.9rem; align-items: start; font-size: 0.95rem; color: var(--ink-soft); }
.thanks__steps li::before {
    counter-increment: step;
    content: counter(step);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--wine);
    color: var(--wine);
    font-family: var(--font-serif);
    font-style: italic;
}
.thanks__steps strong { color: var(--ink); font-weight: 600; }
.thanks__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* --------------------------------------------------------------------------
   Smanjeno kretanje
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .cart-drawer, .cart-drawer.is-open { transition: opacity 160ms ease, visibility 0s; transform: none; opacity: 0; }
    .cart-drawer.is-open { opacity: 1; }
    .pdp-sticky, .pdp-sticky.is-visible { transition: none; }
    .product-card.is-entering { animation: none; }
    .thanks__mark path { animation: none; stroke-dashoffset: 0; }
    .cart-button__count.is-bump { animation: none; }
}
