/**
 * BRUJAS - Tienda Esotérica
 * Estilos de la página del Carrito
 */

/* =========================================
   VARIABLES Y CONFIGURACIÓN
   ========================================= */
.cart-page {
    min-height: 60vh;
    padding-bottom: 3rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--light-purple) 50%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
    background: transparent;
}

.breadcrumb-item a {
    color: var(--primary-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--accent-gold);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* =========================================
   CARRITO VACÍO
   ========================================= */
.cart-empty {
    padding: 4rem 2rem;
}

.cart-empty .empty-icon {
    font-size: 6rem;
    color: var(--primary-purple);
    opacity: 0.5;
}

.cart-empty h2 {
    font-family: 'Cinzel', serif;
    color: #f5f5f5;
}

.cart-empty p {
    color: #e0e0e0;
}

/* =========================================
   HEADER DEL CARRITO
   ========================================= */
.cart-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #f5f5f5;
}

.cart-count-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #e0e0e0;
}

/* =========================================
   ITEMS DEL CARRITO
   ========================================= */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 1.5rem;
    align-items: center;
    background: linear-gradient(145deg, rgba(106, 27, 154, 0.1), rgba(74, 20, 140, 0.15));
    border: 1px solid rgba(106, 27, 154, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 20px rgba(106, 27, 154, 0.2);
}

/* Imagen del producto */
.item-image {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

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

/* Detalles del producto */
.item-details {
    min-width: 0;
}

.item-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item-name a:hover {
    color: var(--accent-gold);
}

.item-price {
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 0;
}

/* Control de cantidad */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-qty {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(106, 27, 154, 0.3);
    border: 1px solid rgba(106, 27, 154, 0.5);
    color: var(--text-light);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-qty:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: white;
}

.qty-input {
    width: 50px;
    height: 36px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(106, 27, 154, 0.5);
    color: var(--text-light);
    border-radius: 8px;
    font-weight: 600;
}

.qty-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Eliminar número arrows */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* Total del item */
.item-total {
    min-width: 100px;
    text-align: right;
}

.total-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

/* Botón eliminar */
.btn-remove {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #dc3545;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* =========================================
   RESUMEN DEL PEDIDO
   ========================================= */
.cart-sidebar {
    position: sticky;
    top: 100px;
}

.cart-summary {
    background: linear-gradient(145deg, rgba(106, 27, 154, 0.15), rgba(74, 20, 140, 0.2));
    border: 1px solid rgba(106, 27, 154, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
}

.summary-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--text-light);
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(106, 27, 154, 0.3);
}

.summary-details {
    padding: 1rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #e0e0e0;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 1rem;
    margin-bottom: 0;
}

.summary-row.total span:last-child {
    color: var(--accent-gold);
}

.summary-divider {
    border-color: rgba(106, 27, 154, 0.3);
    margin: 0.5rem 0;
}

/* Botones de acción */
.btn-checkout {
    background: linear-gradient(135deg, var(--accent-gold), #c9a227);
    border: none;
    color: #1a0a2e;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #e6c846, var(--accent-gold));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    color: #1a0a2e;
}

.btn-outline-mystic {
    background: transparent;
    border: 2px solid #ce93d8;
    color: #ce93d8;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-outline-mystic:hover {
    background: var(--primary-purple);
    color: white;
}

.btn-mystic {
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-mystic:hover {
    background: linear-gradient(135deg, #7b1fa2, var(--primary-purple));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(106, 27, 154, 0.4);
    color: white;
}

/* Beneficios */
.summary-benefits {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.benefit-item i {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

/* =========================================
   SECCIÓN DE DESCUENTO
   ========================================= */
.discount-section {
    background: linear-gradient(145deg, rgba(106, 27, 154, 0.1), rgba(74, 20, 140, 0.15));
    border: 1px solid rgba(106, 27, 154, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
}

.discount-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-light);
}

.discount-section .form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(106, 27, 154, 0.5);
    color: var(--text-light);
    border-radius: 8px 0 0 8px;
}

.discount-section .form-control:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-gold);
    box-shadow: none;
}

.discount-section .form-control::placeholder {
    color: var(--text-muted);
}

.btn-apply {
    background: var(--primary-purple);
    border: 1px solid var(--primary-purple);
    color: white;
    border-radius: 0 8px 8px 0;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-apply:hover {
    background: var(--dark-purple);
    color: white;
}

/* =========================================
   ANIMACIONES
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes removeItem {
    to {
        opacity: 0;
        transform: translateX(-100px);
        height: 0;
        padding: 0;
        margin: 0;
        border: 0;
    }
}

.cart-item.removing {
    animation: removeItem 0.3s ease forwards;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    .cart-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        gap: 1rem;
        padding: 1rem;
    }

    .item-image {
        width: 80px;
        height: 80px;
        grid-row: span 2;
    }

    .item-details {
        grid-column: 2;
    }

    .item-name {
        font-size: 1rem;
        white-space: normal;
    }

    .item-quantity {
        grid-column: 2;
        justify-content: flex-start;
    }

    .item-total {
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .btn-remove {
        position: absolute;
        right: 1rem;
        bottom: 1rem;
        width: 32px;
        height: 32px;
    }

    .cart-item {
        position: relative;
    }

    .cart-title {
        font-size: 1.4rem;
    }

    .cart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    .btn-qty {
        width: 32px;
        height: 32px;
    }

    .qty-input {
        width: 40px;
        height: 32px;
    }

    .cart-empty .empty-icon {
        font-size: 4rem;
    }
}
