/* ============================================================================
 * minicart.css — Mini giỏ hàng (drawer) chuẩn UI/UX chuyển đổi cao.
 * Tách riêng theo trang/khu (xem CLAUDE.md 6.3). Tái dùng base .aq-cartmini-area
 * của theme (vị trí/transform/transition) và override phần ruột bằng class mc-*.
 * Responsive đầy đủ mobile → desktop (6.4). Biến màu kế thừa theme (--aq-*).
 * ========================================================================== */

:root {
    --mc-accent: var(--aq-common-red, #e4002b);
    --mc-accent-dark: #c20025;
    --mc-ink: #16181c;
    --mc-muted: #6b7280;
    --mc-line: #eceff3;
    --mc-soft: #f6f7f9;
    --mc-ok: #1aa260;
    --mc-radius: 14px;
}

/* ---- Khung drawer: nền sáng, bo nhẹ mép trái, cột co giãn -------------- */
.aq-cartmini-area.mc-drawer {
    width: 420px;
    max-width: 92vw;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, .16);
}

@media (max-width: 575px) {
    .aq-cartmini-area.mc-drawer { width: 100%; max-width: 100%; }
}

/* ---- Header -------------------------------------------------------------- */
.mc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--mc-line);
}

.mc-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: var(--mc-ink);
    display: flex;
    align-items: center;
    gap: 9px;
}

.mc-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--mc-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.mc-close {
    position: static;
    margin-inline-start: auto;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    color: var(--mc-ink);
    background: var(--mc-soft);
    transition: background .2s, transform .25s;
}

.mc-close:hover { background: #ebedf0; transform: rotate(90deg); }

/* ---- Body: danh sách dòng SP ------------------------------------------- */
.aq-cartmini-body.mc-body {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 6px 22px;
    border-top: none;
    overflow-y: auto;
    scrollbar-width: thin;
}

.mc-body::-webkit-scrollbar { width: 6px; }
.mc-body::-webkit-scrollbar-thumb { background: #d7dbe2; border-radius: 999px; }

/* Dòng sản phẩm */
.mc-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--mc-line);
    animation: mcIn .25s ease;
}

@keyframes mcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mc-item.is-removing { opacity: .4; pointer-events: none; }

.mc-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--mc-soft);
    border: 1px solid var(--mc-line);
}

.mc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mc-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.mc-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mc-name a { color: var(--mc-ink); }
.mc-name a:hover { color: var(--mc-accent); }

.mc-variant {
    font-size: 12px;
    color: var(--mc-muted);
}

.mc-variant label { margin: 0 4px 0 0; font-weight: 500; }

.mc-unit { font-size: 12.5px; color: var(--mc-muted); }
.mc-unit b { color: var(--mc-ink); font-weight: 600; }

/* Cột phải: giá dòng + xóa */
.mc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.mc-line-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--mc-ink);
    white-space: nowrap;
}

.mc-remove {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--mc-muted);
    padding: 2px;
    line-height: 1;
    transition: color .2s;
}

.mc-remove:hover { color: var(--mc-accent); }

/* Bộ tăng/giảm số lượng */
.mc-qty {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    border: 1px solid var(--mc-line);
    border-radius: 999px;
    background: #fff;
    margin-top: 4px;
}

.mc-qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--mc-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s, color .15s;
}

.mc-qty button:hover { background: var(--mc-accent); color: #fff; }
.mc-qty button:disabled { opacity: .35; cursor: not-allowed; }
.mc-qty button:disabled:hover { background: none; color: var(--mc-ink); }

.mc-qty input {
    width: 36px;
    height: 28px;
    min-height: 28px;
    line-height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-ink);
    background: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.mc-qty input:focus { border: none; box-shadow: none; background: none; }

.mc-qty input::-webkit-outer-spin-button,
.mc-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Empty state -------------------------------------------------------- */
.mc-empty {
    text-align: center;
    padding: 48px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.mc-empty-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--mc-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #c2c8d2;
}

.mc-empty p { margin: 0; color: var(--mc-muted); font-size: 14px; }
.mc-empty .mc-empty-title { color: var(--mc-ink); font-size: 16px; font-weight: 700; }

.mc-empty .mc-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 180px;
    height: 46px;
    margin-top: 4px;
    padding: 0 28px;
}

/* ---- Footer ------------------------------------------------------------- */
.aq-cartmini-footer.mc-footer {
    padding: 16px 22px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mc-line);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
    background: #fff;
}

.mc-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.mc-summary span { font-size: 14px; color: var(--mc-muted); }
.mc-summary strong { font-size: 22px; font-weight: 800; color: var(--mc-ink); letter-spacing: -.4px; }

.mc-note { margin: 0 0 12px; font-size: 12px; color: var(--mc-muted); }

.mc-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.mc-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--mc-muted);
}

.mc-trust i { color: var(--mc-ok); font-size: 13px; }

.mc-actions { display: flex; gap: 10px; }

.mc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border-radius: var(--mc-radius);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform .12s, background .2s, color .2s, box-shadow .2s;
}

.mc-btn:active { transform: translateY(1px); }

.mc-btn-ghost {
    flex: 0 0 38%;
    background: var(--mc-soft);
    color: var(--mc-ink);
    border: 1px solid var(--mc-line);
}

.mc-btn-ghost:hover { background: #eef0f3; color: var(--mc-ink); }

.mc-btn-primary {
    background: var(--mc-accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(228, 0, 43, .28);
}

.mc-btn-primary:hover { background: var(--mc-accent-dark); color: #fff; box-shadow: 0 10px 26px rgba(228, 0, 43, .34); }

/* Footer ẩn khi giỏ trống */
.mc-footer.is-empty { display: none; }

/* ---- Tinh chỉnh nhỏ cho màn thấp -------------------------------------- */
@media (max-height: 640px) {
    .mc-item { padding: 12px 0; }
}
