/* ===== ESTILOS ÚNICOS PARA SIDECAR - PREFIJO "sc-" ===== */

/* Variables específicas para sidecar */
:root {
    --sc-primary: #015e31;
    --sc-secondary: #0038a8;
    --sc-accent: #ffcc00;
    --sc-danger: #cb0000;
    --sc-success: #28a745;
    --sc-warning: #f45a10;
    --sc-text-light: #fdf6f3;
    --sc-text-dark: #333;
    --sc-gray-light: #f8f9fa;
    --sc-gray-medium: #6c757d;
    --sc-shadow: 0 4px 15px rgba(0,0,0,0.1);
    --sc-border-radius: 8px;
}

/* Sidebar Principal */
.sc-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1060;
    transition: right 0.3s ease;
}

.sc-sidebar.show {
    right: 0;
}

.sc-sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header del Sidebar */
.sc-sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--sc-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, var(--sc-primary), var(--sc-secondary));
    color: var(--sc-text-light);
}

.sc-sidebar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sc-icon {
    font-size: 1.3rem;
}

.sc-badge {
    background: var(--sc-accent);
    color: var(--sc-text-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Botón Cerrar */
.sc-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

.sc-btn-close {
    width: 35px;
    height: 35px;
    background: var(--sc-text-light);
    color: var(--sc-primary);
    border: 2px solid var(--sc-primary);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sc-btn-close:hover {
    background: var(--sc-primary);
    color: var(--sc-text-light);
    transform: scale(1.1);
}

/* Body del Sidebar */
.sc-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--sc-gray-light);
}

/* Item del Carrito - NUEVO LAYOUT */
.sc-item-detailed {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: var(--sc-border-radius);
    margin-bottom: 10px;
    box-shadow: var(--sc-shadow);
    border-left: 4px solid var(--sc-primary);
    position: relative;
}

/* Contenedor de Imagen */
.sc-item-image-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid var(--sc-gray-light);
}

.sc-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Contenido del Item */
.sc-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sc-item-info {
    flex: 1;
}

.sc-product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sc-text-dark);
    margin-bottom: 5px;
    line-height: 1.3;
}

.sc-product-description {
    color: var(--sc-gray-medium);
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.sc-product-price {
    font-size: 14px;
    color: var(--sc-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.sc-stock-info {
    font-size: 12px;
    color: var(--sc-gray-medium);
    margin: 0;
}

/* Controles */
.sc-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-top: 10px;
}

.sc-quantity-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.sc-quantity-label {
    font-size: 12px;
    color: var(--sc-gray-medium);
    font-weight: 500;
}

.sc-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sc-gray-light);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.sc-quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--sc-text-dark);
}

.sc-quantity-btn:hover:not(:disabled) {
    background: var(--sc-primary);
    color: white;
    border-color: var(--sc-primary);
}

.sc-quantity-btn:disabled {
    background: var(--sc-gray-light);
    color: #ccc;
    cursor: not-allowed;
}

.sc-quantity-input {
    width: 50px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--sc-text-dark);
}

.sc-quantity-input:focus {
    outline: none;
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 2px rgba(1, 94, 49, 0.25);
}

/* Total del Item */
.sc-item-total-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    margin-top: 5px;
}

.sc-total-label {
    font-size: 12px;
    color: var(--sc-gray-medium);
    font-weight: 500;
}

.sc-item-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--sc-primary);
}

/* Acciones */
.sc-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    position: absolute;
    right: 15px;
    top: 15px;
}

.sc-favorite-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #ccc;
}

.sc-favorite-btn:hover {
    border-color: var(--sc-danger);
    color: var(--sc-danger);
    transform: scale(1.1);
}

.sc-favorite-btn.active {
    background: var(--sc-danger);
    border-color: var(--sc-danger);
    color: white;
}

.sc-remove-btn {
    width: 36px;
    height: 36px;
    background: var(--sc-danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Carrito Vacío */
.sc-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.sc-empty-icon {
    font-size: 4rem;
    color: var(--sc-gray-medium);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.sc-empty-text {
    color: var(--sc-gray-medium);
    font-size: 1.1rem;
    margin: 0;
}

/* Footer del Sidebar */
.sc-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    background: white;
}

.sc-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.sc-cart-total {
    font-size: 1.3rem;
    color: var(--sc-primary);
    font-weight: 700;
    flex-shrink: 0;
}

.sc-footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    max-width: 250px;
}

.sc-login-title {
    text-align: center;
    color: var(--sc-text-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Botones */
.sc-btn {
    padding: 10px 15px;
    border: none;
    border-radius: var(--sc-border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-btn-primary {
    background: linear-gradient(135deg, var(--sc-primary), var(--sc-secondary));
    color: white;
}

.sc-btn-primary:hover {
    background: linear-gradient(135deg, var(--sc-secondary), var(--sc-primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
}

.sc-btn-outline {
    background: transparent;
    border: 2px solid var(--sc-primary);
    color: var(--sc-primary);
}

.sc-btn-outline:hover {
    background: var(--sc-primary);
    color: white;
    transform: translateY(-2px);
}

.sc-btn-full {
    width: 100%;
}

.sc-btn-icon {
    font-size: 1rem;
}

/* Overlay */
.sc-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1055;
    display: none;
}

.sc-sidebar-overlay.show {
    display: block;
}

/* Responsive */
@media (max-width: 576px) {
    .sc-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .sc-item-detailed {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        padding-bottom: 60px;
    }
    
    .sc-item-image-container {
        align-self: center;
    }
    
    .sc-item-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .sc-item-actions {
        position: absolute;
        bottom: 15px;
        right: 15px;
        top: auto;
        flex-direction: row;
    }
    
    .sc-sidebar-header {
        padding: 1rem;
    }
    
    .sc-sidebar-body {
        padding: 0.5rem;
    }
    
    .sc-footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .sc-cart-total {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .sc-footer-buttons {
        max-width: 100%;
    }
}

/* Scrollbar personalizado */
.sc-sidebar-body::-webkit-scrollbar {
    width: 6px;
}

.sc-sidebar-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sc-sidebar-body::-webkit-scrollbar-thumb {
    background: var(--sc-primary);
    border-radius: 3px;
}

.sc-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: var(--sc-secondary);
}