/* Tía Vicenta v430 · tema estable y carga segura
   Mantiene lógica PWA intacta. Solo oculta visualmente el botón superior de instalar. */

/* Botón superior de instalar: no visible, pero existe para la lógica interna */
html body .top-actions #installBtn,
html body .top-actions .install-cta,
html body .top-actions .tv-pwa-install-v285{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  clip-path:inset(50%)!important;
}

/* Paleta estable */
html[data-theme="light"]{
  color-scheme:light;
  --tv-bg-1:#fff8ef!important;
  --tv-bg-2:#fff1df!important;
  --tv-bg-3:#f2dfc9!important;
  --tv-card:#fffdf8!important;
  --tv-card-2:#fff2df!important;
  --tv-card-3:#ffffff!important;
  --tv-text:#181827!important;
  --tv-text-soft:#6d5f52!important;
  --tv-line:rgba(97,61,24,.16)!important;
  --tv-line-strong:rgba(255,152,27,.34)!important;
  --tv-input:#ffffff!important;
  --tv-orange:#ff981b!important;
  --tv-orange-2:#ff7f0e!important;
  --tv-shadow:0 18px 48px rgba(66,39,13,.13)!important;
  --tv-shadow-sm:0 12px 26px rgba(66,39,13,.09)!important;
}

html[data-theme="dark"]{
  color-scheme:dark;
  --tv-bg-1:#0d0908!important;
  --tv-bg-2:#140e0c!important;
  --tv-bg-3:#1b120f!important;
  --tv-card:#211713!important;
  --tv-card-2:#2a1e17!important;
  --tv-card-3:#17100d!important;
  --tv-text:#fff7ec!important;
  --tv-text-soft:#d8c2aa!important;
  --tv-line:rgba(255,219,176,.16)!important;
  --tv-line-strong:rgba(255,174,69,.36)!important;
  --tv-input:#17100d!important;
  --tv-orange:#ffae45!important;
  --tv-orange-2:#ff8d1a!important;
  --tv-shadow:0 24px 68px rgba(0,0,0,.52)!important;
  --tv-shadow-sm:0 15px 36px rgba(0,0,0,.38)!important;
}

/* Fondo y texto base */
html body{
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb,var(--tv-orange) 13%, transparent), transparent 30rem),
    linear-gradient(180deg,var(--tv-bg-1),var(--tv-bg-2) 46%,var(--tv-bg-3))!important;
  color:var(--tv-text)!important;
}
html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 12% -4%, rgba(255,151,35,.13), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(255,151,35,.08), transparent 26rem),
    linear-gradient(180deg,#0b0807,#130d0b 46%,#1b120f)!important;
}

/* Texto global controlado */
html body h1,
html body h2,
html body h3,
html body h4,
html body b,
html body strong,
html body label,
html body .brand-title,
html body .drawer-title,
html body .category-title,
html body .product h3,
html body .cart-name,
html body .checkout-title,
html body .modal-card h2,
html body .modal-card h3,
html body .modal-card h4{
  color:var(--tv-text)!important;
}

html body p,
html body small,
html body .brand-tag,
html body .drawer-sub,
html body .category-meta,
html body .desc,
html body .cart-details,
html body .cart-unit-price,
html body .modal-sub,
html body .choice p,
html body .choice small,
html body .tv-business-action-copy-v420 small{
  color:var(--tv-text-soft)!important;
}

/* Superficies */
html body .topbar-inner,
html body .tv-business-actions-v420,
html body .category,
html body .product,
html body .modal-card,
html body #cartDrawer,
html body .cart-item,
html body .cart-addons-pro,
html body .cart-addons-pro-card,
html body .checkout-panel,
html body .summary-row,
html body .choice,
html body .tv-hours-card-v420,
html body .hours-popover{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  border:1px solid var(--tv-line)!important;
  color:var(--tv-text)!important;
  box-shadow:var(--tv-shadow-sm)!important;
}

html body .topbar-inner{
  background:color-mix(in srgb,var(--tv-card) 88%, transparent)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
  box-shadow:var(--tv-shadow)!important;
}
html[data-theme="dark"] body .topbar-inner{
  background:rgba(24,17,14,.90)!important;
}

/* Header y botones */
html body .top-actions{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  flex-wrap:nowrap!important;
}
html body .pill-btn,
html body .tv-business-action-v420,
html body .details-btn,
html body .add-btn,
html body .icon-btn,
html body .search-clear,
html body .close-categories-btn,
html body .checkout-back,
html body .cart-clear-btn,
html body #cartFloatBtn{
  border-radius:18px!important;
  border:1px solid var(--tv-line)!important;
  color:var(--tv-text)!important;
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  box-shadow:0 12px 26px color-mix(in srgb,#000 10%, transparent)!important;
}

/* CTAs naranjas */
html body .add-btn,
html body #cartFloatBtn,
html body #continueBtn,
html body #checkoutBtn,
html body .modal-foot .primary,
html body .tv-hours-ok-v420,
html body .card-qty-plus,
html body .qty-control button:last-child,
html body .cart-addon-pro-control button:last-child{
  background:linear-gradient(180deg,var(--tv-orange),var(--tv-orange-2))!important;
  color:#211100!important;
  border-color:transparent!important;
  font-weight:1000!important;
}

/* Buscador */
html body .search{
  background:var(--tv-input)!important;
  border:1px solid var(--tv-line)!important;
  color:var(--tv-text)!important;
  box-shadow:0 14px 32px color-mix(in srgb,#000 10%, transparent)!important;
}
html body .search input{
  background:transparent!important;
  color:var(--tv-text)!important;
}
html body .search input::placeholder{
  color:color-mix(in srgb,var(--tv-text-soft) 75%, transparent)!important;
}
html body .search:focus-within{
  border-color:var(--tv-line-strong)!important;
  box-shadow:0 0 0 4px rgba(255,152,27,.24),0 16px 34px color-mix(in srgb,#000 12%, transparent)!important;
}

/* Fotos */
html body .product{
  overflow:hidden!important;
}
html body .product-media{
  background:#fff8ef!important;
}
html[data-theme="dark"] body .product-media{
  background:#fff3e5!important;
}
html body .product-media img{
  background:#fff8ef!important;
}

/* Precios y acentos */
html body .price,
html body .cart-category,
html body .section-kicker,
html body .checkout-kicker,
html body .drawer-eyebrow,
html body .tv-delivery-action-v428 small,
html body #appActionSmall{
  color:var(--tv-orange)!important;
}

/* Controles + / - */
html body .card-buy-control,
html body .qty-control,
html body .cart-addon-pro-control{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  border:1px solid var(--tv-line)!important;
  border-radius:16px!important;
  overflow:hidden!important;
  color:var(--tv-text)!important;
}
html body .card-qty-number,
html body .qty-control span,
html body .cart-addon-pro-control span{
  color:var(--tv-text)!important;
  background:transparent!important;
}
html body .card-qty-minus,
html body .qty-control button:first-child,
html body .cart-addon-pro-control button:first-child{
  background:color-mix(in srgb,var(--tv-card) 82%, #000 7%)!important;
  color:var(--tv-text)!important;
}
html[data-theme="dark"] body .card-qty-minus,
html[data-theme="dark"] body .qty-control button:first-child,
html[data-theme="dark"] body .cart-addon-pro-control button:first-child{
  background:rgba(255,255,255,.075)!important;
  color:#fff7ec!important;
}

/* Modal y opciones */
html body .modal-backdrop.show,
html body .drawer-backdrop.show{
  background:rgba(8,5,4,.62)!important;
  backdrop-filter:blur(9px)!important;
  -webkit-backdrop-filter:blur(9px)!important;
}
html[data-theme="dark"] body .modal-card{
  background:linear-gradient(180deg,#241914,#1a120f)!important;
  border-color:rgba(255,225,184,.16)!important;
}
html body .choice,
html body .choice-card,
html body .option-card,
html body .modal-card [role="radio"]{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  color:var(--tv-text)!important;
  border:1px solid var(--tv-line)!important;
}
html body .choice *,
html body .choice-card *,
html body .option-card *{
  color:inherit!important;
}
html body .choice.selected,
html body .choice.is-selected,
html body .choice[aria-checked="true"],
html body .choice:has(input:checked),
html body .option-card.selected,
html body .option-card.is-selected{
  background:linear-gradient(180deg,#fff1d4,#ffdba0)!important;
  border-color:rgba(255,152,27,.55)!important;
  color:#1d1308!important;
  box-shadow:0 0 0 3px rgba(255,152,27,.18),0 18px 36px rgba(69,42,12,.16)!important;
}
html[data-theme="dark"] body .choice.selected,
html[data-theme="dark"] body .choice.is-selected,
html[data-theme="dark"] body .choice[aria-checked="true"],
html[data-theme="dark"] body .choice:has(input:checked),
html[data-theme="dark"] body .option-card.selected,
html[data-theme="dark"] body .option-card.is-selected{
  background:linear-gradient(180deg,#4a2d13,#35200f)!important;
  border-color:rgba(255,174,69,.72)!important;
  color:#fff7ec!important;
  box-shadow:0 0 0 3px rgba(255,174,69,.18),0 20px 42px rgba(0,0,0,.36)!important;
}
html body .choice.selected *,
html body .choice.is-selected *,
html body .choice[aria-checked="true"] *,
html body .choice:has(input:checked) *,
html body .option-card.selected *,
html body .option-card.is-selected *{
  color:inherit!important;
}

/* Inputs */
html body .modal-card textarea,
html body .modal-card input,
html body .modal-card select,
html body #cartDrawer input,
html body #cartDrawer textarea,
html body #cartDrawer select{
  background:var(--tv-input)!important;
  color:var(--tv-text)!important;
  border:1px solid var(--tv-line)!important;
  border-radius:16px!important;
}
html body .modal-card textarea::placeholder,
html body .modal-card input::placeholder,
html body #cartDrawer input::placeholder,
html body #cartDrawer textarea::placeholder{
  color:color-mix(in srgb,var(--tv-text-soft) 70%, transparent)!important;
}

/* Footer modal */
html body .modal-foot{
  background:linear-gradient(180deg,transparent,var(--tv-card-2))!important;
  border-top:1px solid var(--tv-line)!important;
}
html body .modal-foot .btn:not(.primary){
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  color:var(--tv-text)!important;
  border:1px solid var(--tv-line)!important;
}

/* Carrito */
html body #cartDrawer{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  color:var(--tv-text)!important;
}
html[data-theme="dark"] body #cartDrawer{
  background:linear-gradient(180deg,#211713,#160f0d)!important;
}
html body #cartDrawer .drawer-head,
html body #cartDrawer .drawer-foot,
html body #cartDrawer .checkout-panel{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  border-color:var(--tv-line)!important;
}
html body #cartDrawer .cart-item,
html body #cartDrawer .cart-addons-pro-card,
html body #cartDrawer .cart-empty{
  background:linear-gradient(180deg,var(--tv-card),var(--tv-card-2))!important;
  color:var(--tv-text)!important;
  border:1px solid var(--tv-line)!important;
}
html body #cartDrawer .cart-item *,
html body #cartDrawer .cart-addons-pro-card *,
html body #cartDrawer .cart-empty *{
  color:inherit;
}
html body #cartDrawer .cart-addon-pro-copy small,
html body #cartDrawer .cart-unit-price,
html body #cartDrawer .cart-details{
  color:var(--tv-text-soft)!important;
}
html body #cartDrawer .cart-addon-pro-copy strong,
html body #cartDrawer .cart-line-total strong,
html body #cartDrawer .cart-name{
  color:var(--tv-text)!important;
}

/* Tabs agregados */
html body #cartAddonsV409Tabs{
  background:color-mix(in srgb,var(--tv-card) 76%, transparent)!important;
  border:1px solid var(--tv-line)!important;
  border-radius:18px!important;
}
html body #cartAddonsV409Tabs [data-v409-addon-tab]{
  color:var(--tv-text-soft)!important;
  border-radius:14px!important;
}
html body #cartAddonsV409Tabs [data-v409-addon-tab].active,
html body #cartAddonsV409Tabs [data-v409-addon-tab][aria-pressed="true"]{
  background:linear-gradient(180deg,var(--tv-orange),var(--tv-orange-2))!important;
  color:#211100!important;
}

/* Tema button */
html body #themeBtn{
  min-width:144px!important;
}
html body #themeBtn,
html body #themeBtn *{
  color:inherit!important;
}
html[data-theme="dark"] body #themeBtn{
  background:linear-gradient(180deg,#232841,#151a2b)!important;
  color:#fff7ec!important;
  border-color:rgba(255,226,190,.16)!important;
}
html[data-theme="light"] body #themeBtn{
  background:linear-gradient(180deg,#fff6dc,#ffd886)!important;
  color:#231505!important;
}

/* Carga segura: si quedó overlay viejo no bloquea */
html.app-ready body #appBoot,
html:not(.app-loading) body #appBoot{
  opacity:0!important;
  pointer-events:none!important;
}

/* Focus */
html body button:focus-visible,
html body a:focus-visible,
html body input:focus-visible,
html body textarea:focus-visible,
html body select:focus-visible{
  outline:3px solid rgba(255,152,27,.26)!important;
  outline-offset:2px!important;
}

/* Responsive */
@media (max-width:980px){
  html body .top-actions{ gap:8px!important; }
  html body #themeBtn{ min-width:0!important; }
  html body .tv-business-actions-v420{ grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}
@media (max-width:520px){
  html body .tv-business-actions-v420{ grid-template-columns:1fr!important; }
}
