/* TR Side Cart v1.0 */

/* ── Panel ──────────────────────────────────────────────────────────── */
.tr-sc-panel {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}
.tr-sc-panel.tr-sc-open {
    pointer-events: auto;
    visibility: visible;
}

.tr-sc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .3s ease;
}
.tr-sc-panel.tr-sc-open .tr-sc-overlay { opacity: 1; }

.tr-sc-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.tr-sc-panel.tr-sc-open .tr-sc-drawer { transform: translateX(0); }

/* ── Header ─────────────────────────────────────────────────────────── */
.tr-sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e3da;
    flex-shrink: 0;
}
.tr-sc-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.tr-sc-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px;
    transition: color .15s;
}
.tr-sc-close:hover { color: #1a1a1a; }

/* ── Shipping bar ────────────────────────────────────────────────────── */
.tr-sc-ship-bar {
    padding: 14px 24px;
    background: #f8f5ef;
    border-bottom: 1px solid #e8e3da;
    flex-shrink: 0;
}
.tr-sc-ship-msg {
    font-size: 12.5px;
    color: #444;
    margin: 0 0 8px;
    text-align: center;
}
.tr-sc-ship-free .tr-sc-ship-msg { color: #2A3D28; font-weight: 600; }
.tr-sc-bar-track {
    height: 4px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.tr-sc-bar-fill {
    height: 100%;
    background: #2A3D28;
    border-radius: 4px;
    transition: width .4s ease;
}
.tr-sc-ship-free .tr-sc-bar-fill { background: #2A3D28; }

/* ── Items ──────────────────────────────────────────────────────────── */
.tr-sc-items {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
}
.tr-sc-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f0ece3;
}
.tr-sc-item:last-child { border-bottom: none; }

.tr-sc-img-wrap { flex-shrink: 0; display: block; }
.tr-sc-img {
    width: 80px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f5ef;
}
/* WC generates <img> inside, so target the wrapper img */
.tr-sc-img-wrap img {
    width: 80px;
    height: 100px;
    object-fit: contain;
    background: #f8f5ef;
}

.tr-sc-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tr-sc-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tr-sc-item-name:hover { color: #2A3D28; }
.tr-sc-item-price { font-size: 14px; color: #2A3D28; font-weight: 700; }

.tr-sc-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}
.tr-sc-qty-btn {
    width: 28px; height: 28px;
    border: 1.5px solid #ccc;
    border-radius: 50%;
    background: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #444;
    transition: border-color .15s, color .15s;
}
.tr-sc-qty-btn:hover { border-color: #2A3D28; color: #2A3D28; }
.tr-sc-qty-num { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.tr-sc-remove {
    font-size: 11px;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
    margin-left: auto;
    border: none;
    background: none;
    transition: color .15s;
}
.tr-sc-remove:hover { color: #B8451E; }

.tr-sc-empty {
    padding: 40px 0;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.tr-sc-footer {
    border-top: 1px solid #e8e3da;
    padding: 20px 24px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}
.tr-sc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.tr-sc-total-label { font-size: 14px; font-weight: 600; color: #1a1a1a; text-transform: uppercase; letter-spacing: .04em; }
.tr-sc-total-price { font-size: 18px; font-weight: 700; color: #1a1a1a; }
.tr-sc-note { font-size: 11.5px; color: #999; margin-top: -4px; }

.tr-sc-btn {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, color .2s, border-color .2s;
    box-sizing: border-box;
}
.tr-sc-btn-cart {
    border: 2px solid #2A3D28;
    color: #2A3D28;
    background: #fff;
}
.tr-sc-btn-cart:hover { background: #2A3D28; color: #fff; }
.tr-sc-btn-checkout {
    background: #2A3D28;
    color: #fff;
    border: 2px solid #2A3D28;
}
.tr-sc-btn-checkout:hover { background: #1e2e1e; border-color: #1e2e1e; }

/* Loading state */
.tr-sc-loading .tr-sc-items { opacity: .5; pointer-events: none; }

@media (max-width: 480px) {
    .tr-sc-drawer { width: 100vw; }
    .tr-sc-header, .tr-sc-items, .tr-sc-footer { padding-left: 16px; padding-right: 16px; }
    .tr-sc-ship-bar { padding: 12px 16px; }
}
