/* ============================================
   Cupones AliExpress — Estilos Frontend
   ============================================ */

.ca-wrapper {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
}

/* --- Header --- */
.ca-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.ca-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff4747, #cc0000);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}

.ca-header-text { flex: 1; }

.ca-titulo {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #cc0000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ca-subtitulo {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* --- Countdown Bar --- */
.ca-countdown-bar {
    background: linear-gradient(135deg, #ff4747 0%, #cc0000 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 71, 71, 0.3);
}

.ca-countdown-label { opacity: 0.9; font-weight: 400; }

.ca-countdown {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 6px;
}

.ca-countdown.caducado { background: rgba(0,0,0,0.3); }

/* --- Validez --- */
.ca-validez {
    text-align: center;
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 18px;
    padding: 8px;
    background: #fff8f0;
    border-radius: 8px;
    border: 1px solid #ffe5cc;
}

/* --- Tabs --- */
.ca-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    justify-content: center;
}

.ca-tab-btn {
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ca-tab-btn:hover { border-color: #ff4747; color: #ff4747; }

.ca-tab-btn.active {
    background: linear-gradient(135deg, #ff4747 0%, #cc0000 100%);
    border-color: #cc0000;
    color: white;
    box-shadow: 0 3px 10px rgba(255, 71, 71, 0.35);
}

/* --- Cards --- */
.ca-card {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 28px 28px 22px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.ca-card.active {
    display: block;
    animation: ca-fadein 0.25s ease;
}

@keyframes ca-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ca-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff4747 0%, #ff9500 100%);
}

/* --- Badge --- */
.ca-badge {
    position: absolute;
    top: 16px; right: 16px;
    background: linear-gradient(135deg, #ff9500, #ff4747);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Descuento grande --- */
.ca-card-top { text-align: center; margin-bottom: 18px; }

.ca-descuento-grande {
    display: inline-block;
    background: linear-gradient(135deg, #ff4747 0%, #cc0000 100%);
    border-radius: 16px;
    padding: 14px 30px;
    margin-bottom: 8px;
}

.ca-euro-signo {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ca-minimo { color: #666; font-size: 0.95rem; }
.ca-minimo strong { color: #333; }

/* --- Descripción --- */
.ca-descripcion {
    font-size: 0.95rem;
    color: #444;
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #ff4747;
}

/* --- Código --- */
.ca-codigo-wrap { margin-bottom: 20px; }

.ca-codigo-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.ca-codigo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.ca-codigo-row:hover { border-color: #ff4747; }

.ca-codigo-text {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #222;
    user-select: all;
}

.ca-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff4747 0%, #cc0000 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ca-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 71, 71, 0.4);
}

.ca-copy-btn.copiado {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* --- Botón AliExpress --- */
.ca-btn-aliexpress {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #ff9500 0%, #ff4747 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(255, 149, 0, 0.35);
}

.ca-btn-aliexpress:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.5);
}

/* --- Disclaimer --- */
.ca-disclaimer {
    text-align: center;
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 16px;
}

/* --- Error --- */
.ca-error {
    background: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 14px 18px;
    color: #cc0000;
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .ca-card { padding: 20px 16px 18px; }
    .ca-euro-signo { font-size: 2.2rem; }
    .ca-codigo-text { font-size: 1.1rem; }
    .ca-titulo { font-size: 1.2rem; }
    .ca-tab-btn { padding: 7px 13px; font-size: 0.82rem; }
}
