/* =====================================================================
   Cart page ("yc-"). Desktop: items + sticky summary. Phone: stacked cards and a bottom order bar.
   ===================================================================== */

.yc { padding-bottom: 40px; }
.yc svg { flex: none; }

/* ---------- head ---------- */
.yc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.yc-head h1 { margin: 0; color: var(--yp-text); font-size: 1.5rem; font-weight: 900; }
.yc-head h1 small { margin-inline-start: 8px; padding: 3px 12px; border-radius: 999px; background: #eef5e6; color: var(--yh-green-2, #2c6a3d); font-size: .8rem; font-weight: 800; vertical-align: middle; }
:root[data-theme="dark"] .yc-head h1 small { background: rgba(124, 196, 143, .16); color: #a8e3b6; }

.yc-clear { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--yp-muted); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.yc-clear svg { width: 18px; height: 18px; }
.yc-clear:hover { background: #fde8e8; color: #b42334; }

.yc-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 16px; border-radius: 16px; background: #fff3f3; box-shadow: inset 0 0 0 1px #f3c0c0; color: #7a1a26; font-weight: 700; }
.yc-confirm span { flex: 1 1 160px; }
:root[data-theme="dark"] .yc-confirm { background: rgba(200, 60, 90, .14); color: #f6b6c4; box-shadow: inset 0 0 0 1px rgba(232, 120, 145, .4); }

.yc-alert { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; background: #fff3f3; color: #9b2030; font-weight: 700; box-shadow: inset 0 0 0 1px #f3c0c0; }
.yc-alert svg { width: 18px; height: 18px; }

/* buttons used on this page */
.yc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--yd-box, #fff); box-shadow: 0 0 0 1px var(--yd-edge, #e8dcc0); color: var(--yp-text); font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.yc-btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--yh-gold, #f5b83d); color: var(--yp-text); }
.yc-btn--primary { background: linear-gradient(135deg, var(--yh-green-2, #2c6a3d), var(--yh-green, #1f4a2c)); color: #fff; box-shadow: 0 14px 24px -14px var(--yh-green, #1f4a2c); }
.yc-btn--primary:hover { color: #fff; box-shadow: 0 14px 24px -12px var(--yh-green, #1f4a2c); }
.yc-btn--danger { background: #e5484d; color: #fff; box-shadow: none; }
.yc-btn:disabled { opacity: .6; cursor: default; }

/* ---------- layout ---------- */
.yc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 992px) { .yc-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; } }

.yc-items { display: grid; gap: 12px; min-width: 0; }

/* ---------- one item ---------- */
.yc-item {
    position: relative;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    grid-template-areas: "img main del" "img qty total";
    gap: 6px 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: var(--yd-box, linear-gradient(180deg, #fff, #fffcf6));
    box-shadow: var(--yd-shadow, 0 0 0 1px #efe4cd, 0 14px 28px -22px rgba(90, 60, 20, .55));
    transition: opacity .2s, box-shadow .2s;
}
.yc-item.is-busy { opacity: .55; pointer-events: none; }
.yc-item.is-out { box-shadow: 0 0 0 1.5px #e5484d; }

.yc-item__img { grid-area: img; align-self: start; display: block; width: 84px; height: 84px; overflow: hidden; border-radius: 16px; background: var(--yd-soft, #f3ecdb); }
.yc-item__img img { width: 100%; height: 100%; object-fit: cover; }
.yc-item__main { grid-area: main; min-width: 0; display: grid; gap: 4px; }
.yc-item__name { color: var(--yp-text); font-size: .98rem; font-weight: 900; line-height: 1.7; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yc-item__name:hover { color: var(--yh-green-2, #2c6a3d); }
.yc-item__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.yc-item__opts span { padding: 2px 11px; border-radius: 999px; background: #fdecbf; color: #5b3b05; font-size: .76rem; font-weight: 800; }
:root[data-theme="dark"] .yc-item__opts span { background: rgba(245, 184, 61, .18); color: var(--yh-gold-2, #f8cf6a); }
.yc-item__unit { color: var(--yp-muted); font-size: .8rem; white-space: nowrap; }
.yc-item__unit b { color: var(--yp-text); }
.yc-item__warn { display: flex; align-items: center; gap: 6px; color: #c0392b; font-size: .8rem; font-weight: 800; }
.yc-item__warn svg { width: 16px; height: 16px; }

.yc-item__del { grid-area: del; align-self: start; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--yp-muted); cursor: pointer; transition: background .2s, color .2s; }
.yc-item__del svg { width: 20px; height: 20px; }
.yc-item__del:hover { background: #fde8e8; color: #b42334; }

.yc-qty { grid-area: qty; justify-self: start; display: inline-flex; align-items: center; border-radius: 14px; background: var(--yd-soft, #f3ecdb); box-shadow: inset 0 0 0 1px var(--yd-edge, #e8dcc0); }
.yc-qty button { display: grid; place-items: center; width: 42px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: transparent; color: var(--yp-text); cursor: pointer; transition: background .15s, color .15s; }
.yc-qty button:hover:not(:disabled) { background: rgba(47, 122, 59, .1); color: var(--yh-green-2, #2c6a3d); }
.yc-qty button:disabled { opacity: .35; cursor: default; }
.yc-qty button svg { width: 18px; height: 18px; }
.yc-qty output { min-width: 34px; text-align: center; font-weight: 900; color: var(--yp-text); }

.yc-item__total { grid-area: total; justify-self: end; text-align: end; display: grid; line-height: 1.5; }
.yc-item__total small { color: var(--yp-muted); font-size: .72rem; }
.yc-item__total strong { color: var(--yh-wine, #8c1f33); font-size: 1.1rem; font-weight: 900; white-space: nowrap; }
.yc-item__total em, .yc-bar em, .yc-summary small { font-style: normal; font-size: .72rem; font-weight: 700; }
:root[data-theme="dark"] .yc-item__total strong { color: var(--yh-gold-2, #f8cf6a); }

@media (min-width: 640px) {
    .yc-item { grid-template-columns: 96px minmax(0, 1fr) auto auto 40px; grid-template-areas: "img main qty total del"; padding: 16px 18px; gap: 16px; }
    .yc-item__img { width: 96px; height: 96px; align-self: center; }
    .yc-item__del { align-self: center; }
    .yc-item__total { min-width: 118px; }
}

.yc-continue { display: inline-flex; align-items: center; justify-self: start; gap: 6px; padding: 10px 4px; color: var(--yh-green-2, #2c6a3d); font-weight: 800; font-size: .9rem; text-decoration: none; }
.yc-continue svg { width: 18px; height: 18px; }
.yc-continue:hover { text-decoration: underline; }

/* ---------- summary ---------- */
.yc-summary { padding: 20px; border-radius: 22px; background: var(--yd-box, linear-gradient(180deg, #fff, #fffcf6)); box-shadow: var(--yd-shadow, 0 0 0 1px #efe4cd); }
@media (min-width: 992px) { .yc-summary { position: sticky; top: calc(var(--yd-top, 130px) + 16px); } }
.yc-summary h2 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 900; color: var(--yp-text); }
.yc-summary dl { margin: 0; }
.yc-summary dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--yd-edge, #e8dcc0); font-size: .9rem; }
.yc-summary dt { color: var(--yp-muted); font-weight: 600; }
.yc-summary dt em { font-style: normal; font-size: .76rem; opacity: .8; }
.yc-summary dd { margin: 0; color: var(--yp-text); font-weight: 800; white-space: nowrap; }
.yc-summary__total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #fff8e6, #fdf1d6); box-shadow: inset 0 0 0 1px #f0dcaa; }
:root[data-theme="dark"] .yc-summary__total { background: linear-gradient(135deg, #2a2312, #1c180d); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, .4); }
.yc-summary__total span { color: var(--yp-text); font-weight: 800; font-size: .9rem; }
.yc-summary__total strong { color: var(--yh-wine, #8c1f33); font-size: 1.35rem; font-weight: 900; white-space: nowrap; }
:root[data-theme="dark"] .yc-summary__total strong { color: var(--yh-gold-2, #f8cf6a); }
.yc-summary__warn { margin: 0 0 10px; color: #c0392b; font-size: .82rem; font-weight: 700; line-height: 1.9; }

.yc-checkout { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px; overflow: hidden; border-radius: 16px; background: linear-gradient(135deg, var(--yh-green-2, #2c6a3d), var(--yh-green, #1f4a2c)); color: #fff; font-weight: 900; font-size: 1rem; text-decoration: none; box-shadow: 0 16px 26px -16px var(--yh-green, #1f4a2c); transition: transform .2s, filter .2s; }
.yc-checkout:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.07); }
.yc-checkout svg { width: 20px; height: 20px; }
.yc-checkout.is-disabled { background: var(--yd-soft, #e8e2d2); color: var(--yp-muted); box-shadow: none; cursor: not-allowed; transform: none; filter: none; }

.yc-trust { display: grid; gap: 8px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--yd-edge, #e8dcc0); list-style: none; }
.yc-trust li { display: flex; align-items: center; gap: 10px; color: var(--yp-muted); font-size: .82rem; font-weight: 600; }
.yc-trust svg { width: 26px; height: 26px; padding: 5px; border-radius: 9px; background: #eef5e6; color: var(--yh-green-2, #2c6a3d); }
:root[data-theme="dark"] .yc-trust svg { background: rgba(124, 196, 143, .16); color: #8fdca3; }

/* ---------- phone: order bar ---------- */
.yc-bar { display: none; }
@media (max-width: 991.98px) {
    .yc { padding-bottom: 96px; }
    .yc-bar {
        position: fixed;
        inset-inline: 0;
        bottom: calc(var(--yp-bottombar-h, 62px) + env(safe-area-inset-bottom, 0px));
        z-index: 1019;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: color-mix(in srgb, var(--yp-surface, #fff) 94%, transparent);
        backdrop-filter: blur(12px);
        box-shadow: 0 -10px 24px -14px rgba(0, 0, 0, .35), 0 -1px 0 var(--yd-edge, #e8dcc0);
    }
    .yc-bar > div { display: grid; line-height: 1.4; }
    .yc-bar small { color: var(--yp-muted); font-size: .72rem; }
    .yc-bar strong { color: var(--yh-wine, #8c1f33); font-size: 1.05rem; font-weight: 900; white-space: nowrap; }
    :root[data-theme="dark"] .yc-bar strong { color: var(--yh-gold-2, #f8cf6a); }
    .yc-bar .yc-checkout { flex: 1; min-height: 48px; max-width: 260px; margin-inline-start: auto; font-size: .92rem; }
    .yc-summary .yc-checkout { display: none; }
}

/* ---------- empty cart ---------- */
.yc-empty { display: grid; justify-items: center; gap: 12px; margin: 12px auto 0; max-width: 560px; padding: 46px 22px; border-radius: 26px; background: var(--yd-box, linear-gradient(180deg, #fff, #fffcf6)); box-shadow: var(--yd-shadow, 0 0 0 1px #efe4cd); text-align: center; }
.yc-empty__icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #f5fbef, #e2efd5); color: var(--yh-green-2, #2c6a3d); box-shadow: 0 0 0 8px rgba(47, 122, 59, .08); }
.yc-empty__icon svg { width: 46px; height: 46px; }
.yc-empty h1 { margin: 6px 0 0; font-size: 1.4rem; font-weight: 900; color: var(--yp-text); }
.yc-empty p { margin: 0; max-width: 42ch; color: var(--yp-muted); line-height: 2; font-size: .92rem; }
.yc-empty__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
@media (max-width: 575.98px) { .yc-empty__links .yc-btn { flex: 1 1 100%; } }

/* ---------- loading ---------- */
.yc-skeleton { display: grid; gap: 12px; }
.yc-skeleton div { height: 128px; border-radius: 20px; background: linear-gradient(100deg, var(--yd-soft, #f3ecdb) 30%, rgba(255, 255, 255, .6) 50%, var(--yd-soft, #f3ecdb) 70%) 0 0 / 220% 100%; animation: yc-shimmer 1.2s linear infinite; }
@keyframes yc-shimmer { to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .yc-skeleton div { animation: none; } .yc-item, .yc-checkout { transition: none; } }

/* ---------- Cart drawer: quantity and remove, and "added" feedback on buttons ---------- */
.yp-cart-list li { align-items: flex-start; transition: opacity .2s; }
.yp-cart-list li.is-busy { opacity: .45; pointer-events: none; }
.yp-cart-list__info { flex: 1; min-width: 0; }
.yp-cart-list__name small { color: var(--yh-green-2, #2c6a3d); font-weight: 700; }
.yp-cart-list__ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.yp-cart-list__ctl > strong { margin-inline-start: auto; color: var(--yh-wine, #8c1f33); font-size: .9rem; font-weight: 900; white-space: nowrap; }
.yp-cart-list__ctl > strong small { font-size: .68rem; }
:root[data-theme="dark"] .yp-cart-list__ctl > strong { color: var(--yh-gold-2, #f8cf6a); }
.yp-cart-step { display: inline-flex; align-items: center; border-radius: 12px; background: var(--yp-surface-2, #f4f7f1); box-shadow: inset 0 0 0 1px var(--yp-line, #e1e9dc); }
.yp-cart-step button { width: 32px; height: 34px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--yp-text); font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.yp-cart-step button:hover:not(:disabled) { color: var(--yh-green-2, #2c6a3d); background: rgba(47, 122, 59, .1); }
.yp-cart-step button:disabled { opacity: .35; cursor: default; }
.yp-cart-step b { min-width: 24px; text-align: center; font-size: .88rem; }
.yp-cart-del { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--yp-muted); font-size: .9rem; cursor: pointer; }
.yp-cart-del:hover { background: #fde8e8; color: #b42334; }

.yd-add.is-loading, .yp-hcard__cart.is-loading, .yd-deal__btn.is-loading { opacity: .65; cursor: progress; }
.yd-add.is-done, .yd-deal__btn.is-done { background: linear-gradient(135deg, #34c759, #1f9d45) !important; }
.yp-hcard__cart.is-done { background: #34c759 !important; color: #fff !important; }
