/* ======================= HEADER ======================= */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    background: linear-gradient(135deg, #ffffff, #f1f3f5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.header-container .navbar {
    padding: 1rem 0.5rem;
    font-size: 1.1rem;
}

.header-container .navbar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.header-container .navbar-brand img {
    width: 100px !important;
}

.header-container .nav-link {
    color: #2d3436 !important;
    font-weight: 500;
    font-size: 1.2rem;
    padding: 12px 15px;
    position: relative;
    transition: all 0.3s ease;
}

.header-container .nav-link:hover {
    color: #0984e3 !important;
    transform: translateY(-2px) scale(1.02);
}

.header-container .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #0984e3;
    transition: width 0.3s ease, left 0.3s ease;
}

.header-container .nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* ======================= BOTONES ======================= */
.header-container .btn-outline-custom {
    color: #0984e3;
    border: 2px solid #0984e3;
    border-radius: 25px;
    font-weight: 500;
    padding: 6px 15px;
    transition: all 0.3s ease;
}

.header-container .btn-outline-custom:hover {
    background: #0984e3;
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.header-container .btn-danger {
    background: #d63031;
    border-radius: 25px;
    font-weight: 500;
    padding: 6px 15px;
}

.header-container .btn-danger:hover {
    background: #b71c1c;
}

.header-container .btn-perfil {
    background: #f39c12;
    color: #fff !important;
    font-weight: 600;
    border-radius: 25px;
    padding: 6px 15px;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    transition: all 0.3s ease;
}

.header-container .btn-perfil:hover {
    background: #d35400;
    transform: scale(1.05);
}

/* ======================= CARRITO ======================= */
.carrito-boton {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #0984e3;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
}

.carrito-boton:hover {
    transform: scale(1.1);
    color: #0652dd;
}

.contador-carrito {
    position: absolute;
    top: -10px;
    right: -12px;
    font-size: 0.8rem;
    padding: 4px 7px;
    background: #e84393;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.carrito-boton:hover .contador-carrito {
    transform: scale(1.2);
}

/* Contenedor principal del carrito */
#carrito {
    position: fixed;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1051;
    overflow-y: auto;
    padding: 15px;
    display: none;
}

#carrito.carrito-visible {
    transform: translateY(0) !important;
    opacity: 1;
    display: block;
}

#carrito.carrito-hidden {
    transform: translateY(20px) !important;
    opacity: 0;
    display: none;
}

/* Encabezado del carrito */
.carrito-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.carrito-header .carrito-logo {
    width: 50px;
    transition: transform 0.3s ease;
}

.carrito-header:hover .carrito-logo {
    transform: rotate(10deg) scale(1.1);
}

.carrito-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3436;
    margin: 0;
}

/* Items del carrito */
.carrito-item {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.carrito-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carrito-item img {
    max-width: 60px;
    border-radius: 6px;
}

.carrito-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
    text-align: center;
    margin: 15px 0;
}

/* Botones del carrito */
.btn-vaciar, .btn-pagar, .menos-cantidad, .mas-cantidad, .eliminar-producto {
    border-radius: 50px;
    padding: 8px 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-vaciar, .btn-pagar {
    width: 48%;
}

.btn-vaciar {
    background: #dc3545;
    color: #fff;
    border: 2px solid #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-vaciar:hover {
    background: #c82333;
    border-color: #b21f2d;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.btn-vaciar i {
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.btn-vaciar:hover i {
    color: #ffe6e6;
    transform: rotate(-10deg) scale(1.1);
}

.btn-pagar {
    background: #0984e3;
    color: #fff;
    border: 2px solid #0984e3;
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.btn-pagar:hover {
    background: #0652dd;
    border-color: #0541b0;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(9, 132, 227, 0.4);
}

.btn-pagar i {
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.btn-pagar:hover i {
    color: #d6eaff;
    transform: rotate(10deg) scale(1.1);
}

.menos-cantidad, .mas-cantidad {
    padding: 6px 10px;
    font-size: 0.9rem;
    background: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
}

.menos-cantidad:hover, .mas-cantidad:hover {
    background: #5a6268;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.eliminar-producto {
    padding: 6px 10px;
    font-size: 0.9rem;
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
}

.eliminar-producto:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Overlay para cerrar carrito */
.carrito-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.carrito-overlay.d-none {
    display: none;
}

.carrito-overlay:not(.d-none) {
    opacity: 1;
}

/* ======================= FOOTER ======================= */
.footer-container {
    background: #212529;
    color: #fff;
    text-align: center;
}

.footer-container h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-container p,
.footer-container a {
    font-size: 0.95rem;
    color: #f1f1f1;
}

.footer-container a:hover {
    color: #0d6efd;
}

.footer-container svg {
    margin-right: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.footer-container svg:hover {
    transform: scale(1.2);
    color: #0d6efd;
}

.footer-container hr {
    border-color: rgba(255, 255, 255, 0.2);
}

.footer-container .btn-link {
    text-decoration: underline;
    color: #fff;
}

.footer-container .btn-link:hover {
    color: #0d6efd;
}

/* ======================= GLOBAL ======================= */
body {
    padding-top: 80px;
}

/* ======================= RESPONSIVE ======================= */
/* Móvil: carrito debajo del botón, ancho completo */
@media (max-width: 991px) {
    .header-container .d-flex.align-items-center.d-lg-none {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #carrito {
        width: 100%;
        max-width: none;
        top: 80px; /* Justo debajo del header fijo */
        left: 0;
        right: 0;
        height: auto;
        max-height: 60vh;
        border-radius: 12px;
        padding: 15px;
    }
}

/* Escritorio: carrito debajo del botón, ancho fijo */
@media (min-width: 992px) {
    .carrito-boton {
        margin-left: 10px;
    }

    #carrito {
        width: 400px;
        max-width: 90%;
        top: 80px; /* Justo debajo del header fijo */
        height: auto;
        max-height: 60vh;
        border-radius: 12px;
        background: linear-gradient(145deg, #ffffff, #f8f9fa);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        padding: 15px;
    }
}