/* ================================================================
   TicoMercios — Light Mode Premium Minimalista
   Mobile-First · Nativo · Ultra-ligero
   ================================================================ */

/* ---------- VARIABLES ---------- */
:root {
    --blanco:        #ffffff;
    --gris-fondo:    #fdfdfd;
    --gris-borde:    #e0e0e0;
    --gris-suave:    #eaeaea;
    --texto-oscuro:  #222222;
    --texto-negro:   #111111;
    --texto-gris:    #666666;
    --texto-claro:   #999999;
    --turquesa:      #00BCD4;
    --turquesa-osc:  #0097A7;
    --oro:           #FFC107;
    --oro-osc:       #FF8F00;
    --radius-card:   16px;
    --radius-input:  12px;
    --radius-pill:   999px;
    --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI',
                      Roboto, Oxygen, Ubuntu, sans-serif;
    --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sombra-card:   0 10px 30px rgba(0,0,0,0.08);
    --sombra-float:  0 6px 24px rgba(0,0,0,0.15);
}

/* ---------- RESET ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    color: var(--texto-oscuro);
    background: var(--gris-fondo);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero-container {
    position: relative;
    overflow: hidden;
}
.hero-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
    pointer-events: none;
    z-index: 2;
}
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 16px 0;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-image: url('../img/banner.png');
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.2) 40%,
        rgba(255,255,255,0.55) 100%
    );
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- HEADER ---------- */
.header {
    text-align: center;
    width: 100%;
}

/* ---------- LOGO SOBRE BANNER ---------- */
.logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -40px;
    margin-bottom: 0;
    width: 100%;
}
.logo-circular {
    width: 220px !important;
    max-width: 220px !important;
    height: auto !important;
    display: block !important;
    transition: transform 0.3s ease;
}
.logo-circular:hover { transform: scale(1.03); }

.subtitle {
    color: var(--texto-negro);
    font-size: clamp(1.05rem, 3.5vw, 1.3rem);
    font-weight: 600;
    text-align: center;
    margin: 18px 0 16px 0;
}

/* ---------- SEARCH CARD ---------- */
.search-box {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radius-card);
    padding: 18px 16px;
    margin-top: 0;
    margin-bottom: 20px;
    box-shadow: var(--sombra-card);
    position: relative;
    z-index: 3;
}
.select-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.search-footer {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.search-footer .select-cat { flex: 1; }

/* ---------- SELECTS / INPUTS ---------- */
.select-cr, .input-cr {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--gris-borde);
    border-radius: var(--radius-input);
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--texto-oscuro);
    background: #fafafa;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.select-cr:focus, .input-cr:focus {
    outline: none;
    border-color: var(--turquesa);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}
.select-cr option, .input-cr option {
    background: #fff;
    color: var(--texto-oscuro);
}
.select-cr::placeholder, .input-cr::placeholder {
    color: var(--texto-claro);
}

/* ---------- TEXTAREA ---------- */
.textarea-cr { min-height: 80px; resize: vertical; }

/* ---------- FILE INPUT ---------- */
.input-file {
    padding: 12px;
    border-style: dashed;
    border-color: var(--gris-borde);
    color: var(--texto-gris);
    cursor: pointer;
    background: #fafafa;
}
.input-file::file-selector-button {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    color: #2D8A4E;
    padding: 6px 14px;
    margin-right: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition);
}
.input-file::file-selector-button:hover { background: #c8e6c9; }

/* ================================================================
   CTA BANNER — Registro de Negocio
   ================================================================ */
.cta-banner {
    background: linear-gradient(135deg, #f4f7f5, #eef3f0);
    border: 1px solid #e0e8e3;
    border-radius: var(--radius-card);
    padding: 24px 20px;
    margin: 6px 0 18px;
    text-align: center;
}
.cta-title {
    font-size: clamp(1.15rem, 3.8vw, 1.4rem);
    font-weight: 800;
    color: var(--texto-negro);
    margin-bottom: 8px;
    line-height: 1.3;
}
.cta-text {
    font-size: 0.88rem;
    color: #555555;
    line-height: 1.6;
    margin-bottom: 18px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}
.cta-text strong {
    color: #00BCD4;
    font-weight: 700;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-input);
    background: linear-gradient(135deg, #E53935, #C62828);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: var(--font);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s;
    box-shadow: 0 4px 16px rgba(229, 57, 53, 0.3);
    letter-spacing: 0.2px;
}
.cta-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.2);
}

/* ---------- BOTONES ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--turquesa), var(--turquesa-osc));
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.3);
}

.btn-gps {
    background: linear-gradient(135deg, #2D8A4E, #1B6B3E);
    color: #fff;
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(45, 138, 78, 0.25);
}

.btn-submit {
    background: linear-gradient(135deg, var(--turquesa), #00796B);
    color: #fff;
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    margin-top: 10px;
    border-radius: var(--radius-card);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.25);
}

/* ================================================================
   CONTENIDO PRINCIPAL
   ================================================================ */
.content-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 110px;
}

/* ---------- TICO FERTAS ---------- */
.destacados-section { margin-top: 10px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.section-title {
    font-size: clamp(1.1rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: var(--texto-negro);
}
.ticofertas-title { color: var(--texto-negro); }

.badge-hot {
    background: linear-gradient(135deg, var(--oro), var(--oro-osc));
    color: #1a1a1a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    animation: pulse-badge 2s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(255, 193, 7, 0.3);
}
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ---------- TARJETAS DE COMERCIOS ---------- */
.comercios-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tarjeta-comercio {
    background: var(--blanco);
    border: 1px solid var(--gris-suave);
    border-radius: var(--radius-card);
    padding: 18px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.tarjeta-comercio:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.tarjeta-comercio .destacado-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--oro), var(--oro-osc));
    color: #1a1a1a;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.25);
}

.tarjeta-nombre {
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: 700;
    color: var(--texto-negro);
    margin-bottom: 6px;
}
.tarjeta-categoria {
    display: inline-block;
    background: #f0f7f4;
    color: #2D8A4E;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
    text-transform: capitalize;
}
.tarjeta-ubicacion {
    font-size: 0.82rem;
    color: var(--texto-gris);
    margin-bottom: 4px;
}
.tarjeta-telefono {
    font-size: 0.85rem;
    color: var(--turquesa);
    font-weight: 600;
}
.tarjeta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gris-suave);
}
.tarjeta-footer small {
    color: var(--texto-claro);
    font-size: 0.65rem;
}

/* ---------- MENSAJES ---------- */
.cargando {
    text-align: center;
    background: #fafafa;
    border: 1px solid var(--gris-suave);
    border-radius: var(--radius-card);
    color: var(--texto-gris);
    font-size: 0.9rem;
    padding: 28px 20px;
    line-height: 1.7;
}

/* ---------- BOTÓN FLOTANTE AGREGAR ---------- */
.btn-float {
    position: fixed;
    bottom: 28px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--turquesa), #006064);
    color: #fff;
    border: none;
    font-size: 1.6rem;
    box-shadow: var(--sombra-float);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.25s;
}
.btn-float:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}
.btn-float-text { line-height: 1; }

/* ---------- WHATSAPP FLOTANTE ---------- */
.wa-float {
    position: fixed;
    bottom: 28px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--sombra-float), 0 0 0 1px rgba(37, 211, 102, 0.15);
    z-index: 100;
    text-decoration: none;
    animation: wa-glow 2.5s ease-in-out infinite;
    transition: transform 0.2s;
}
.wa-float:active { transform: scale(0.92); }
@keyframes wa-glow {
    0%, 100% { box-shadow: var(--sombra-float); }
    50% { box-shadow: 0 8px 28px rgba(37,211,102,0.25); }
}

/* ================================================================
   MODALES
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s;
}
.modal-overlay.hidden { display: none; }

.modal-content {
    background: var(--blanco);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    padding: 28px 20px 34px;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(80px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    color: var(--texto-gris);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    line-height: 1;
}
.modal-close:hover { background: #e0e0e0; }

.modal-title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    color: var(--texto-negro);
    margin-bottom: 6px;
    padding-right: 40px;
}
.modal-sub {
    font-size: 0.88rem;
    color: var(--texto-gris);
    margin-bottom: 22px;
    line-height: 1.5;
}

/* ---------- FORMULARIO ---------- */
.form-cr .form-group { margin-bottom: 16px; }

.form-cr label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--texto-oscuro);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.help-text {
    display: block;
    font-size: 0.7rem;
    color: var(--texto-claro);
    margin-top: 6px;
}

.form-fieldset {
    border: 1.5px solid var(--gris-suave);
    border-radius: var(--radius-input);
    padding: 18px 14px 14px;
    margin-bottom: 16px;
    background: #fafafa;
}
.form-fieldset legend {
    font-weight: 700;
    color: var(--texto-negro);
    padding: 0 8px;
    font-size: 0.85rem;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- GPS ---------- */
.gps-status {
    font-size: 0.78rem;
    margin-top: 8px;
    text-align: center;
    min-height: 22px;
}
.gps-status.success { color: #2D8A4E; font-weight: 600; }
.gps-status.error   { color: #D32F2F; font-weight: 600; }
.gps-status.loading { color: var(--turquesa); font-weight: 600; }

/* ---------- MENSAJE REGISTRO ---------- */
.reg-mensaje {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-input);
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
}
.reg-mensaje.success {
    display: block;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}
.reg-mensaje.error {
    display: block;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* ---------- DETALLE COMERCIO ---------- */
.modal-detalle-content { padding-bottom: 100px; }

.detalle-imagenes {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 16px;
    scroll-snap-type: x mandatory;
}
.detalle-imagenes img {
    width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-input);
    scroll-snap-align: start;
    flex-shrink: 0;
}

.detalle-nombre {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    color: var(--texto-negro);
    margin-bottom: 6px;
}
.detalle-categoria {
    display: inline-block;
    background: #f0f7f4;
    color: #2D8A4E;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
    text-transform: capitalize;
}
.detalle-info {
    font-size: 0.9rem;
    color: var(--texto-oscuro);
    line-height: 1.8;
    margin-bottom: 8px;
}
.detalle-info strong {
    color: var(--texto-gris);
    font-weight: 600;
}
.detalle-info a {
    color: var(--turquesa);
    text-decoration: none;
    font-weight: 600;
}

.btn-wa-detalle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    border: none;
    border-radius: var(--radius-card);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    margin-top: 20px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
    transition: transform 0.15s;
}
.btn-wa-detalle:active { transform: scale(0.97); }

/* ---------- RESULTADOS ---------- */
.resultados-section { margin-top: 0; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer-ticomercios {
    background-color: #f8f9fa;
    border-top: 1px solid #eaeaea;
    padding: 30px 20px;
    text-align: center;
    font-family: sans-serif;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.link-footer {
    color: #0b2216;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-footer:hover {
    color: #cc0000;
}

.divider {
    color: #cccccc;
    font-size: 14px;
}

.footer-credits {
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

.footer-credits strong {
    color: #111111;
}

.hecho-en-cr {
    margin-top: 5px;
    font-size: 12px;
    color: #888888;
    letter-spacing: 0.5px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (min-width: 768px) {
    .hero-section { padding: 40px 24px; }
    .hero-content { max-width: 720px; }
    .content-main { max-width: 720px; }
    .content-main { padding: 0 24px 120px; }

    .select-row { flex-direction: row; }
    .form-row { flex-direction: row; }
    .form-row .form-group { flex: 1; }

    .logo-circular { width: 120px; height: 120px; }

    .btn-float {
        width: 66px; height: 66px; font-size: 1.7rem;
        bottom: 36px; right: 36px;
    }
    .wa-float {
        width: 60px; height: 60px; font-size: 1.5rem;
        bottom: 36px; left: 36px;
    }

    .comercios-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .modal-content {
        border-radius: var(--radius-card);
        margin-bottom: 40px;
        max-height: 85vh;
    }
    .modal-overlay { align-items: center; }
}

@media (min-width: 1024px) {
    .hero-content { max-width: 800px; }
    .content-main { max-width: 960px; }
    .comercios-grid { grid-template-columns: 1fr 1fr 1fr; }
}
