/* TIQS shared cart — one look across every QR-shop theme.
   Everything is namespaced under .tiqs-cart-* and the drawer carries its own
   baseline (font, box-sizing, colours) so host theme CSS can't distort it. */

/* ---- toggle icon (injected into the theme header, or floating fallback) ---- */
.tiqs-cart-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;            /* blend with header text colour */
    cursor: pointer;
    line-height: 0;
    vertical-align: middle;
}

.tiqs-cart-toggle--fab {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    z-index: 2147483000;
}

.tiqs-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e11d48;
    color: #fff;
    font: 700 11px/18px Arial, Helvetica, sans-serif;
    text-align: center;
}

.tiqs-cart-badge.is-hidden { display: none; }

/* ---- backdrop ---- */
.tiqs-cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 2147483000;
}

.tiqs-cart-backdrop.is-open { opacity: 1; visibility: visible; }

body.tiqs-cart-open { overflow: hidden; }

/* ---- drawer ---- */
.tiqs-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .28s ease;
    z-index: 2147483001;
}

.tiqs-cart-drawer.is-open { transform: translateX(0); }

.tiqs-cart-drawer *,
.tiqs-cart-drawer *::before,
.tiqs-cart-drawer *::after { box-sizing: border-box; }

.tiqs-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #ececec;
}

.tiqs-cart-heading { font-size: 17px; font-weight: 700; }

.tiqs-cart-close {
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}

.tiqs-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px;
}

.tiqs-cart-empty {
    margin: 40px 0;
    text-align: center;
    color: #9ca3af;
}

/* ---- line item ---- */
.tiqs-cart-line {
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
}

.tiqs-cart-line-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.tiqs-cart-line-name { font-weight: 600; }
.tiqs-cart-line-qty { font-weight: 700; color: #555; }

.tiqs-cart-remove {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #b0b0b0;
    cursor: pointer;
    padding: 0 2px;
}

.tiqs-cart-remove:hover { color: #e11d48; }

.tiqs-cart-addons {
    margin: 4px 0 0;
    padding: 0 0 0 14px;
    list-style: disc;
    color: #6b7280;
    font-size: 12.5px;
}

.tiqs-cart-line-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.tiqs-cart-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    overflow: hidden;
}

.tiqs-cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 0;
    background: #f7f7f7;
    color: #1f2937;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.tiqs-cart-qty-btn:hover { background: #ededed; }

.tiqs-cart-qty-val { min-width: 30px; text-align: center; font-weight: 600; }

.tiqs-cart-line-total { font-weight: 700; }

/* ---- footer ---- */
.tiqs-cart-foot {
    padding: 16px 18px;
    border-top: 1px solid #ececec;
}

.tiqs-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}

.tiqs-cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 12px;
    padding-top: 8px;
    border-top: 1px solid #ececec;
    font-size: 16px;
    font-weight: 700;
}

.tiqs-cart-checkout {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tiqs-cart-checkout:hover { background: #128a3f; }
