/**
 * Frontend Utilities CSS
 * Clases reutilizables para reemplazar estilos inline
 * Usa variables CSS centralizadas de theme-variables.php
 */

/* ============================================
   PRECIOS Y DESCUENTOS
   ============================================ */

/* Precio tachado (original) */
.price-crossed {
    color: var(--text-muted, #999);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.price-crossed-sm {
    color: var(--text-muted, #999);
    text-decoration: line-through;
    font-size: 0.8rem;
}

/* Precio actual/final */
.price-current {
    color: var(--primary-color);
    font-weight: 600;
}

.price-current-lg {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Precio con descuento */
.price-discount {
    color: var(--success-color, #2e7d32);
    font-weight: 600;
}

/* ============================================
   BADGES
   ============================================ */

/* Badge genérico */
.badge-sm {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    vertical-align: middle;
}

.badge-md {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Badge de oferta */
.badge-offer {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Badge de descuento/ahorro */
.badge-discount {
    background: var(--success-bg, #e8f5e9);
    color: var(--success-color, #2e7d32);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.badge-discount-solid {
    background: var(--success-color, #2e7d32);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Badge mayorista */
.badge-wholesale {
    background: var(--success-bg, #e8f5e9);
    color: var(--success-color, #2e7d32);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

/* ============================================
   CAJAS DE INFORMACIÓN
   ============================================ */

/* Info box genérico */
.info-box {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Info box de envío gratis */
.info-box-success {
    background: var(--success-bg, #e8f5e9);
    border: 1px solid #c8e6c9;
}

.info-box-success .info-title {
    color: var(--success-color, #2e7d32);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.info-box-success .info-text {
    color: #1b5e20;
    font-size: 0.85rem;
    line-height: 1.3;
}

.info-box-success .info-icon {
    color: var(--success-color, #2e7d32);
    font-size: 1.2rem;
}

/* Info box de envío pendiente */
.info-box-warning {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
}

.info-box-warning .info-title {
    color: #e65100;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.info-box-warning .info-text {
    color: #ef6c00;
    font-size: 0.85rem;
    line-height: 1.3;
}

.info-box-warning .info-icon {
    color: #f57c00;
    font-size: 1.2rem;
}

/* ============================================
   LAYOUTS FLEX
   ============================================ */

.flex-row {
    display: flex;
    align-items: center;
}

.flex-row-start {
    display: flex;
    align-items: flex-start;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-5 {
    gap: 5px;
}

.gap-8 {
    gap: 8px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

/* ============================================
   ESPACIADO
   ============================================ */

.mt-5 {
    margin-top: 5px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.ml-5 {
    margin-left: 5px;
}

.ml-10 {
    margin-left: 10px;
}

.pt-10 {
    padding-top: 10px;
}

.pt-12 {
    padding-top: 12px;
}

.p-10 {
    padding: 10px;
}

.p-12 {
    padding: 12px;
}

.p-15 {
    padding: 15px;
}

/* ============================================
   TEXTO
   ============================================ */

.text-muted {
    color: var(--text-muted, #666);
}

.text-secondary {
    color: var(--text-secondary, #999);
}

.text-success {
    color: var(--success-color, #2e7d32);
}

.text-warning {
    color: var(--warning-color, #f57c00);
}

.text-danger {
    color: var(--danger-color, #dc3545);
}

.text-primary {
    color: var(--primary-color);
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-xxs {
    font-size: 0.7rem;
}

.text-italic {
    font-style: italic;
}

.text-bold {
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.line-height-tight {
    line-height: 1.3;
}

/* ============================================
   BORDES Y SEPARADORES
   ============================================ */

.border-top {
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.border-bottom {
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.rounded-sm {
    border-radius: 4px;
}

.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-pill {
    border-radius: 20px;
}

/* ============================================
   CART SPECIFIC
   ============================================ */

/* Item de carrito - precios */
.cart-price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Progreso de envío gratis */
.shipping-progress {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ffe0b2;
}

.shipping-progress-bar {
    height: 6px;
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: #f57c00;
    transition: width 0.3s ease;
}

/* Resumen del carrito */
.summary-row-highlight {
    font-weight: 600;
    padding: 8px 0;
    border-top: 1px solid var(--border-color, #e0e0e0);
    margin-top: 8px;
}

.summary-savings {
    background: var(--success-bg, #e8f5e9);
    padding: 12px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
}

.summary-savings-text {
    color: var(--success-color, #2e7d32);
    font-weight: 600;
}

/* Selección de envío */
.shipping-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shipping-option:hover {
    border-color: var(--primary-color);
}

.shipping-option.active {
    border-color: var(--primary-color);
    background: var(--primary-bg, #fff5f2);
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }

    .show-desktop {
        display: block !important;
    }
}

/* ============================================
   MODALES PERSONALIZADOS
   ============================================ */

.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.custom-modal-overlay.active {
    display: flex;
}

.custom-modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.custom-modal-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.custom-modal-title {
    color: var(--dark-color, #1A1A2E);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.custom-modal-message {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.custom-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-modal-cancel {
    background: #f0f0f0;
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-modal-cancel:hover {
    background: #e0e0e0;
}

/* ============================================
   OVERLAY DE PROCESAMIENTO
   ============================================ */

.checkout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.checkout-overlay.active {
    display: flex;
}

.checkout-overlay-content {
    text-align: center;
    color: #fff;
    padding: 20px;
}

.checkout-overlay-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.checkout-overlay-title {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.checkout-overlay-message {
    color: #ccc;
    margin: 0;
    font-size: 1rem;
}

/* ============================================
   SECCIONES DE PAGO
   ============================================ */

.payment-section {
    display: none;
}

.payment-section.active {
    display: block;
}

.payment-section-title {
    margin: 20px 0 15px;
    color: var(--dark-color, #1A1A2E);
    font-size: 1.05rem;
}

.payment-brick-container {
    min-height: 420px;
    max-width: 100%;
    overflow: hidden;
}

/* ============================================
   PAYMENT RESULT PAGE
   ============================================ */

.payment-result-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.payment-result-section .container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.result-container {
    background: #fff;
    border-radius: 24px;
    padding: 50px 40px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Result Icon */
.result-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: pulse 2s infinite;
}

.result-icon svg,
.result-icon i {
    width: 50px;
    height: 50px;
    font-size: 50px;
}

.result-icon.success {
    background: linear-gradient(135deg, #4CAF50 0%, #43a047 100%);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

.result-icon.success svg,
.result-icon.success i {
    color: white;
    stroke: white;
}

.result-icon.pending {
    background: linear-gradient(135deg, #FF9800 0%, #f57c00 100%);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.4);
}

.result-icon.pending svg,
.result-icon.pending i {
    color: white;
    stroke: white;
}

.result-icon.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.4);
}

.result-icon.error svg,
.result-icon.error i {
    color: white;
    stroke: white;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Title and Message */
.result-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 15px;
    line-height: 1.2;
}

.result-message {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Order Details */
.order-details {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.order-details-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.order-details-row:last-child {
    border-bottom: none;
}

.order-details-label {
    color: #666;
    font-size: 0.95rem;
}

.order-details-value {
    color: #1A1A2E;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Alert Boxes */
.alert-info-box,
.alert-warning-box {
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196F3;
    color: #1565c0;
}

.alert-info-box strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.alert-warning-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #FF9800;
    color: #e65100;
}

.alert-warning-box strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.action-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #FF6B35) 0%, #ff5722 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.action-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.action-buttons .btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.action-buttons .btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

/* Responsive */
@media (max-width: 576px) {
    .result-container {
        padding: 35px 25px;
        border-radius: 20px;
    }

    .result-title {
        font-size: 1.6rem;
    }

    .result-message {
        font-size: 1rem;
    }

    .result-icon {
        width: 80px;
        height: 80px;
    }

    .result-icon svg,
    .result-icon i {
        width: 40px;
        height: 40px;
        font-size: 40px;
    }
}

.payment-result {
    margin-top: 15px;
}

/* ============================================
   TRANSFERENCIA BANCARIA
   ============================================ */

.transfer-tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0 15px;
    flex-wrap: wrap;
}

.transfer-tab-btn {
    border: 1px solid var(--border-color, #e0e0e0);
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.transfer-tab-btn:hover,
.transfer-tab-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-bg, #fff5f2);
}

.transfer-tab-pane {
    display: none;
}

.transfer-tab-pane.active {
    display: block;
}

.transfer-amount {
    color: var(--primary-color);
    font-weight: 700;
}

.transfer-notice {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

.transfer-confirm {
    display: none;
    margin-top: 20px;
}

.transfer-confirm.active {
    display: block;
}

.transfer-confirm-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 15px 0;
    cursor: pointer;
}

.transfer-confirm-checkbox {
    width: 20px;
    height: 20px;
}

/* ============================================
   BOTONES DE RETRY/ALTERNATIVO
   ============================================ */

.payment-error-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-retry {
    padding: 10px 20px;
}

.btn-alternative {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    color: #666;
}

.btn-alternative:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* ============================================
   ELEMENTOS DE IMAGEN
   ============================================ */

.img-contain {
    object-fit: contain;
}

.img-cover {
    object-fit: cover;
}

.img-gallery-main {
    max-height: 400px;
    object-fit: contain;
}

.img-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
}

.bg-light-gray {
    background: #f8f9fa;
}

/* ============================================
   UTILIDADES ADICIONALES
   ============================================ */

.w-130 {
    width: 130px;
}

.min-h-200 {
    min-height: 200px;
}

.d-block {
    display: block;
}