﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: orange;
    min-height: 100vh;
    padding: 20px;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.content-wrapper {
    flex: 1;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: 600px;
}

.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 20px;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

    .sidebar-header h2 {
        color: black;
        font-size: 24px;
        font-weight: 700;
        margin-bottom: 5px;
    }

    .sidebar-header p {
        color: #888;
        font-size: 13px;
    }

.cart-icon-container {
    background: orange;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    position: relative;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

    .cart-icon-container i {
        font-size: 28px;
    }

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 3px solid white;
}

.cart-total {
    background: linear-gradient(135deg, #77c66d 0%, #57f559 100%);
    color: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.cart-total-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.cart-total-amount {
    font-size: 32px;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(102, 126, 234, 0.4);
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.cart-items-preview {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 10px;
}

    .cart-item-mini img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 8px;
    }

.cart-item-mini-info {
    flex: 1;
}

.cart-item-mini-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.cart-item-mini-price {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.cart-item-mini-qty {
    font-size: 11px;
    color: #888;
}

.empty-cart-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

    .empty-cart-message i {
        font-size: 48px;
        margin-bottom: 15px;
        opacity: 0.5;
    }

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column-reverse;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
}
/* ===== MODO CELULAR - CARRITO COLAPSADO ===== */
@media (max-width: 768px) {

    .cart-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 65px;
        height: 65px;
        border-radius: 50%;
        background: #ff9d00;
        z-index: 999;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border: 3px solid orange;
    }

        
            /* Ocultamos todo menos el icono */
            .cart-container .sidebar h2,
            .cart-container .sidebar p,
            .cart-container .cart-total,
            .cart-container .btn-primary,
            .cart-container .cart-items-preview {
                display: none;
            }

    /* Mostramos solo el icono */
    .cart-icon-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

        .cart-icon-container i {
            font-size: 22px;
            color: orange;
        }
    .cart-container.open .sidebar h2,
    .cart-container.open .sidebar p,
    .cart-container.open .cart-total,
    .cart-container.open .btn-primary,
    .cart-container.open .cart-items-preview {
        display: block;
    }

    .cart-container.open .cart-icon-container i {
        color: black;
    }

    .cart-count {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 15px;
        background: red;
        color: white;
        border-radius: 50%;
        padding: 2px 6px;
    }

    /* ===== ESTADO ABIERTO ===== */
    .cart-container.open {
        width: 90%;
        height: auto;
        border-radius: 20px;
        padding: 20px;
        background: white;
        align-items: flex-start;
        justify-content: flex-start;
    }

        .cart-container.open .sidebar {
            display: block;
            width: 100%;
        }

        .cart-container.open .cart-icon-container i {
            color: black;
        }
    .sidebar-header{
        margin-bottom: 0px;
        padding-bottom: 0px;
    }
}