/**
 * OTOEKO Mini Cart Drawer
 * Slide-in sidebar from right
 */

/* ========== OVERLAY ========== */
.mini-cart-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.45) !important;
    opacity: 0;
    z-index: 10002 !important;
    pointer-events: none;
    transition: opacity 150ms cubic-bezier(0.32, 0.72, 0, 1);
}

.mini-cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ========== DRAWER ========== */
.mini-cart-drawer {
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    width: 340px !important;
    max-width: 340px !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #fff;
    z-index: 10003 !important;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 150ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    border-radius: 12px 0 0 12px;
}

.mini-cart-drawer.active {
    transform: translateX(0) !important;
}

/* ========== HEADER ========== */
.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ff6000 0%, #ff8533 100%);
    color: #fff;
    flex-shrink: 0;
}

.mini-cart-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-cart-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.mini-cart-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ========== BODY / ITEMS ========== */
.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mini-cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.mini-cart-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8e8e8;
    border-top-color: #ff6000;
    border-radius: 50%;
    animation: mini-cart-spin 0.7s linear infinite;
}

@keyframes mini-cart-spin {
    to { transform: rotate(360deg); }
}

.mini-cart-items {
    padding: 0;
}

/* ========== SINGLE ITEM ========== */
.mini-cart-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.mini-cart-item:hover {
    background: #fafafa;
}

/* Image */
.mini-cart-item-image {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.mini-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

/* Info wrapper — right side of image */
.mini-cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Row 1: name + qty controls */
.mini-cart-item-row-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.mini-cart-item-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #484848;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.mini-cart-item-name:hover {
    color: #ff6000;
}

/* Variation */
.mini-cart-item-variation {
    font-size: 11px;
    color: #9b9b9b;
}

/* Quantity Controls */
.mini-cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 2px;
    height: 28px;
}

.mini-cart-qty-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    transition: all 0.2s ease;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mini-cart-qty-btn:hover {
    background: #ff6000;
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 96, 0, 0.35);
    transform: scale(1.08);
}

.mini-cart-qty-btn:active {
    transform: scale(0.95);
}

.mini-cart-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.mini-cart-qty-btn:disabled:hover {
    background: #fff;
    color: #555;
    transform: none;
    box-shadow: none;
}

.mini-cart-qty-btn.mini-cart-qty-delete {
    background: #fef2f2;
    color: #ef4444;
    font-size: 10px;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.12);
}

.mini-cart-qty-btn.mini-cart-qty-delete:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.mini-cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    line-height: 24px;
    padding: 0 2px;
    user-select: none;
}

/* Row 2: price + total + remove — single line */
.mini-cart-item-row-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-cart-item-price {
    font-size: 11px;
    font-weight: 600;
    color: #7a7a7a;
    white-space: nowrap;
}

.mini-cart-item-total {
    font-size: 13px;
    font-weight: 700;
    color: #ff6000;
    white-space: nowrap;
    margin-left: auto;
}

.mini-cart-item-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mini-cart-item-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Empty State */
.mini-cart-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #9b9b9b;
}

.mini-cart-empty i {
    font-size: 48px;
    color: #e0e0e0;
    margin-bottom: 12px;
    display: block;
}

.mini-cart-empty p {
    font-size: 14px;
    margin: 0;
}

/* ========== FOOTER ========== */
.mini-cart-footer {
    border-top: 1px solid #e8e8e8;
    padding: 14px 16px;
    background: #fff;
    flex-shrink: 0;
}

.mini-cart-totals {
    margin-bottom: 12px;
}

.mini-cart-total-row.grand {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: #484848;
}

.mini-cart-total-row.grand span:last-child {
    color: #ff6000;
}

/* Buttons */
.mini-cart-buttons {
    display: flex;
    gap: 8px;
}

.mini-cart-btn-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    background: linear-gradient(135deg, #ff6000 0%, #ff8533 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 96, 0, 0.25);
}

.mini-cart-btn-view:hover {
    background: linear-gradient(135deg, #e55500 0%, #ff6000 100%);
    color: #fff;
}

.mini-cart-btn-checkout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.mini-cart-btn-checkout:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    color: #fff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 380px) {
    .mini-cart-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}
