/* ===== RESET DE ESPACIOS NO DESEADOS ===== */
body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333333;
}

#header-container {
    margin: 0;
    padding: 0;
}

/* ===== VARIABLES ===== */
:root {
    --color-primary: #3483fa;
    --color-primary-dark: #2968c8;
    --color-success: #00a650;
    --color-warning: #ff7733;
    --color-danger: #f44336;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #dddddd;
    --color-bg-light: #f8f9fa;
    --color-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.pagina-carrito.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.pagina-carrito .row {
    margin-left: -15px;
    margin-right: -15px;
    margin-top: 0 !important;
}

/* ===== HEADER DEL CARRITO ===== */
.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--color-border);
    margin-top: 0;
}

.titulo-carrito {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

#contador-items {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
}

/* ===== LISTA DE PRODUCTOS ===== */
.lista-carrito {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cart-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    transition: all 0.3s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    margin-right: 20px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-item-content {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--color-text);
    line-height: 1.3;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    background: var(--color-bg-light);
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e8e8e8;
}

.quantity-display {
    width: 40px;
    height: 32px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    font-weight: 500;
    font-size: 14px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.remove-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.cart-item-subtotal {
    text-align: right;
    min-width: 100px;
}

.subtotal-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

/* ===== CARRITO VACÍO ===== */
.carrito-vacio {
    text-align: center;
    padding: 60px 20px;
}

.carrito-vacio i {
    font-size: 64px;
    color: var(--color-border);
    margin-bottom: 20px;
}

.carrito-vacio h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--color-text-light);
}

.carrito-vacio p {
    color: var(--color-text-light);
    margin-bottom: 25px;
}

.btn-ir-tienda {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-ir-tienda:hover {
    background-color: var(--color-primary-dark);
    color: white;
}

/* ===== RESUMEN DEL CARRITO ===== */
.resumen-carrito {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    top: 90px;
}

.resumen-titulo {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.resumen-detalles {
    margin-bottom: 20px;
}

.resumen-linea {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.resumen-linea.descuento {
    color: var(--color-success);
}

.resumen-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 18px;
    border-top: 2px solid var(--color-border);
    padding-top: 15px;
    margin-top: 15px;
}

.beneficios-envio {
    background: var(--color-bg-light);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.beneficios-envio p {
    margin-bottom: 8px;
    font-size: 14px;
}

.beneficios-envio p:last-child {
    margin-bottom: 0;
}

.btn-finalizar-compra {
    width: 100%;
    padding: 16px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-finalizar-compra:hover {
    background-color: var(--color-primary-dark);
}

.btn-finalizar-compra:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ===== ACCIONES DEL CARRITO ===== */
.acciones-carrito {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* ===== FORMULARIO DE COMPRA ===== */
.formulario-compra {
    margin-top: 40px;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-border);
    z-index: 1;
}

.progress-step {
    position: relative;
    z-index: 2;
    background: white;
    padding: 8px 16px;
    border: 2px solid var(--color-border);
    border-radius: 20px;
    font-weight: 500;
}

.progress-step.active {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: white;
}

.formulario-seccion {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.formulario-seccion h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.empresa-options .form-check,
.metodo-pago-options .form-check {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

.empresa-options .form-check:hover,
.metodo-pago-options .form-check:hover {
    border-color: var(--color-primary);
}

.datos-tarjeta {
    display: none;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.resumen-final {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    top: 90px;
}

.resumen-final h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.btn-confirmar-compra {
    width: 100%;
    padding: 16px;
    background-color: var(--color-success);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.btn-confirmar-compra:hover {
    background-color: #008a43;
}

/* ===== CONFIRMACIÓN ===== */
.confirmacion-compra {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 60px 40px;
    margin: 40px 0;
}

/* ===== ANIMACIONES ===== */
.cart-item.removing {
    opacity: 0;
    transform: translateX(-100%);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ===== BOTÓN VOLVER ===== */
.btn-volver {
    margin-top: 10px;
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .resumen-carrito,
    .resumen-final {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .cart-item-image {
        margin-right: 0;
        margin-bottom: 15px;
        align-self: center;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    
    .cart-item-subtotal {
        margin-left: 0;
        text-align: left;
        margin-top: 15px;
        width: 100%;
    }
    
    .acciones-carrito {
        flex-direction: column;
    }
    
    .progress-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .progress-step {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .carrito-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px 0;
    }
    
    .quantity-controls {
        width: 100%;
        justify-content: center;
    }
    
    .formulario-seccion {
        padding: 16px;
    }
    
    .btn-volver {
        margin-top: 5px;
    }
}

/* ===== ESTILOS MEJORADOS PARA PRODUCTOS DE SUBASTA ===== */
.item-subasta {
    background-color: #fffaf0;
    border-left: 4px solid #ffc107;
    position: relative;
}

.item-subasta::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-left: 20px solid transparent;
    border-top: 20px solid #ffc107;
}

.item-subasta::after {
    content: '🎉';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    z-index: 2;
}

.item-subasta .cart-item-title {
    color: #d35400;
    font-weight: 600;
}

.item-subasta .cart-item-price {
    color: #27ae60;
    font-size: 1.2rem;
    font-weight: 700;
}

.item-subasta .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    font-weight: 600;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-size: 0.75rem;
}

.item-subasta .quantity-display {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.item-subasta .remove-btn:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Mejoras para el mensaje de información */
.item-subasta .text-muted {
    color: #7d6608 !important;
    font-style: italic;
}

/* Estilo para el placeholder de imágenes */
.cart-item-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .item-subasta {
        padding-left: 8px;
    }
    
    .item-subasta::before {
        border-left: 15px solid transparent;
        border-top: 15px solid #ffc107;
    }
    
    .item-subasta::after {
        font-size: 10px;
    }
}

/* Estilos para el mensaje de productos de subasta en el resumen */
.resumen-subasta-info {
    background-color: #fffaf0;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: 12px;
    margin-top: 15px;
}

.resumen-subasta-info h5 {
    color: #d35400;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.resumen-subasta-info p {
    color: #7d6608;
    font-size: 0.8rem;
    margin-bottom: 0;
}
/* Estilos del Panel Administrativo */
.admin-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.admin-panel-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-panel-content h3 {
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.admin-input, .admin-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.admin-input:focus, .admin-select:focus {
    outline: none;
    border-color: #007bff;
}

.admin-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    margin-bottom: 20px;
    display: none;
}

.admin-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.admin-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-btn {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-btn-danger {
    background: #dc3545;
    color: white;
}

.admin-btn-danger:hover {
    background: #c82333;
}

.admin-btn-secondary {
    background: #6c757d;
    color: white;
}

.admin-btn-secondary:hover {
    background: #5a6268;
}

.admin-message {
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-weight: 500;
}

.admin-toggle-btn {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.admin-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-panel-content {
        width: 95%;
        padding: 20px;
    }
    
    .admin-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== INFORMACIÓN DE STOCK ===== */
.stock-info {
    margin-bottom: 8px;
}

.stock-info .text-muted {
    font-size: 0.8rem;
    color: #666;
}

.stock-info .stock-bajo {
    color: #dc3545;
    font-weight: 600;
}

.stock-info .stock-agotado {
    color: #dc3545;
    font-weight: 700;
    background-color: #ffe6e6;
    padding: 2px 6px;
    border-radius: 4px;
}