:root {
    --primary-color: #E2001A;
    --secondary-color: #000000;
    --accent-color: #FFD100;
    --background: #FFFFFF;
    --surface: #FFFFFF;
    --text-dark: #1D1D1F;
    --text-light: #86868B;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #E2001A;
    --border: #D2D2D7;
    
    --dark-background: #121212;
    --dark-surface: #1E1E1E;
    --dark-text: #E0E0E0;
    --dark-text-light: #B0B0B0;
    --dark-border: #333333;
    
    --gradient: linear-gradient(135deg, #E2001A 0%, #C40015 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.47059;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    --background: var(--dark-background);
    --surface: var(--dark-surface);
    --text-dark: var(--dark-text);
    --text-light: var(--dark-text-light);
    --border: var(--dark-border);
}

body.seguimiento-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body.seguimiento-page.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 22px;
}

/* Top Bar */
.top-bar {
    background-color: var(--secondary-color);
    color: rgba(255,255,255,0.8);
    padding: 0.6rem 0;
    font-size: 0.8rem;
    position: relative;
    z-index: 1000;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-bar .left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.8rem;
}

.top-bar .right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Header */
.header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    height: 52px;
}

body.dark-mode .header {
    background: rgba(30,30,30,0.95);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    display: flex;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    overflow: hidden;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.search-bar input:focus {
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    color: var(--text-light);
}

.header-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.cart-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
}

#cart-count {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-store-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.back-to-store-btn:hover {
    background: #C40015;
    transform: translateY(-2px);
}

/* Navegación */
.main-nav {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 52px;
    z-index: 999;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.main-nav::-webkit-scrollbar {
    height: 3px;
}

.main-nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.nav-links {
    list-style: none;
    display: flex;
    white-space: nowrap;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.9rem 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Banner Promocional */
.promo-banner {
    background: var(--gradient);
    color: white;
    padding: 0.8rem 0;
    text-align: center;
}

.promo-tag {
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Carrusel */
.ad-carousel-container {
    padding: 2rem 0 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 154px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-item {
    min-width: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
}

.carousel-dot.active {
    background: white;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.carousel-container:hover .carousel-nav {
    opacity: 1;
}

.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

/* Filtros */
.filter-container {
    padding: 1.5rem 0;
    background: #f9f9f9;
    border-bottom: 1px solid var(--border);
}

.filter-controls {
    display: flex;
    justify-content: flex-end;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
}

/* Productos */
.products-section {
    padding: 2rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stock-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--success);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.product-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.description-container .description {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.7rem;
    cursor: pointer;
}

.price {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.8rem 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.quantity-input {
    width: 45px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.add-to-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart:hover {
    background: #C40015;
}

.out-of-stock {
    color: var(--error);
    text-align: center;
    padding: 0.8rem;
    border: 1px solid var(--error);
    border-radius: 8px;
}

/* Sección de Seguimiento */
.seguimiento-main {
    min-height: calc(100vh - 300px);
    padding: 3rem 0;
}

.seguimiento-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.seguimiento-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.seguimiento-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.seguimiento-form-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    background: var(--surface);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.input-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#reparacion-code {
    flex: 3;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-dark);
    font-family: monospace;
}

.track-btn {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.track-btn:hover {
    background: #C40015;
    transform: translateY(-2px);
}

/* Tarjeta de Estado */
.status-card {
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.status-card:hover {
    transform: translateY(-4px);
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(226,0,26,0.05), rgba(0,0,0,0.02));
    border-bottom: 1px solid var(--border);
}

.status-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 4px solid;
}

.status-icon span {
    font-size: 2rem;
}

.status-title h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.status-title p {
    color: var(--text-light);
    font-size: 0.85rem;
}

.status-card-body {
    padding: 2rem;
}

.current-status {
    text-align: center;
    margin-bottom: 2rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.75rem;
}

.status-message {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Barra de progreso */
.progress-section {
    margin: 1.5rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.progress-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.progress-bar-container {
    background: var(--border);
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
}

.progress-bar-fill-animated {
    height: 100%;
    border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #E2001A, #FF6B6B, #2ECC71);
    background-size: 200% 100%;
    animation: gradientShift 2s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.motivational-message {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-align: center;
}

/* Detalles */
.info-details {
    background: var(--background);
    border-radius: 16px;
    padding: 1rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.detail-item:first-child {
    border-bottom: 1px solid var(--border);
}

.detail-item i {
    width: 32px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.detail-item strong {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.detail-item p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mapa */
.map-container {
    margin: 1.5rem 0;
    border-radius: 16px;
    overflow: hidden;
}

#repair-map {
    width: 100%;
    height: 280px;
    background: #e8eef2;
}

.last-update {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: var(--text-light);
    background: var(--background);
}

.auto-refresh-badge {
    background: var(--success);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Contacto */
.contact-support {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(226,0,26,0.08);
    border-radius: 16px;
    margin-top: 1.5rem;
}

.contact-support i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Error */
.repair-error {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(226,0,26,0.05);
    border-radius: 24px;
    border: 1px dashed var(--error);
}

.repair-error i {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 1rem;
}

/* Loader */
.loader-overlay {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Marcador mapa */
.custom-marker {
    background: var(--primary-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: markerPulse 1.5s infinite;
}

.custom-marker::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(226,0,26,0.4);
    border-radius: 50%;
    top: -5px;
    left: -5px;
    animation: ripple 1.5s infinite;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes ripple {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: #F5F5F7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.info-col {
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
}

.info-col h2 {
    background: var(--gradient);
    color: white;
    padding: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-content {
    padding: 1.5rem;
}

.info-content h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.1rem;
}

.faq-item {
    margin-bottom: 1rem;
}

.faq-item h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

/* Footer */
.footer {
    background: #F5F5F7;
    padding: 3rem 0 0;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.social-links a {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.payment-methods {
    display: flex;
    gap: 0.8rem;
}

.payment-methods i {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Modales */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: var(--surface);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 1000;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.cart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.remove-item {
    background: none;
    border: none;
    color: var(--error);
    font-size: 1.2rem;
    cursor: pointer;
}

.cart-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: right;
    margin-bottom: 1rem;
}

.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.checkout-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 18px;
    width: 90%;
    max-width: 450px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-checkout {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.3rem;
    cursor: pointer;
}

.checkout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-dark);
}

/* Notificaciones */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.8rem 1.2rem;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 3000;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.no-products {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .header { height: auto; }
    .header .container { flex-wrap: wrap; gap: 0.8rem; padding: 10px 16px; }
    .logo { order: 1; }
    .header-actions { order: 2; margin-left: auto; }
    .search-bar { order: 3; max-width: 100%; width: 100%; }
    .main-nav { top: auto; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
    .carousel-container { height: 120px; }
    .status-card-header { flex-direction: column; text-align: center; padding: 1.2rem; }
    .status-card-body { padding: 1.2rem; }
    .progress-value { font-size: 1.2rem; }
    #repair-map { height: 200px; }
    .detail-item { flex-direction: column; gap: 0.5rem; text-align: center; }
    .detail-item i { width: auto; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .carousel-container { height: 100px; }
    .cart-modal { max-width: 100%; }
    .status-icon { width: 50px; height: 50px; }
    .status-icon span { font-size: 1.5rem; }
    .status-title h3 { font-size: 1.1rem; }
}