/* Portada: barra superior, ubicación, pedido en curso, eventos, servicios y categorías */

.topbar{
    position:sticky; top:0; z-index:100;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding-inline:clamp(16px,3vw,40px);
    padding-top:calc(env(safe-area-inset-top) + 10px); padding-bottom:10px;
    background:var(--bg);
    background:color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
}
.topbar-left{ display:flex; flex:1 1 auto; flex-direction:column; min-width:0; gap:2px; }
.topbar-row{ display:flex; align-items:center; gap:8px; }
.icon-button svg{ width:26px; height:26px; }
.logo svg{ height:17px; }
/* Saludo grande: titular en Bold + texto pequeño en Light */
.home-hero{ padding-block:16px 4px; }
.home-hero__title{ font-size:clamp(28px, 7.5vw, 44px); font-weight:700; line-height:1.06; letter-spacing:-.03em; text-wrap:balance; }
.home-hero__text{ margin-top:8px; max-width:480px; color:var(--text-muted); font-size:15px; font-weight:300; line-height:1.5; }
@media(min-width:768px){
    .home-hero{ padding-block:36px 12px; text-align:center; }
    .home-hero__text{ margin-inline:auto; }
}
.header-actions{ display:flex; align-items:center; flex-shrink:0; gap:10px; }

/* Ubicación y dirección de entrega */
.location-bar{ padding-block:14px 2px; }
.location-button{
    display:flex; width:fit-content; align-items:center; gap:6px; max-width:100%; margin-left:-6px; padding:4px 6px; border-radius:8px;
    color:var(--text); font-size:16px; transition:background-color .2s ease;
}
.location-button:hover{ background:var(--hover); }
.location-button span{ min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.loc-address{ flex-shrink:0; max-width:55%; font-weight:600; }
#locationText{ flex:1; }
.loc-sep{ flex-shrink:0; color:var(--text-muted); }
.location-button .chevron{ flex-shrink:0; width:16px; height:16px; opacity:.6; }

/* Pedido en curso */
.active-order-section{ padding-block:0 8px; }
.active-order-card{
    display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:var(--radius-lg); color:var(--text);
    border:1px solid rgba(54,191,177,.3); background:linear-gradient(135deg, rgba(54,191,177,.1), rgba(3,140,115,.05));
    transition:transform .2s var(--ease), background-color .2s ease;
}
.active-order-icon{
    position:relative; display:flex; align-items:center; justify-content:center; flex-shrink:0;
    width:40px; height:40px; border-radius:50%; color:var(--brand-fg); background:rgba(54,191,177,.15);
}
.pulse-dot{
    position:absolute; top:50%; left:50%; width:12px; height:12px; border-radius:50%;
    background:var(--cimil-1); transform:translate(-50%, -50%);
    animation:pulse-ring 1.8s cubic-bezier(.215,.61,.355,1) infinite;
}
.active-order-icon svg{ position:relative; z-index:1; width:20px; height:20px; }
@keyframes pulse-ring{ 0%{ width:12px; height:12px; opacity:.8; } 80%,100%{ width:46px; height:46px; opacity:0; } }
.active-order-text{ display:flex; flex:1; flex-direction:column; min-width:0; }
.active-order-title{ color:var(--brand-fg); font-size:14px; font-weight:600; }
.active-order-subtitle{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--text-muted); font-size:13px; }
.active-order-arrow{ flex-shrink:0; width:20px; height:20px; color:var(--text-muted); }

/* El domiciliario ya llegó: amarillo y pulso rápido */
.active-order-card.is-arrived{
    border-color:rgba(255,193,7,.45); background:linear-gradient(135deg, rgba(255,193,7,.16), rgba(255,193,7,.05));
}
.active-order-card.is-arrived .active-order-icon{ color:var(--warning-fg); background:rgba(255,193,7,.18); }
.active-order-card.is-arrived .active-order-title{ color:var(--warning-fg); }
.active-order-card.is-arrived .pulse-dot{ background:var(--warning); animation:pulse-ring-fast .8s cubic-bezier(.215,.61,.355,1) infinite; }
@keyframes pulse-ring-fast{ 0%{ width:12px; height:12px; opacity:.9; } 80%,100%{ width:40px; height:40px; opacity:0; } }

/* Eventos comerciales (carrusel) */
.carousel-section{ padding-block:0 18px; }
.carousel-track{ display:flex; gap:16px; overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.carousel-track::-webkit-scrollbar{ display:none; }
.carousel-card{ display:block; flex:0 0 100%; scroll-snap-align:start; }
.carousel-card__ph{
    position:relative; display:flex; align-items:flex-end; aspect-ratio:2.15 / 1; padding:20px;
    overflow:hidden; border-radius:var(--radius-xl); color:#FFFFFF;
    background-color:var(--hover); background-position:center; background-size:cover;
    transition:transform .25s var(--ease);
}
.carousel-card__ph--plain{ background-image:linear-gradient(135deg, var(--cimil-2), var(--cimil-4)); }
.carousel-card__ph::after{ content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0) 60%); }
.carousel-card__text{ position:relative; z-index:1; display:flex; flex-direction:column; max-width:70%; text-shadow:0 1px 6px rgba(0,0,0,.3); }
.carousel-card__title{ font-size:18px; font-weight:600; line-height:1.25; }
.carousel-card__desc{ margin-top:2px; font-size:13px; opacity:.9; }
/* Marca de la empresa dueña del evento */
.carousel-card__brand{
    position:absolute; right:16px; bottom:16px; z-index:2; display:flex; align-items:center; gap:8px; max-width:65%;
    padding:6px 14px 6px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.25);
    background:rgba(255,255,255,.15); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.carousel-card__brand-name{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#FFFFFF; font-size:12px; font-weight:600; }
.carousel-card__brand-logo{
    flex-shrink:0; width:24px; height:24px; border-radius:50%; border:1px solid rgba(255,255,255,.4);
    background:#EDEDED center / cover no-repeat;
}
.carousel-dots{ display:flex; justify-content:center; gap:4px; margin-top:12px; }
.carousel-dot{ display:flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%; }
.carousel-dot::before{ content:""; width:6px; height:6px; border-radius:3px; background:var(--hover); transition:width .2s ease, background-color .2s ease; }
.carousel-dot:hover::before{ background:var(--divider); }
.carousel-dot.is-active::before{ width:18px; background:var(--text); }

/* Servicios */
.subcats-section{ padding-block:0 18px; }
.subcats-track{ display:flex; gap:18px; overflow-x:auto; scroll-snap-type:x proximity; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; padding-block:4px 6px; scrollbar-width:none; }
.subcats-track::-webkit-scrollbar{ display:none; }
.subcat-card{ display:flex; flex:0 0 auto; flex-direction:column; align-items:center; gap:8px; width:96px; scroll-snap-align:start; color:var(--text); }
.subcat-card__img{ width:96px; height:96px; border-radius:24px; background:var(--hover) center / cover no-repeat; transition:transform .2s var(--ease); }
.subcat-card__label{ max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; font-weight:500; }

/* Categorías comerciales */
.categories-section{ padding-block:0 24px; }
.categories-grid{ display:flex; flex-direction:column; gap:16px; }
.category-card{
    position:relative; display:flex; align-items:flex-end; width:100%; aspect-ratio:3.4 / 1; padding:22px 24px;
    overflow:hidden; border-radius:var(--radius-xl); color:#FFFFFF;
    background:var(--hover) center / cover no-repeat; transition:transform .25s var(--ease);
}
.category-card::after{ content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 65%); }
.category-card__text{ position:relative; z-index:1; display:flex; flex-direction:column; text-shadow:0 1px 8px rgba(0,0,0,.35); }
.category-card__title{ font-size:24px; font-weight:700; line-height:1.15; }
.category-card__subtitle{ margin-top:2px; color:rgba(255,255,255,.85); font-size:14px; }

@media (hover:hover){
    .active-order-card:hover{ transform:translateY(-2px); }
    .carousel-card:hover .carousel-card__ph{ transform:translateY(-2px); }
    .subcat-card:hover .subcat-card__img{ transform:translateY(-2px); }
    .category-card:hover{ transform:translateY(-2px); }
}

/* Esqueletos con el mismo tamaño que las tarjetas reales */
.sk-carousel{ flex:0 0 100%; aspect-ratio:2.15 / 1; border-radius:var(--radius-xl); }
.sk-subcat{ display:flex; flex:0 0 auto; flex-direction:column; align-items:center; gap:8px; width:96px; }
.sk-subcat span:first-child{ width:96px; height:96px; border-radius:24px; }
.sk-subcat span:last-child{ width:64px; height:12px; border-radius:6px; }
.sk-cat{ width:100%; aspect-ratio:3.4 / 1; border-radius:var(--radius-xl); }

/* Instalar como app */
.install-section{ padding-block:0 48px; }
.install-card{
    display:flex; gap:14px; padding:18px; border-radius:var(--radius-lg);
    border:1px solid rgba(54,191,177,.3); background:linear-gradient(135deg, rgba(54,191,177,.1), rgba(3,140,115,.05));
}
.install-icon{
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
    width:40px; height:40px; border-radius:50%; color:var(--brand-fg); background:rgba(54,191,177,.15);
}
.install-icon svg{ width:20px; height:20px; }
.install-title{ margin-bottom:6px; color:var(--brand-fg); font-size:14px; font-weight:600; }
.install-steps{ display:flex; flex-direction:column; gap:6px; }
.install-step{ display:flex; align-items:flex-start; gap:8px; color:var(--text-muted); font-size:13px; line-height:1.45; }
.install-step svg{ flex-shrink:0; width:16px; height:16px; margin-top:2px; }
.install-step b{ color:var(--text); font-weight:600; }

/* ── Escritorio ── */
@media (min-width:768px){
    .icon-button{ width:48px; height:48px; }
    .icon-button svg{ width:28px; height:28px; }
    .logo svg{ height:19px; }
    .carousel-card{ flex-basis:calc(50% - 8px); }
    .subcat-card{ width:104px; }
    .subcat-card__img{ width:104px; height:104px; }
    .sk-subcat{ width:104px; }
    .sk-subcat span:first-child{ width:104px; height:104px; }
    .categories-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:20px; }
    .category-card, .sk-cat{ aspect-ratio:2 / 1; }
}
@media (min-width:1024px){
    .container, .topbar{ padding-inline:50px; }
    .logo svg{ height:21px; }
    .carousel-track{ gap:24px; }
    .carousel-card{ flex-basis:calc(33.3333% - 16px); }
    .subcats-track{ gap:28px; }
    .subcat-card{ width:116px; }
    .subcat-card__img{ width:116px; height:116px; }
    .sk-subcat{ width:116px; }
    .sk-subcat span:first-child{ width:116px; height:116px; }
    .categories-grid{ grid-template-columns:repeat(4, 1fr); gap:24px; }
    .category-card, .sk-cat{ aspect-ratio:1.5 / 1; }
}
@media (min-width:1440px){
    .container, .topbar{ padding-inline:70px; }
    .logo svg{ height:22px; }
}
@media (min-width:1920px){
    .container, .topbar{ padding-inline:90px; }
}
