/* ============================================================
   BRANDO TECH & HOME - Cart Drawer + Login Modal
   ============================================================ */

/* ─── OVERLAY ─────────────────────────────────────────────── */
.brando-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.brando-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ─── CART DRAWER ──────────────────────────────────────────── */
.brando-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}
.brando-cart-drawer.open {
    transform: translateX(0);
}

/* Header */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #7B1032;
    color: #fff;
    flex-shrink: 0;
}
.cart-drawer-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-drawer-header .cart-count-badge {
    background: #E8D5B7;
    color: #7B1032;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cart-drawer-close {
    background: none;
    border: none;
    color: #E8D5B7;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}
.cart-drawer-close:hover { color: #fff; }

/* Body - ítems */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: #e8d5b7; border-radius: 2px; }

/* Empty state */
.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    color: #999;
    text-align: center;
}
.cart-empty-state i {
    font-size: 64px;
    color: #e8d5b7;
    margin-bottom: 16px;
}
.cart-empty-state p { font-size: 15px; color: #888; }

/* Loading state */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.cart-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8d5b7;
    border-top-color: #7B1032;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cart item */
.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0e8de;
    align-items: flex-start;
    transition: background 0.15s;
}
.cart-item:hover { background: #fdf9f6; }
.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #f0e8de;
    background: #fafafa;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #7B1032;
}
.cart-item-price small {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e0d0c8;
    background: #fff;
    color: #7B1032;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.15s;
    padding: 0;
}
.qty-btn:hover { background: #f9f5f0; }
.qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.cart-item-delete {
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.cart-item-delete:hover { color: #c0392b; }

/* Footer */
.cart-drawer-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 2px solid #f0e8de;
    background: #fff;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.cart-total-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}
.cart-total-amount {
    font-size: 22px;
    font-weight: 800;
    color: #7B1032;
}
.cart-total-amount small {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    display: block;
    text-align: right;
}
.btn-checkout {
    display: block;
    width: 100%;
    background: #7B1032;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    margin-bottom: 10px;
}
.btn-checkout:hover { background: #5C0A24; }
.btn-keep-shopping {
    display: block;
    width: 100%;
    background: transparent;
    color: #7B1032;
    border: 2px solid #7B1032;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-keep-shopping:hover {
    background: #f9f5f0;
    text-decoration: none;
    color: #5C0A24;
}
.cart-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 11px;
    color: #aaa;
}
.cart-secure-note i { color: #7B1032; }

/* ─── MODAL LOGIN/GUEST ─────────────────────────────────────── */
.brando-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.brando-auth-modal.open {
    opacity: 1;
    pointer-events: all;
}
.brando-auth-modal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.brando-auth-modal .modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Modal header */
.auth-modal-header {
    background: #7B1032;
    color: #fff;
    padding: 18px 22px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.auth-modal-header h3 {
    color: #fff;
    font-size: 18px;
    margin: 0;
}
.auth-modal-close {
    background: none;
    border: none;
    color: #E8D5B7;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.auth-modal-close:hover { color: #fff; }

/* Options tabs */
.auth-options {
    display: flex;
    border-bottom: 2px solid #f0e8de;
}
.auth-option-tab {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.auth-option-tab i { font-size: 20px; }
.auth-option-tab:hover { color: #7B1032; background: #fdf9f6; }
.auth-option-tab.active {
    color: #7B1032;
    border-bottom-color: #7B1032;
    background: #fdf9f6;
}

/* Panels */
.auth-panel { display: none; padding: 22px; }
.auth-panel.active { display: block; }

.auth-form-group { margin-bottom: 14px; }
.auth-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}
.auth-form-group input {
    width: 100%;
    border: 2px solid #e0d0c8;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}
.auth-form-group input:focus {
    outline: none;
    border-color: #7B1032;
}
.auth-form-group input.error { border-color: #e74c3c; }

.auth-error-msg {
    background: #ffeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.auth-error-msg.visible { display: block; }

.btn-auth-submit {
    width: 100%;
    background: #7B1032;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.btn-auth-submit:hover { background: #5C0A24; }
.btn-auth-submit:disabled {
    background: #c9a8b2;
    cursor: not-allowed;
}
.btn-auth-submit .spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.auth-divider {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    margin: 12px 0;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e8e0d8;
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-link {
    color: #7B1032;
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-register-card {
    border: 2px solid #e8d5b7;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    background: #fdf9f6;
}
.auth-register-card p { font-size: 14px; color: #555; margin-bottom: 14px; }
.btn-register {
    display: inline-block;
    background: #E8D5B7;
    color: #7B1032;
    border: 2px solid #7B1032;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-register:hover {
    background: #7B1032;
    color: #fff;
    text-decoration: none;
}

/* Toast notification */
.brando-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #2d2d2d;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1400;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90vw;
}
.brando-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.brando-toast.success { background: #7B1032; }
.brando-toast.error   { background: #c0392b; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .brando-cart-drawer { width: 100vw; }
    .auth-option-tab span { display: none; }
    .auth-option-tab { padding: 12px 6px; }
}

/* ═══════════════════════════════════════════════════════════
   CHECKOUT SHARED STYLES
   Used by: OrderShow, OrderShipping, OrderData,
            OrderPayment, OrderFinish and other checkout pages
   ═══════════════════════════════════════════════════════════ */

/* ── Step breadcrumb ──────────────────────────────────────── */
.brando-steps {
    background: #f9f5f0;
    border-bottom: 1px solid #e8d5b7;
    padding: 14px 0;
    margin-bottom: 28px;
}
.brando-steps .steps-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 4px;
}
.brando-steps .step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #aaa;
    font-weight: 600;
}
.brando-steps .step-item .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.brando-steps .step-item.active { color: #7B1032; }
.brando-steps .step-item.active .step-num { background: #7B1032; }
.brando-steps .step-item.done { color: #27ae60; }
.brando-steps .step-item.done .step-num { background: #27ae60; }
.brando-steps .step-sep {
    color: #ccc;
    font-size: 16px;
    margin: 0 6px;
}
@media (max-width: 520px) {
    .brando-steps .step-sep { display: none; }
    .brando-steps .steps-list { gap: 6px; }
    .brando-steps .step-item { font-size: 11px; }
    .brando-steps .step-item .step-num { width: 22px; height: 22px; font-size: 10px; }
}

/* ── Checkout card box ────────────────────────────────────── */
.brando-cart-box {
    background: #fff;
    border: 1px solid #e8d5b7;
    border-radius: 10px;
    overflow: hidden;
}
.brando-cart-box .box-header {
    background: #7B1032;
    color: #fff;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brando-cart-box .box-body  { padding: 0; }
.brando-cart-box .box-footer { padding: 16px 18px; border-top: 2px solid #f0e8de; }

/* ── Checkout buttons ─────────────────────────────────────── */
.btn-brando-checkout {
    display: block;
    width: 100%;
    background: #7B1032;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    margin-bottom: 10px;
    text-decoration: none;
}
.btn-brando-checkout:hover { background: #5C0A24; color: #fff; text-decoration: none; }
.btn-brando-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: #7B1032;
    border: 2px solid #7B1032;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-brando-secondary:hover { background: #f9f5f0; color: #5C0A24; text-decoration: none; }
.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #c0392b;
    border: 1px solid #e0c8c8;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-danger-outline:hover { background: #fdf0f0; border-color: #c0392b; color: #c0392b; text-decoration: none; }

/* ── Security badges ──────────────────────────────────────── */
.secure-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.secure-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #888;
}
.secure-badge i { color: #7B1032; font-size: 15px; }

/* ── Summary rows ─────────────────────────────────────────── */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5ede8;
}
.summary-row:last-child { border-bottom: none; }
/* Support both .label/.value (OrderShow) and .s-label/.s-value (OrderShipping) variants */
.summary-row .label,
.summary-row .s-label  { color: #666; }
.summary-row .value,
.summary-row .s-value  { font-weight: 600; color: #333; }
.summary-row.total-row {
    padding-top: 14px;
    border-top: 2px solid #e8d5b7;
    border-bottom: none;
    margin-top: 6px;
}
.summary-row.total-row .label,
.summary-row.total-row .s-label { font-size: 16px; font-weight: 700; color: #3D0A18; }
.summary-row.total-row .value,
.summary-row.total-row .s-value { font-size: 22px; font-weight: 800; color: #7B1032; }

/* ── Promo code input ─────────────────────────────────────── */
.brando-promo-input-wrap {
    display: flex;
    gap: 0;
    margin-bottom: 4px;
}
.brando-promo-input-wrap input {
    flex: 1;
    border: 2px solid #e8d5b7;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.brando-promo-input-wrap input:focus { border-color: #7B1032; }
.brando-promo-input-wrap .btn-apply-promo {
    background: #7B1032;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.brando-promo-input-wrap .btn-apply-promo:hover { background: #5C0A24; }

/* ── Error banner ─────────────────────────────────────────── */
.brando-error-msg {
    background: #ffeaea;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
}
.brando-error-msg.visible { display: flex; align-items: center; gap: 8px; }

/* ── Discount applied badge ───────────────────────────────── */
.discount-applied {
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    color: #1e8449;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Empty cart state ─────────────────────────────────────── */
.brando-cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}
.brando-cart-empty i { font-size: 72px; color: #e8d5b7; display: block; margin-bottom: 16px; }
.brando-cart-empty h4 { color: #888; font-size: 18px; margin-bottom: 8px; }
.brando-cart-empty p  { font-size: 14px; margin-bottom: 20px; }
