:root {
    --primary: #ff6600;
    --primary-dark: #e55b00;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --success: #198754;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-main);
}

.top-alert-bar {
    background: linear-gradient(90deg, #ff9900, #ff6600);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-alert-bar .badge-flash {
    background: #d90429;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: bold;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 25px 0 35px 0;
}

.header-main-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-koala {
    width: 85px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.header-text-group p {
    color: var(--text-muted);
    font-size: 1.05em;
    margin: 5px 0 0 0;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.5em;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Cuadrícula Principal Unificada (2 columnas en celular, 4 en PC) --- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 5px;
}

@media (min-width: 992px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 0;
  }
}

/* --- DISEÑO DE CUPÓN TIPO TICKET --- */
.card.ticket-shape {
    background: #ffcc00;
    border-radius: 14px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
    border: 2px dashed #002D62;
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.3s ease;
}

.card.ticket-shape:hover {
    transform: translateY(-3px);
}

/* Franja vertical izquierda con el nombre de la marca */
.ticket-left-stripe {
    background: #002D62;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-weight: bold;
    font-size: 0.8em;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 2px dashed #ffcc00;
}

/* Contenido central del ticket */
.ticket-center-body {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #ffeb3b;
}

.ticket-handshake-icon {
    font-size: 1.6em;
    color: #002D62;
    margin-bottom: 4px;
}

.ticket-code-container {
    background: #ffffff;
    border: 2px dashed #002D62;
    color: #002D62;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    margin: 6px 0;
    letter-spacing: 1.5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    width: 100%;
    box-sizing: border-box;
}

.ticket-slogan {
    font-style: italic;
    font-size: 0.75em;
    color: #333333;
    margin-top: 2px;
}

/* Bloque derecho (Descuento y condiciones en azul) */
.ticket-right-block {
    background: #002D62;
    color: #ffffff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-top: 2px dashed #ffeb3b;
}

.ticket-discount-big {
    font-size: 1.5em;
    font-weight: 900;
    color: #ffcc00;
    line-height: 1;
}

.ticket-discount-text {
    font-size: 0.65em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.ticket-condition {
    font-size: 0.7em;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 4px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ticket-condition i {
    font-size: 0.8em;
    color: #ffcc00;
}

.ticket-condition span {
    color: #ffcc00;
    font-weight: bold;
}

.btn-copy-ticket {
    background: #3483fa;
    color: white;
    border: none;
    padding: 7px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8em;
    width: 100%;
    margin-top: 6px;
    text-align: center;
}

.btn-box-disabled {
    background: #6c757d;
    color: white;
    padding: 7px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8em;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
}

/* Botón de compartir en la esquina de la tarjeta */
.btn-share-ticket {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 45, 98, 0.1);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #002D62;
    font-size: 0.85em;
    z-index: 10;
    transition: background 0.2s;
}

.btn-share-ticket:hover {
    background: rgba(0, 45, 98, 0.25);
}

/* --- DISEÑO ESPECÍFICO PARA CUPONES DE AMAZON --- */
.card.amazon-ticket {
    background: #ff9900 !important;
    border: 2px dashed #232f3e !important;
}

.amazon-barcode-stripe {
    background: #ffffff;
    color: #232f3e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    font-weight: bold;
    font-size: 0.7em;
    border-right: 2px dashed #ff9900;
    text-align: center;
    border-bottom: 2px dashed #ff9900;
}

.amazon-barcode-stripe i.fa-barcode {
    font-size: 2.2em;
    color: #232f3e;
    letter-spacing: -2px;
    margin-bottom: 4px;
}

.amazon-barcode-text {
    writing-mode: horizontal-tb;
    font-family: monospace;
    font-size: 0.75em;
    letter-spacing: 1px;
    margin-top: 3px;
}

.amazon-center-body {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #ffaa33;
}

.amazon-right-block {
    background: #232f3e;
    color: #ffffff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-top: 2px dashed #ffaa33;
}

.amazon-right-block .ticket-discount-big {
    color: #ff9900;
}

.amazon-features-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed rgba(0,0,0,0.15);
    font-size: 0.65em;
    color: #232f3e;
    font-weight: bold;
    gap: 4px;
    text-align: center;
}

.amazon-features-row div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.amazon-features-row i {
    font-size: 1.1em;
    color: #232f3e;
}

/* Adaptación para Computadoras (Diseño Horizontal) */
@media (min-width: 992px) {
  .card.ticket-shape {
    flex-direction: row;
    align-items: stretch;
  }

  .ticket-left-stripe {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 12px 6px;
    font-size: 0.85em;
    border-bottom: none;
    border-right: 2px dashed #ffcc00;
  }

  .ticket-center-body {
    flex-grow: 1;
    padding: 15px;
  }

  .ticket-right-block {
    min-width: 130px;
    border-top: none;
    border-left: 2px dashed #ffeb3b;
    padding: 15px;
  }

  /* Computadora para Amazon */
  .card.amazon-ticket {
    flex-direction: row;
    align-items: stretch;
  }

  .amazon-barcode-stripe {
    border-bottom: none;
    border-right: 2px dashed #ff9900;
    width: 55px;
  }

  .amazon-barcode-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    margin-top: 5px;
  }

  .amazon-right-block {
    border-top: none;
    border-left: 2px dashed #ffaa33;
    min-width: 130px;
  }
}

.site-footer {
    margin-top: 60px;
    padding: 25px 0;
    border-top: 1px solid #dee2e6;
}

.footer-affiliate-notice {
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 12px 20px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 20px;
}

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9em;
}

.btn-footer-admin {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-footer-admin:hover {
    opacity: 0.8;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.btn-danger {
    background: #dc3545;
}

.hidden { display: none !important; }

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 450px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content input, .modal-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    box-sizing: border-box;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
}

@media (max-width: 768px) {
    .top-alert-bar {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    header.header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin: 15px 0 25px 0;
    }

    header.header-flex > div:last-child {
        width: 100%;
    }

    .btn-whatsapp {
        display: flex;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .footer-bottom-row {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

.help-section {
    margin: 20px 0;
}

.help-details {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.help-summary {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-main, #333);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-summary::-webkit-details-marker {
    display: none;
}

.help-content {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
}

.help-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.help-content li {
    margin-bottom: 8px;
}

.video-tutorial-box {
    background-color: #e7f3ff;
    border: 1px solid #b6d4fe;
    color: #084298;
    padding: 12px 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes pulseAttention {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 10px 4px rgba(255, 102, 0, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 102, 0, 0);
  }
}

.btn-attention-nav {
  animation: pulseAttention 2s infinite ease-in-out;
  border: 2px solid var(--primary, #ff6600) !important;
  background: #fff8f0 !important;
  color: #ff6600 !important;
  transition: all 0.3s ease;
}

.btn-attention-nav:hover {
  background: #ff6600 !important;
  color: #ffffff !important;
}

.single-card-grid {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

@media (min-width: 992px) {
  .single-card-grid .card {
    max-width: calc(25% - 12px);
    width: 100%;
  }
}

/* --- Ajuste responsivo absoluto para celulares --- */
@media (max-width: 768px) {
    /* Forzar que las cuadrículas tengan 1 sola columna en el celular para que el ticket quepa completo */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 0 10px !important;
    }

    /* Forzar que todas las tarjetas de cupones mantengan su estructura horizontal en el celular */
    .card.ticket-shape {
        flex-direction: row !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    /* Franja vertical izquierda visible en el celular */
    .ticket-left-stripe {
        writing-mode: vertical-rl !important;
        text-orientation: mixed !important;
        transform: rotate(180deg) !important;
        padding: 10px 4px !important;
        font-size: 0.75em !important;
        border-bottom: none !important;
        border-right: 2px dashed #ffcc00 !important;
    }

    /* Franja de código de barras para Amazon en el celular */
    .amazon-barcode-stripe {
        border-bottom: none !important;
        border-right: 2px dashed #ff9900 !important;
        width: 45px !important;
    }

    .amazon-barcode-text {
        writing-mode: vertical-rl !important;
        text-orientation: mixed !important;
        transform: rotate(180deg) !important;
        margin-top: 5px !important;
    }

    /* Bloques laterales proporcionales en pantallas pequeñas */
    .ticket-right-block, .amazon-right-block {
        min-width: 110px !important;
        padding: 8px !important;
    }
}

/* Ajuste de tipografía para títulos y descuentos largos en el bloque derecho */
.amazon-right-block .ticket-discount-big, 
.ticket-right-block .ticket-discount-big {
    font-size: 1.3em !important; /* Ligeramente más compacto para que títulos largos respiren */
    line-height: 1.1 !important;
}

.ticket-condition {
    font-size: 0.65em !important;
    line-height: 1.2 !important;
    word-break: break-word;
}

/* Ajuste específico para textos largos de condiciones (como Mercado Pago) */
.ticket-condition {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.62em !important;
    padding: 3px 2px !important;
}

/* --- Ajuste extra para el botón de compartir alineado con el porcentaje --- */
.ticket-right-section .ticket-icon-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.ticket-right-section .discount-amount {
    font-size: 1.4em !important;
    font-weight: 800 !important;
}