:root {
    /* Colores principales */
    --primary-color: #c62828;
    --primary-dark: #a71c1c;
    --primary-light: #ff5f52;
    
    --secondary-color: #ff9800;
    --secondary-dark: #e68900;
    --secondary-light: #ffb74d;
    
    /* Colores neutros */
    --dark-color: #333333;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #343a40;
    
    /* Colores de estado */
    --success-color: #28a745;
    --success-light: #d4edda;
    --success-dark: #155724;
    
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --warning-dark: #856404;
    
    --danger-color: #dc3545;
    --danger-light: #f8d7da;
    --danger-dark: #721c24;
    
    --info-color: #17a2b8;
    --info-light: #d1ecf1;
    --info-dark: #0c5460;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    
    /* Bordes */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 20px;
    
    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Tipografía */
    --font-family-primary: 'Roboto', sans-serif;
    --font-family-secondary: 'Poppins', sans-serif;
    
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    --font-size-xxxl: 48px;
}

/* Asegurar codificación UTF-8 */
@charset "UTF-8";

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%; /* Base para rem */
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: white;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Tipografía - Mejorado para acentos */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-secondary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    text-rendering: optimizeLegibility; /* Mejora la legibilidad */
}

h1 {
    font-size: var(--font-size-xxxl);
}

h2 {
    font-size: var(--font-size-xxl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* Botones */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--border-radius);
    font-family: var(--font-family-secondary);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: var(--font-size);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-lg);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-xxl);
    font-size: var(--font-size-lg);
}

.btn-block {
    display: block;
    width: 100%;
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Header */
.header {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    min-height: 80px; /* Altura mínima */
}

.logo h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 700; /* Más peso para el logo */
}

.logo p {
    font-size: var(--font-size-sm);
    color: var(--gray-color);
    margin-bottom: 0;
}

.nav {
    display: flex;
    gap: var(--spacing-xl);
    align-items: center;
}

.nav a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.nav a i {
    font-size: var(--font-size-lg);
}

.cart-icon {
    position: relative;
}

.cart-icon a {
    color: var(--dark-color);
    font-size: var(--font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.cart-icon a:hover {
    background-color: var(--gray-light);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section - Mejorado */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: var(--spacing-xxl) 0;
    text-align: center;
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h2 {
    font-size: var(--font-size-xxxl);
    margin-bottom: var(--spacing-lg);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
}

/* Secciones comunes */
section {
    padding: var(--spacing-xxl) 0;
}

section h2 {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
    color: var(--dark-color);
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: var(--spacing-md) auto;
}

/* Categorías */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.category-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 1px solid var(--gray-light);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.category-card i {
    font-size: var(--font-size-xxxl);
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    transition: transform 0.3s;
}

.category-card:hover i {
    transform: scale(1.1);
}

.category-card h3 {
    margin-bottom: var(--spacing-sm);
}

/* Productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 1px solid var(--gray-light);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-image {
    height: 200px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xxxl);
    color: var(--gray-color);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: var(--spacing-lg);
}

.product-price {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    font-weight: bold;
    margin: var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-price .old-price {
    font-size: var(--font-size);
    color: var(--gray-color);
    text-decoration: line-through;
    font-weight: normal;
}

.stock-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-sm);
    font-weight: bold;
    margin-bottom: var(--spacing-md);
}

.in-stock {
    background-color: var(--success-light);
    color: var(--success-dark);
}

.low-stock {
    background-color: var(--warning-light);
    color: var(--warning-dark);
}

.out-of-stock {
    background-color: var(--danger-light);
    color: var(--danger-dark);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: var(--spacing-xxl) 0 0;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--spacing-lg);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section a {
    display: block;
    color: var(--gray-light);
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s;
    padding: var(--spacing-xs) 0;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.payment-methods {
    display: flex;
    gap: var(--spacing-md);
    font-size: var(--font-size-xl);
    color: var(--gray-light);
    flex-wrap: wrap;
}

.payment-methods i {
    transition: all 0.3s;
}

.payment-methods i:hover {
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xxl);
    border-top: 1px solid var(--gray-dark);
    color: var(--gray-color);
    font-size: var(--font-size-sm);
}

/* Formularios */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: var(--font-size);
    font-family: var(--font-family-primary);
    transition: all 0.3s;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Mejor scroll en móviles */
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: rgba(198, 40, 40, 0.05);
}

/* Alertas y notificaciones */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert i {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.alert-success {
    background-color: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--warning-dark);
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.alert-info {
    background-color: var(--info-light);
    border-color: var(--info-color);
    color: var(--info-dark);
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilidades mejoradas */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-xxl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-xxl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }
.p-5 { padding: var(--spacing-xxl); }

.d-none { display: none !important; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }
.gap-4 { gap: var(--spacing-xl); }
.gap-5 { gap: var(--spacing-xxl); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Accesibilidad */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para accesibilidad */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-sm);
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-md);
        width: 100%;
    }
    
    .nav a {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .hero {
        min-height: 60vh;
        padding: var(--spacing-xl) 0;
        background-attachment: scroll; /* Mejor rendimiento en móviles */
    }
    
    .hero h2 {
        font-size: var(--font-size-xxl);
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
    
    .category-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .footer .container {
        grid-template-columns: 1fr;
        text-align: left;
        gap: var(--spacing-lg);
    }
    
    .payment-methods {
        justify-content: flex-start;
    }
    
    .table th,
    .table td {
        padding: var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    html {
        font-size: 14px; /* Escala base para móviles pequeños */
    }
    
    h1 {
        font-size: var(--font-size-xxl);
    }
    
    h2 {
        font-size: var(--font-size-xl);
    }
    
    h3 {
        font-size: var(--font-size-lg);
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
    }
    
    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
}

/* Impresión */
@media print {
    .header,
    .footer,
    .whatsapp-float,
    .btn,
    .nav {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .hero {
        background: none !important;
        color: black !important;
        min-height: auto;
        padding: 0;
    }
    
    .hero h2 {
        color: black !important;
        text-shadow: none !important;
    }
    
    .product-card,
    .category-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================
   ESTILOS PARA IMÁGENES MEJORADAS
   ============================================ */

/* Para prevenir problemas con imágenes externas */
img {
    max-width: 100%;
    height: auto;
}

/* Contenedores de imagen fijos */
.fixed-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.fixed-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback para imágenes que no cargan */
.image-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.image-fallback i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Admin - Vista previa de imágenes */
.admin-image-preview {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 15px;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.admin-image-preview.no-image {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #6c757d;
}

.admin-image-preview.no-image i {
    font-size: 2rem;
}

/* Para imágenes de productos en admin list */
.table-product-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.table-product-image i {
    font-size: 1.5rem;
    color: #6c757d;
}

/* ============================================
   ANIMACIONES PARA CARGAR IMÁGENES
   ============================================ */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   RESPONSIVE PARA IMÁGENES
   ============================================ */
@media (max-width: 768px) {
    .product-image-container {
        height: 180px !important;
    }
    
    .slider-image-container {
        height: 100px !important;
    }
    
    .admin-image-preview {
        width: 120px;
        height: 120px;
    }
}

/* ============================================
   ESTILOS PARA SISTEMA DE PAGO UNIFICADO
   ============================================ */

.payment-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  margin-bottom: 30px;
}

.payment-container h4 {
  color: #2d3436;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f8f9fa;
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-container h4:before {
  content: "??";
  font-size: 1.2em;
}

/* ============================================
   FORMULARIO DE TARJETA
   ============================================ */

.card-form {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e9ecef;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
  display: block;
  font-size: 0.95rem;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: #adb5bd;
  opacity: 0.7;
}

.input-group {
  position: relative;
}

.input-group-append {
  margin-left: -1px;
}

.input-group-text {
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-left: none;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
}

/* ============================================
   INDICADORES DE TIPO DE TARJETA
   ============================================ */

#card-type-indicator {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 50px;
}

.card-type-test {
  background: linear-gradient(135deg, #ffd166 0%, #ffc107 100%) !important;
  border-color: #ffc107 !important;
  color: #212529 !important;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
  animation: pulse-test 2s infinite;
}

.card-type-real {
  background: linear-gradient(135deg, #06d6a0 0%, #28a745 100%) !important;
  border-color: #28a745 !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.card-type-default {
  background: #f8f9fa !important;
  border-color: #e9ecef !important;
  color: #6c757d !important;
}

/* ============================================
   INDICADOR DE MODO PRUEBA
   ============================================ */

#test-mode-indicator {
  border-radius: 8px;
  border: 1px solid #ffeaa7;
  border-left: 4px solid #ffc107;
  background: linear-gradient(to right, #fff9e6 0%, #fff3cd 100%);
  padding: 12px 15px;
  margin: 15px 0;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
}

#test-mode-indicator strong {
  color: #856404;
  font-size: 0.95rem;
}

#test-mode-indicator small {
  color: #b68b02;
  font-size: 0.85rem;
}

#test-mode-indicator .btn-outline-warning {
  border-color: #ffc107;
  color: #856404;
  font-size: 0.8rem;
  padding: 4px 10px;
  transition: all 0.3s ease;
}

#test-mode-indicator .btn-outline-warning:hover {
  background-color: #ffc107;
  color: #212529;
}

/* ============================================
   BOTÓN DE PAGO
   ============================================ */

#process-payment {
  background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
  position: relative;
  overflow: hidden;
}

#process-payment:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

#process-payment:active {
  transform: translateY(0);
}

#process-payment:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

#process-payment i {
  margin-right: 10px;
  font-size: 1.2em;
}

/* ============================================
   INFORMACIÓN DE SEGURIDAD
   ============================================ */

.text-center.mt-3 {
  margin-top: 20px !important;
  padding-top: 15px;
  border-top: 1px dashed #dee2e6;
}

.text-center.mt-3 small {
  color: #6c757d;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.text-center.mt-3 i {
  color: #28a745;
  font-size: 1.1em;
}

/* ============================================
   MODAL DE TARJETAS DE PRUEBA
   ============================================ */

#testCardsModal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

#testCardsModal .modal-header {
  background: linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%);
  border-bottom: 2px solid #ffc107;
  padding: 20px 25px;
}

#testCardsModal .modal-title {
  color: #856404;
  font-weight: 600;
  display: flex;
  align-items: center;
}

#testCardsModal .modal-body {
  padding: 25px;
}

#testCardsModal .list-group-item {
  border: 1px solid #e9ecef;
  border-radius: 8px !important;
  margin-bottom: 10px;
  padding: 15px;
  transition: all 0.3s ease;
}

#testCardsModal .list-group-item:hover {
  border-color: #ffc107;
  background-color: #fff9e6;
  transform: translateX(5px);
}

#testCardsModal .list-group-item h6 {
  font-weight: 600;
  color: #2d3436;
  display: flex;
  align-items: center;
  gap: 8px;
}

#testCardsModal .list-group-item p {
  margin: 8px 0 0 0;
}

#testCardsModal .list-group-item code {
  background: #f8f9fa;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.9em;
  color: #e83e8c;
  border: 1px solid #e9ecef;
}

#testCardsModal .alert-info {
  background: #e7f5ff;
  border-color: #a5d8ff;
  color: #1864ab;
  border-radius: 8px;
  padding: 15px;
  font-size: 0.9rem;
}

#testCardsModal .alert-info i {
  color: #1971c2;
  margin-right: 10px;
}

#testCardsModal .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 20px 25px;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

#testCardsModal .btn-outline-warning {
  border-width: 2px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
}

#testCardsModal .btn-outline-warning:hover {
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* ============================================
   ALERTAS DE PAGO
   ============================================ */

.payment-alert {
  border-radius: 8px;
  padding: 15px 20px;
  margin-top: 20px;
  border: none;
  animation: fadeInUp 0.4s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.payment-alert .close {
  position: absolute;
  right: 15px;
  top: 15px;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.payment-alert .close:hover {
  opacity: 1;
}

.alert-success.payment-alert {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-left: 4px solid #28a745;
}

.alert-danger.payment-alert {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-warning.payment-alert {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border-left: 4px solid #ffc107;
}

.alert-info.payment-alert {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes pulse-test {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   ESTADO DE PROCESAMIENTO
   ============================================ */

.payment-processing {
  position: relative;
}

.payment-processing:after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 1040;
  pointer-events: none;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .payment-container {
    padding: 20px 15px;
    margin: 0 -15px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .card-form {
    padding: 15px;
  }
  
  .form-group {
    margin-bottom: 1.2rem;
  }
  
  .form-control {
    padding: 10px 12px;
    font-size: 16px; /* Importante para iOS */
  }
  
  #process-payment {
    padding: 14px;
    font-size: 1rem;
  }
  
  #testCardsModal .modal-dialog {
    margin: 10px;
  }
  
  #testCardsModal .modal-body {
    padding: 20px 15px;
  }
  
  .input-group-text {
    width: 45px;
    font-size: 1em;
  }
}

@media (max-width: 576px) {
  .payment-container h4 {
    font-size: 1.3rem;
  }
  
  .row > .col-md-6 {
    margin-bottom: 1rem;
  }
  
  .row > .col-md-6:last-child {
    margin-bottom: 0;
  }
  
  #test-mode-indicator {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  #test-mode-indicator .btn-outline-warning {
    align-self: flex-end;
  }
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD
   ============================================ */

.form-control:focus {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}

.btn:focus {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .payment-container {
    border: 2px solid #000;
  }
  
  .form-control {
    border: 2px solid #000;
  }
  
  .card-type-test {
    border: 2px solid #000 !important;
  }
  
  .card-type-real {
    border: 2px solid #000 !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .card-type-test,
  .payment-alert,
  #test-mode-indicator,
  #testCardsModal .list-group-item {
    animation: none;
    transition: none;
  }
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA VALIDACIÓN
   ============================================ */

.form-control:invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control:valid {
  border-color: #28a745;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ============================================
   EFECTOS ESPECIALES
   ============================================ */

#process-payment:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.7s ease;
}

#process-payment:hover:before {
  left: 100%;
}

.input-group:focus-within .input-group-text {
  border-color: #4361ee;
}

/* ============================================
   TOOLTIPS Y HINTS
   ============================================ */

.form-text {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.form-text.text-warning:before {
  content: "??";
}

.form-text.text-success:before {
  content: "?";
}

.form-text.text-muted:before {
  content: "??";
}