/* Estilos para el Carrito de Compras - GEMAPLUS */

/* Variables de color del proyecto */
:root {
    --gema-color-primary: #007bff;
    --gema-color-text: #2f4157;
    --gema-color-botton: #a0896b;
    --gema-bg-light: #f8f9fa;
    --gema-border: #dee2e6;
}

/* Layout general del carrito */
.cart-container {
    min-height: 70vh;
}

/* Elementos del carrito */
.cart-item {
    transition: all 0.3s ease;
    position: relative;
}

.cart-item:hover {
    background-color: var(--gema-bg-light);
    transform: translateY(-1px);
}

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

/* Imágenes de productos */
.cart-item img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.cart-item:hover img {
    transform: scale(1.05);
}

/* Botones de cantidad */
.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gema-border);
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background-color: var(--gema-color-botton);
    border-color: var(--gema-color-botton);
    color: white;
    transform: scale(1.1);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-value {
    min-width: 40px;
    font-size: 16px;
    color: var(--gema-color-text);
}

/* Precios */
.product-price {
    font-size: 1.2rem;
    color: var(--gema-color-botton) !important;
    font-weight: 600;
}

/* Botón eliminar */
.remove-item {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Resumen de compra */
.sticky-top {
    position: sticky;
    top: 2rem !important;
    z-index: 10;
}

.card-header {
    background: var(--gema-color-botton) !important;
    border: none;
}

/* Input de código de descuento */
#discount-code {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

#apply-discount {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.btn-original {
    background: var(--gema-color-botton) !important;
    border: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    color: white !important;
}

.btn-original:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

/* Botón de checkout */
#checkout-btn {
    background: var(--gema-color-botton);
    border: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

/* Estado vacío del carrito */
.empty-cart-state {
    padding: 4rem 2rem;
}

.empty-cart-state i {
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

/* Productos sugeridos */
.suggested-product {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem;
}

.suggested-product:hover {
    background-color: var(--gema-bg-light);
    transform: translateX(5px);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item {
    animation: fadeInUp 0.5s ease-out;
}

.cart-summary {
    animation: slideInRight 0.5s ease-out;
}

/* Loading spinner para acciones */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--gema-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Notificaciones toast */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 767px) {
    .cart-item .row {
        --bs-gutter-x: 0.5rem;
    }

    .cart-item .col-3,
    .cart-item .col-9 {
        margin-bottom: 1rem;
    }

    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .sticky-top {
        position: relative !important;
        top: auto !important;
    }

    .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 575px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .cart-item {
        padding: 1rem !important;
    }

    .card-header h2 {
        font-size: 1.25rem;
    }

    .empty-cart-state {
        padding: 2rem 1rem;
    }
}

/* Estados de interacción */
.cart-item.removing {
    opacity: 0.5;
    transform: translateX(-100%);
    transition: all 0.5s ease;
}

.cart-item.updating {
    opacity: 0.7;
}

/* Indicador de cambios no guardados */
.unsaved-changes {
    border-left: 4px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

/* Botones principales del carrito */
.btn-primary {
    background: var(--gema-color-botton);
    border-color: var(--gema-color-botton);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #8b755a;
    border-color: #8b755a;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--gema-color-botton);
    border-color: var(--gema-color-botton);
}

.btn-outline-primary:hover {
    background-color: var(--gema-color-botton);
    border-color: var(--gema-color-botton);
}

/* Cards del carrito */
.card {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Mejoras visuales */
.text-primary {
    color: var(--gema-color-botton) !important;
}

.bg-primary {
    background: var(--gema-color-botton) !important;
}

/* ===== ESTILOS PARA EL VOUCHER DE PAGO ===== */

/* Container principal del voucher */
.voucher-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header de éxito */
.voucher-success-header .success-icon {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Comprobante/Recibo */
.voucher-receipt {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.voucher-receipt::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--gema-color-primary), var(--gema-color-botton));
    border-radius: 12px;
    z-index: -1;
    opacity: 0.1;
}

/* Header del voucher */
.voucher-header {
    border-bottom: 2px dashed #dee2e6;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

/* Títulos de secciones */
.voucher-section-title {
    color: var(--gema-color-text);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f8f9fa;
}

/* Grupos de información */
.info-group {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    min-width: 140px;
}

.info-value {
    font-weight: 500;
    color: var(--gema-color-text);
    text-align: right;
    flex: 1;
}

/* Tabla del voucher */
.voucher-table {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.voucher-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--gema-color-text);
    padding: 1rem 0.75rem;
}

.voucher-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    vertical-align: middle;
}

.voucher-table .voucher-subtotal,
.voucher-table .voucher-discount,
.voucher-table .voucher-tax {
    background-color: #f8f9fa;
}

.voucher-table .voucher-total {
    background-color: #e3f2fd;
    border-top: 2px solid var(--gema-color-primary);
}

.voucher-table .voucher-total td {
    font-size: 1.1rem;
    padding: 1.25rem 0.75rem;
}

/* Imagen del producto en voucher */
.voucher-product-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Notas del voucher */
.voucher-notes-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.voucher-notes-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.voucher-notes-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--gema-color-primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* QR Code placeholder */
.qr-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* Footer del voucher */
.voucher-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Acciones del voucher */
.voucher-actions {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.voucher-actions .btn {
    min-width: 180px;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
}

/* Sección de nueva compra */
.new-purchase-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

/* Responsive para voucher */
@media (max-width: 768px) {
    .voucher-receipt {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .info-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }

    .info-value {
        text-align: left;
    }

    .voucher-table {
        font-size: 0.85rem;
    }

    .voucher-table th,
    .voucher-table td {
        padding: 0.75rem 0.5rem;
    }

    .voucher-product-img {
        width: 40px;
        height: 40px;
    }

    .voucher-actions .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .voucher-actions .btn:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .voucher-container {
        padding: 0 0.5rem;
    }

    .voucher-receipt {
        padding: 1rem;
    }

    .voucher-success-header .success-icon {
        font-size: 3rem !important;
    }

    .voucher-table th,
    .voucher-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}

/* Print styles para el voucher */
@media print {

    .voucher-actions,
    .new-purchase-section,
    .step-navigation,
    .checkout-header {
        display: none !important;
    }

    .voucher-receipt {
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 1rem;
    }

    .voucher-container {
        max-width: none;
        margin: 0;
    }

    body {
        background: white !important;
    }
}

/* ===== TRANSICIONES Y LAYOUT RESPONSIVO ===== */

/* Transiciones suaves para el resumen lateral */
#order-summary-container {
    transition: all 0.3s ease-in-out;
}

#main-content-column {
    transition: all 0.3s ease-in-out;
}

/* Voucher en ancho completo */
.voucher-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Asegurar que el voucher use todo el ancho disponible */
.checkout-step#step-5 {
    width: 100%;
}

/* Mejorar el espaciado cuando el resumen está oculto */
.checkout-step#step-5 .voucher-container {
    padding: 0 1rem;
}

@media (min-width: 992px) {
    .checkout-step#step-5 .voucher-container {
        padding: 0 2rem;
    }
}

