/* ============================================
   SHOPPING CART & CHECKOUT STYLES
   Estilos para Carrito y Sistema de Pago
   ============================================ */

/* ============================================
   BOTÓN FLOTANTE DEL CARRITO
   ============================================ */
.floating-cart-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-cart-button:hover {
    transform: scale(1.1);
    background: var(--accent-color);
}

.floating-cart-button .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   BOTÓN AGREGAR AL CARRITO
   ============================================ */
.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.add-to-cart-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.add-to-cart-btn.added {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

/* ============================================
   MODAL DEL CARRITO
   ============================================ */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal.show {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    opacity: 1;
}

.cart-modal-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.cart-modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal-header h2 {
    font-size: 24px;
    margin: 0;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
    transition: var(--transition);
}

.cart-close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================
   CARRITO VACÍO
   ============================================ */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
}

.cart-empty svg {
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 18px;
    margin-bottom: 20px;
}

.continue-shopping-btn {
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.continue-shopping-btn:hover {
    background: var(--accent-color);
}

/* ============================================
   ITEMS DEL CARRITO
   ============================================ */
.cart-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid var(--light-gray);
}

.cart-item-image {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    background: var(--light-gray);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.cart-item-subtotal {
    font-size: 16px;
    font-weight: 600;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.cart-item-remove:hover {
    transform: scale(1.1);
}

/* ============================================
   FOOTER DEL CARRITO
   ============================================ */
.cart-modal-footer {
    padding: 20px;
    border-top: 2px solid var(--light-gray);
    background: var(--secondary-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.cart-total-amount {
    font-size: 24px;
    color: var(--primary-color);
}

.cart-checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.cart-checkout-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   MODAL DE CHECKOUT
   ============================================ */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.checkout-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.checkout-modal-content {
    background: var(--white);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.checkout-header {
    padding: 25px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.checkout-header h2 {
    font-size: 26px;
    margin: 0;
}

.checkout-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
    transition: var(--transition);
}

.checkout-close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.checkout-body {
    padding: 30px;
}

/* ============================================
   PASOS DEL CHECKOUT
   ============================================ */
.checkout-step {
    display: none;
}

.checkout-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.checkout-step h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* ============================================
   FORMULARIO
   ============================================ */
.checkout-form .form-group {
    margin-bottom: 20px;
}

.checkout-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-gray);
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: var(--transition);
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkout-continue-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-continue-btn:hover {
    background: var(--accent-color);
}

/* ============================================
   RESUMEN DE ORDEN
   ============================================ */
.order-summary {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.order-summary h4 {
    font-size: 18px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 600;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--primary-color);
}

/* ============================================
   MÉTODOS DE PAGO
   ============================================ */
.payment-methods h4 {
    font-size: 18px;
    margin-bottom: 15px;
}

.payment-method-option {
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-method-option:hover {
    border-color: var(--accent-color);
}

.payment-method-option input[type="radio"] {
    display: none;
}

.payment-method-option input[type="radio"]:checked + label {
    color: var(--primary-color);
}

.payment-method-option input[type="radio"]:checked ~ .payment-method-option {
    border-color: var(--primary-color);
    background: rgba(139, 115, 85, 0.05);
}

.payment-method-option label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.payment-method-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.payment-method-info {
    flex: 1;
}

.payment-method-info strong {
    display: block;
    font-size: 16px;
    margin-bottom: 3px;
}

.payment-method-info span {
    font-size: 13px;
    color: #666;
}

/* ============================================
   ACCIONES DEL CHECKOUT
   ============================================ */
.checkout-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.checkout-back-btn,
.checkout-pay-btn {
    flex: 1;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-back-btn {
    background: var(--light-gray);
    color: var(--text-color);
}

.checkout-back-btn:hover {
    background: #ddd;
}

.checkout-pay-btn {
    background: var(--primary-color);
    color: white;
}

.checkout-pay-btn:hover {
    background: var(--accent-color);
}

/* ============================================
   PROCESANDO
   ============================================ */
.checkout-processing {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.checkout-processing h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.checkout-processing p {
    color: #666;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */
.cart-notification,
.checkout-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10003;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.cart-notification.show,
.checkout-notification.show {
    transform: translateX(0);
}

.cart-notification.error,
.checkout-notification.error {
    background: #e74c3c;
}

.cart-notification.success,
.checkout-notification.success {
    background: #27ae60;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .floating-cart-button {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .cart-modal-content,
    .checkout-modal-content {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .checkout-actions {
        flex-direction: column;
    }

    .payment-method-option label {
        flex-direction: column;
        text-align: center;
    }
}