/* Fix overflow horizontal mobile */
html,body{overflow-x:hidden;max-width:100vw}

/* =====================================================
   Regalos Purranque — Frontend Público
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:wght@600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #e74c3c;
    --primary-hover: #c0392b;
    --secondary: #2c3e50;
    --accent: #f39c12;
    --accent-hover: #d68910;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-dark: #1a1a2e;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --text-white: #ffffff;
    --border: #e8e8e8;
    --sponsor: #f39c12;
    --premium: #9b59b6;
    --success: #27ae60;
    --whatsapp: #25D366;
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --transition: 250ms ease;
    --max-width: 1200px;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3rem 0; }
.section--gray { background: #f0f2f5; }
.section-title { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--secondary); }
.section-subtitle { color: var(--text-light); font-size: 1.05rem; margin-bottom: 2rem; }

/* =====================================================
   HEADER / NAVEGACIÓN
   ===================================================== */
.header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--secondary);
}

.header__logo span { font-size: 1.6rem; }

.header__nav { display: flex; align-items: center; gap: 1.5rem; }
.header__nav a {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}
.header__nav a:hover { color: var(--primary); }

.header__search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    flex: 0 1 300px;
}

.header__search input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
}

.header__hamburger { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* =====================================================
   HERO
   ===================================================== */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem 0 3rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero__content { position: relative; text-align: center; max-width: 700px; margin: 0 auto; }
.hero__badge { display: inline-block; background: rgba(255,255,255,0.2); padding: 0.3rem 1rem; border-radius: var(--radius-xl); font-size: 0.85rem; margin-bottom: 1rem; backdrop-filter: blur(4px); }
.hero__title { font-family: var(--font-display); font-size: 2.75rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero__subtitle { font-size: 1.15rem; opacity: 0.9; margin-bottom: 2rem; }

.hero__countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.countdown__item {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    min-width: 70px;
    text-align: center;
}

.countdown__number { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.countdown__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; }

.hero__search {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero__search input {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    color: var(--text);
}

.hero__search button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.hero__search button:hover { background: var(--accent-hover); }

/* =====================================================
   BANNER HORIZONTAL
   ===================================================== */
.banner-horizontal {
    display: block;
    margin: 1.5rem auto;
    max-width: var(--max-width);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.banner-horizontal img { width: 100%; height: auto; display: block; }
.banner-horizontal__tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================
   CATEGORÍAS
   ===================================================== */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.categoria-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.categoria-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.categoria-card__icon { font-size: 2.25rem; margin-bottom: 0.5rem; }
.categoria-card__name { font-weight: 600; font-size: 0.9rem; color: var(--secondary); margin-bottom: 0.25rem; }
.categoria-card__count { font-size: 0.75rem; color: var(--text-muted); }

/* =====================================================
   COMERCIOS GRID
   ===================================================== */
.comercios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.comercio-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}

.comercio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.comercio-card__image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.comercio-card__image img { width: 100%; height: 100%; object-fit: cover; }

.comercio-card__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.comercio-card__body { padding: 1.25rem; }

.comercio-card__logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 3px solid white;
    box-shadow: var(--shadow);
    margin-top: -40px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    position: relative;
}

.comercio-card__logo img { width: 100%; height: 100%; object-fit: cover; }

.comercio-card__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.comercio-card__desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comercio-card__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.comercio-card__tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xl);
    background: rgba(231,76,60,0.08);
    color: var(--primary);
}

.comercio-card__actions { display: flex; gap: 0.5rem; }

.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1;
}
.btn--primary { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-hover); color: white; }
.btn--whatsapp { background: var(--whatsapp); color: white; }
.btn--whatsapp:hover { background: #1da851; color: white; }
.btn--outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn--block { width: 100%; }

/* =====================================================
   CARRUSEL DE FOTOS
   ===================================================== */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    touch-action: pan-y;
}

.carousel__track {
    display: flex;
    transition: transform 400ms ease;
    will-change: transform;
}

.carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.carousel__slide img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    z-index: 5;
}

.carousel__btn:hover { background: white; box-shadow: var(--shadow-lg); }
.carousel__btn--prev { left: 0.75rem; }
.carousel__btn--next { right: 0.75rem; }

.carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.carousel__dot--active { background: var(--primary); transform: scale(1.3); }

/* =====================================================
   FICHA DE COMERCIO
   ===================================================== */
.ficha { max-width: 900px; margin: 0 auto; }

.ficha__hero {
    position: relative;
    height: 300px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: -60px;
}

.ficha__hero img { width: 100%; height: 100%; object-fit: cover; }
.ficha__hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.ficha__header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.ficha__logo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: white;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.ficha__logo img { width: 100%; height: 100%; object-fit: cover; }

.ficha__info h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.ficha__contacto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.ficha__contacto-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.ficha__contacto-item span:first-child { font-size: 1.25rem; }

.ficha__whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--whatsapp);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    transition: all var(--transition);
    margin: 1.5rem 0;
}

.ficha__whatsapp:hover { background: #1da851; color: white; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.ficha__section { margin-bottom: 2rem; }
.ficha__section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; color: var(--secondary); }

.ficha__horarios { width: 100%; border-collapse: collapse; }
.ficha__horarios td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.ficha__horarios tr:last-child td { border: none; }

.ficha__redes { display: flex; gap: 0.75rem; }
.ficha__redes a {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; background: var(--bg); border-radius: var(--radius);
    color: var(--text); font-size: 0.85rem; font-weight: 500;
    transition: all var(--transition);
}
.ficha__redes a:hover { background: var(--primary); color: white; }

/* =====================================================
   SIDEBAR (BANNER VERTICAL)
   ===================================================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.sidebar { position: sticky; top: 80px; align-self: start; }

.banner-vertical {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    position: relative;
}

.banner-vertical img { width: 100%; display: block; }
.banner-vertical__tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.55rem;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

/* =====================================================
   NOTICIAS
   ===================================================== */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.noticia-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.noticia-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.noticia-card__image {
    height: 180px;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
    overflow: hidden;
}

.noticia-card__image img { width: 100%; height: 100%; object-fit: cover; }

.noticia-card__body { padding: 1.25rem; }
.noticia-card__date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.noticia-card__title { font-size: 1.05rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.5rem; line-height: 1.35; }
.noticia-card__excerpt { font-size: 0.85rem; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* =====================================================
   FECHAS ESPECIALES
   ===================================================== */
.fechas-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.fechas-scroll::-webkit-scrollbar { height: 4px; }
.fechas-scroll::-webkit-scrollbar-track { background: var(--border); border-radius: 2px; }
.fechas-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

.fecha-card {
    flex: 0 0 180px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    scroll-snap-align: start;
    transition: all var(--transition);
    cursor: pointer;
}

.fecha-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.fecha-card__icon { font-size: 2rem; margin-bottom: 0.5rem; }
.fecha-card__name { font-weight: 600; font-size: 0.9rem; color: var(--secondary); margin-bottom: 0.25rem; }
.fecha-card__date { font-size: 0.75rem; color: var(--text-muted); }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3 { color: white; font-size: 1rem; margin-bottom: 1rem; }
.footer p { font-size: 0.85rem; line-height: 1.7; }
.footer a { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.footer a:hover { color: white; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 0.5rem; }

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* =====================================================
   BADGES
   ===================================================== */
.badge { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; }
.badge--sponsor { background: rgba(243,156,18,0.15); color: #d68910; }
.badge--premium { background: rgba(155,89,182,0.15); color: #8e44ad; }
.badge--activo { background: rgba(39,174,96,0.15); color: #27ae60; }

/* =====================================================
   LIGHTBOX
   ===================================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox--open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .hero__title { font-size: 1.75rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .hero__countdown { gap: 0.5rem; }
    .countdown__item { min-width: 55px; padding: 0.5rem; }
    .countdown__number { font-size: 1.25rem; }

    .header__nav { display: none; }
    .header__hamburger { display: block; }
    .header__search { flex: 1; }

    .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    .comercios-grid { grid-template-columns: 1fr; }
    .noticias-grid { grid-template-columns: 1fr; }
    .categorias-grid { grid-template-columns: repeat(3, 1fr); }
    .categoria-card { padding: 1rem 0.5rem; }
    .categoria-card__icon { font-size: 1.75rem; }

    .ficha__hero { height: 200px; }
    .ficha__header { flex-direction: column; align-items: flex-start; }
    .ficha__contacto { grid-template-columns: 1fr; }

    .footer__grid { grid-template-columns: 1fr; }

    .carousel__slide img { height: 250px; }

    .section-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .categorias-grid { grid-template-columns: repeat(2, 1fr); }
    .hero__search { flex-direction: column; border-radius: var(--radius); }
    .hero__search input { border-bottom: 1px solid var(--border); }
    .hero__search button { border-radius: 0 0 var(--radius) var(--radius); }
}
