/**
 * Mini Cart Sidebar - Estilos Smokeria Carioca
 * Versão 3.0 - Com botões Continuar Comprando e Finalizar Compra
 */

/* ============================================
   OVERLAY
   ============================================ */

.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mini-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SIDEBAR DO CARRINHO
   ============================================ */

.mini-cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background-color: #0a0a0a;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mini-cart-sidebar.active {
    transform: translateX(0);
}

/* ============================================
   HEADER DO MINI CART
   ============================================ */

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #222;
    background-color: #111;
    flex-shrink: 0;
}

.mini-cart-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.mini-cart-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: transparent;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.mini-cart-close:hover {
    background-color: #22c55e;
    border-color: #22c55e;
    color: #000;
}

/* ============================================
   CONTEÚDO DO MINI CART
   ============================================ */

.mini-cart-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mini-cart-content::-webkit-scrollbar {
    width: 6px;
}

.mini-cart-content::-webkit-scrollbar-track {
    background-color: #111;
}

.mini-cart-content::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 3px;
}

.mini-cart-content::-webkit-scrollbar-thumb:hover {
    background-color: #22c55e;
}

/* ============================================
   LISTA DE ITEMS
   ============================================ */

.mini-cart-items {
    list-style: none;
    margin: 0;
    padding: 1rem;
    flex: 1;
}

.mini-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background-color: #111;
    border: 1px solid #222;
    border-radius: 8px;
    align-items: center;
    transition: all 0.2s ease;
}

.mini-cart-item:hover {
    border-color: #333;
}

.mini-cart-item:last-child {
    margin-bottom: 0;
}

/* Imagem do item */
.mini-cart-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #1a1a1a;
}

.mini-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart-item-image a {
    display: block;
}

/* Detalhes do item */
.mini-cart-item-details {
    flex: 1;
    min-width: 0;
}

.mini-cart-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.mini-cart-item-name a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-cart-item-name a:hover {
    color: #22c55e;
}

.mini-cart-item-qty-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.mini-cart-item-qty {
    color: #999;
}

.mini-cart-item-price {
    color: #22c55e;
    font-weight: 700;
}

/* Botão remover */
.mini-cart-item-remove {
    flex-shrink: 0;
}

.mini-cart-item-remove .remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ff4444;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
}

.mini-cart-item-remove .remove-item:hover {
    background-color: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

/* ============================================
   SUBTOTAL
   ============================================ */

.mini-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #111;
    border-top: 1px solid #222;
}

.subtotal-label {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.subtotal-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #22c55e;
}

/* ============================================
   BOTÕES - CONTINUAR COMPRANDO E FINALIZAR
   ============================================ */

.mini-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    background-color: #111;
}

.btn-continue-shopping {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    background-color: transparent;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-continue-shopping:hover {
    background-color: #1a1a1a;
    border-color: #22c55e;
    color: #22c55e;
}

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background-color: #22c55e;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-checkout:hover {
    background-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

/* ============================================
   CARRINHO VAZIO
   ============================================ */

.mini-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    flex: 1;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mini-cart-empty p {
    color: #999;
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
}

.mini-cart-empty .btn-continue-shopping {
    width: 100%;
    max-width: 250px;
}

/* ============================================
   BODY QUANDO MINI CART ESTÁ ABERTO
   ============================================ */

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

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 480px) {
    .mini-cart-sidebar {
        max-width: 100%;
    }
    
    .mini-cart-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .mini-cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .mini-cart-item-name {
        font-size: 0.8rem;
    }
    
    .mini-cart-buttons {
        padding: 1rem;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mini-cart-item {
    animation: slideInRight 0.3s ease;
}
