/**
 * TabRight Cart — Styles
 * Modern two-column cart (items + sticky order summary) in the brand green.
 * Scoped under .tr-cart-wrap so nothing leaks into the surrounding page.
 */

.tr-cart-wrap {
    --c-green-btn: #185b37;
    --c-green-btn-h: #0f4629;
    --c-green: #429c5a;
    --c-green-tint: #edf7f2;
    --c-ink: #111827;
    --c-ink-60: #4a5157;
    --c-muted: #6b7280;
    --c-border: #e4e0d6;
    --c-divider: #efece4;
    --c-card: #ffffff;
    --c-page: #faf9f6;
    --c-danger: #b3261e;
    --c-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

    max-width: 1040px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    color: var(--c-ink);
    box-sizing: border-box;
}
.tr-cart-wrap *, .tr-cart-wrap *::before, .tr-cart-wrap *::after { box-sizing: border-box; }

/* ── Header ───────────────────────────────── */
.tr-cart-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 1.5rem;
}
.tr-cart-title {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--c-ink);
    margin: 0;
}
.tr-cart-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-green-btn);
    background: var(--c-green-tint);
    padding: 3px 11px;
    border-radius: 999px;
}

/* ── Grid ─────────────────────────────────── */
.tr-cart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 860px) {
    .tr-cart-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Items ────────────────────────────────── */
.tr-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tr-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tr-cart-item:hover {
    border-color: var(--c-green);
    box-shadow: 0 2px 10px rgba(20, 40, 30, 0.05);
}
.tr-cart-item__icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--c-green-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-green-btn);
}
.tr-cart-item__icon svg { width: 22px; height: 22px; display: block; }
.tr-cart-item__main { min-width: 0; flex: 1; }
.tr-cart-item__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-ink);
    word-break: break-word;
    line-height: 1.3;
}
.tr-cart-item__sub {
    font-size: 0.8rem;
    color: var(--c-muted);
    margin-top: 2px;
}
.tr-cart-item__right {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.tr-cart-item__price {
    font-family: var(--c-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-ink);
    white-space: nowrap;
}
.tr-cart-item__price .per { font-size: 0.72rem; font-weight: 500; color: var(--c-muted); }
.tr-cart-remove-btn {
    padding: 2px 2px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--c-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}
.tr-cart-remove-btn:hover { color: var(--c-danger); text-decoration: underline; }
.tr-cart-remove-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 460px) {
    .tr-cart-item { align-items: flex-start; }
    .tr-cart-item__icon { width: 38px; height: 38px; }
}

/* ── Order summary ────────────────────────── */
.tr-cart-col-sum { position: relative; }
.tr-cart-sum {
    position: sticky;
    top: 20px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 6px 26px rgba(20, 24, 26, 0.07);
}
.tr-cart-sum__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin: 0 0 16px;
}
.tr-cart-sum__rows { display: flex; flex-direction: column; gap: 10px; }
.tr-cart-sum__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
}
.tr-cart-sum__row span:first-child { color: var(--c-muted); }
.tr-cart-sum__row span:last-child { font-family: var(--c-mono); font-weight: 600; }
.tr-cart-sum__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--c-divider);
    font-weight: 700;
}
.tr-cart-sum__total > span:first-child { font-size: 0.95rem; }
.tr-cart-total-amount {
    font-family: var(--c-mono);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Scoped + !important: the Elementor/Hello theme paints its own button
   background (and a pink hover/focus), which otherwise beats a plain class and
   turns this into an outlined/pink button. See CLAUDE.md section 5. */
.tr-cart-wrap .tr-cart-checkout {
    width: 100%;
    margin-top: 18px;
    height: 52px;
    border: none !important;
    border-radius: 13px !important;
    background: var(--c-green-btn) !important;
    color: #fff !important;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
}
.tr-cart-wrap .tr-cart-checkout:hover,
.tr-cart-wrap .tr-cart-checkout:focus { background: var(--c-green-btn-h) !important; color: #fff !important; box-shadow: 0 8px 20px rgba(24, 91, 55, 0.28); }
.tr-cart-wrap .tr-cart-checkout:focus-visible { outline: 3px solid rgba(66, 156, 90, 0.45); outline-offset: 2px; }
.tr-cart-wrap .tr-cart-checkout:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.tr-cart-wrap .tr-cart-checkout--ghost {
    background: transparent !important;
    color: var(--c-green-btn) !important;
    border: 1.5px solid var(--c-border) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 48px;
    padding: 0 22px;
}
.tr-cart-wrap .tr-cart-checkout--ghost:hover,
.tr-cart-wrap .tr-cart-checkout--ghost:focus { background: var(--c-green-tint) !important; color: var(--c-green-btn) !important; box-shadow: none; border-color: var(--c-green) !important; }

.tr-cart-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--c-muted);
    margin: 12px 0 0;
}
.tr-cart-secure svg { width: 13px; height: 13px; }
.tr-cart-fine {
    font-size: 0.72rem;
    color: var(--c-muted);
    text-align: center;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* ── Empty / loading ──────────────────────── */
.tr-cart-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 18px;
}
.tr-cart-empty__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: var(--c-green-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-green-btn);
}
.tr-cart-empty__icon svg { width: 30px; height: 30px; }
.tr-cart-empty h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; color: var(--c-ink); }
.tr-cart-empty p { font-size: 0.95rem; color: var(--c-muted); margin: 0 0 1.5rem; }
.tr-cart-loading { text-align: center; padding: 3rem 1rem; color: var(--c-muted); }

/* ── Messages ─────────────────────────────── */
.tr-cart-message {
    display: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}
.tr-cart-message.tr-msg-error { display: block; background: #fef2f2; color: var(--c-danger); border: 1px solid #fecaca; }
.tr-cart-message.tr-msg-success { display: block; background: var(--c-green-tint); color: var(--c-green-btn); border: 1px solid #c7e7d4; }
.tr-cart-message.tr-msg-info { display: block; background: var(--c-green-tint); color: var(--c-green-btn-h); border: 1px solid #c7e7d4; }
