/* Reset básico */
*,
*::before,
*::after {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #212121;
}
a {
    color: #1976d2;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header estilo MercadoLibre */

.site-header {
    background: #fff159;
    border-bottom: 1px solid #e0e0e0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.brand-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #212121;
}
.brand-sub {
    display: block;
    font-size: 0.75rem;
    color: #424242;
}
.main-nav a {
    margin-left: 16px;
    font-size: 0.9rem;
    color: #212121;
}
.main-nav a.nav-highlight {
    padding: 6px 12px;
    border-radius: 999px;
    background: #1976d2;
    color: #ffffff;
}
.main-nav a.nav-highlight:hover {
    background: #1565c0;
}

/* Hero */

.hero {
    background: linear-gradient(90deg, #fffde7, #e3f2fd);
    padding: 24px 0 16px;
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}
.hero h1 {
    margin: 0 0 8px;
    font-size: 1.9rem;
}
.hero p {
    margin: 0 0 12px;
    color: #616161;
}
.hero-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hero-search input[type="text"],
.hero-search select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cfd8dc;
    background: #ffffff;
    color: #212121;
    flex: 1 1 180px;
}
.hero-search button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #ffca28;
    color: #212121;
    font-weight: 600;
    cursor: pointer;
}
.hero-search button:hover {
    background: #ffc107;
}
.hero-video .video-wrapper {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #000;
}
.hero-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Secciones */

.site-main {
    padding: 24px 0 32px;
}
.home-section {
    padding: 16px 0;
}
.section-header h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
}
.section-header p {
    margin: 0 0 10px;
    color: #616161;
    font-size: 0.9rem;
}

/* Oficios rápidos */

.oficios-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.oficio-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    font-size: 0.8rem;
    color: #424242;
}

/* Cards de negocios */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.negocio-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #eeeeee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
}
.card-badges {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 4px;
}
.badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
}
.badge-premium {
    background: #ffca28;
    color: #212121;
}
.badge-cert {
    background: #43a047;
    color: #ffffff;
}

.card-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.card-logo {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}
.card-logo img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}
.card-title-group {
    flex: 1;
}
.card-title-group h3 {
    margin: 0 0 2px;
    font-size: 1rem;
}
.card-cat {
    margin: 0;
    font-size: 0.8rem;
    color: #757575;
}

.card-desc {
    margin: 6px 0 8px;
    font-size: 0.9rem;
    color: #424242;
}
.card-meta {
    font-size: 0.8rem;
    color: #757575;
    margin-bottom: 8px;
}
.card-meta span {
    display: inline-block;
    margin-right: 8px;
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: #1976d2;
    color: #ffffff;
}
.btn-primary:hover {
    background: #1565c0;
}
.btn-wa {
    background: #43a047;
    color: #ffffff;
}
.btn-wa:hover {
    background: #388e3c;
}
.btn-full {
    width: 100%;
}

/* Banners */

.banner-comercial {
    padding: 6px 0 10px;
}
.banner-comercial-inner {
    display: block;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #eeeeee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.banner-comercial-inner img {
    width: 100%;
    border-radius: 8px;
    display: block;
}
.banner-yellow {
    background: #fff9c4;
}
.banner-blue {
    background: #e3f2fd;
}
.banner-red {
    background: #ffebee;
}
.banner-comercial-text h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.banner-comercial-text p {
    margin: 0;
    font-size: 0.85rem;
    color: #424242;
}
.banner-comercial-cta {
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #d32f2f;
}

/* Detalle negocio */

.detalle-body {
    background: #f5f5f5;
}
.detalle-section {
    padding-top: 24px;
}
.detalle-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}
.detalle-main h1 {
    margin: 0 0 4px;
}
.detalle-cat {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #757575;
}
.detalle-desc {
    font-size: 0.95rem;
    color: #424242;
}
.detalle-bloque {
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid #eeeeee;
}
.detalle-bloque h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}
.chip-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: #e3f2fd;
    font-size: 0.8rem;
}
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.link-list li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.detalle-side {
    align-self: flex-start;
}
.detalle-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #eeeeee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 12px;
}
.detalle-logo {
    text-align: center;
    margin-bottom: 8px;
}
.detalle-logo img {
    max-width: 120px;
    max-height: 120px;
}
.detalle-logo-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #eeeeee;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.detalle-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
}
.detalle-galeria-grid img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    object-fit: cover;
}

/* Video en ficha */

.video-wrapper-ficha {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #000;
}
.video-wrapper-ficha iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Modal PDF */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}
.modal.open {
    display: block;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}
.modal-content {
    position: relative;
    max-width: 900px;
    height: 80vh;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.modal-close {
    position: absolute;
    right: 8px;
    top: 6px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}
.modal-body {
    position: absolute;
    inset: 32px 0 0;
}
.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Ofertas */

.ofertas-body .home-section h1 {
    font-size: 1.6rem;
}

/* Botón WhatsApp ofertas */

.assistant-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: #43a047;
    color: #ffffff;
    font-size: 0.9rem;
}
.assistant-wa-btn:hover {
    background: #388e3c;
}

/* Footer */

.site-footer {
    border-top: 1px solid #e0e0e0;
    padding: 14px 0;
    background: #ffffff;
}
.footer-inner {
    text-align: center;
    font-size: 0.8rem;
    color: #757575;
}

/* Responsive */

@media (max-width: 800px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .brand-text {
        max-width: 100%;
    }

    .main-nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .main-nav a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 16px 0 12px;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-search {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .hero-search input[type="text"],
    .hero-search select,
    .hero-search button {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .detalle-grid {
        grid-template-columns: minmax(0,1fr);
    }
}

/* Extra pequeño (móviles chicos) */

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .negocio-card {
        padding: 10px;
    }

    .card-header {
        gap: 8px;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions .btn {
        width: 100%;
    }
}


.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fffde7;
}
.brand-logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff9c4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.brand-text {
    display: flex;
    flex-direction: column;
}

/* Assistant floating button */

.assistant-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1976d2;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 900;
}
.assistant-icon {
    font-size: 1.4rem;
}
.assistant-panel {
    position: fixed;
    right: 18px;
    bottom: 80px;
    width: 260px;
    max-width: calc(100% - 40px);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    z-index: 900;
}
.assistant-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.assistant-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 0.85rem;
}
.assistant-panel-header button {
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1rem;
    cursor: pointer;
}
.assistant-panel-body {
    padding: 10px 12px 12px;
    font-size: 0.85rem;
    color: #374151;
}
.assistant-panel-body p {
    margin: 0 0 6px;
}


.banner-comercial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}
.banner-comercial-inner {
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-comercial-inner img {
    max-width: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
}


/* Ajustes ficha negocio: limitar tamaño de imágenes */
.detalle-main .detalle-galeria-grid img,
.detalle-main .galeria-negocio img,
.detalle-main .media-carousel-main img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
}

.detalle-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.detalle-main img {
    max-width: 100%;
    height: auto;
}
