/* Tía Vicenta v426 · Corrección puntual Día/Noche del carrito
   Solo presentación del drawer/carrito. No toca lógica ni almacenamiento. */

html[data-theme="light"]{
  --tv-cart-bg:#fff8ef;
  --tv-cart-bg-2:#fff2e3;
  --tv-cart-surface:#ffffff;
  --tv-cart-surface-2:#fffaf4;
  --tv-cart-surface-3:#fff0dd;
  --tv-cart-text:#171927;
  --tv-cart-muted:#6f6359;
  --tv-cart-line:rgba(84,54,24,.14);
  --tv-cart-line-strong:rgba(255,148,22,.32);
  --tv-cart-accent:#ff9416;
  --tv-cart-accent-2:#f47c12;
  --tv-cart-danger:#e54848;
  --tv-cart-ok:#169c55;
  --tv-cart-input:#ffffff;
  --tv-cart-shadow:0 26px 70px rgba(62,36,12,.16);
  --tv-cart-shadow-sm:0 12px 28px rgba(62,36,12,.09);
  --tv-cart-backdrop:rgba(19,12,6,.48);
}

html[data-theme="dark"]{
  --tv-cart-bg:#12100f;
  --tv-cart-bg-2:#1b1512;
  --tv-cart-surface:#211a16;
  --tv-cart-surface-2:#2b211b;
  --tv-cart-surface-3:#34271f;
  --tv-cart-text:#fff8ef;
  --tv-cart-muted:#d8c5b2;
  --tv-cart-line:rgba(255,230,196,.16);
  --tv-cart-line-strong:rgba(255,173,61,.34);
  --tv-cart-accent:#ffad3d;
  --tv-cart-accent-2:#ff8617;
  --tv-cart-danger:#ff7a7a;
  --tv-cart-ok:#63e69a;
  --tv-cart-input:#181311;
  --tv-cart-shadow:0 28px 84px rgba(0,0,0,.52);
  --tv-cart-shadow-sm:0 14px 36px rgba(0,0,0,.36);
  --tv-cart-backdrop:rgba(0,0,0,.64);
}

/* Backdrop */
html body #drawerBackdrop.drawer-backdrop,
html body #drawerBackdrop.show,
html body .drawer-backdrop.show{
  background:var(--tv-cart-backdrop)!important;
  backdrop-filter:blur(9px)!important;
  -webkit-backdrop-filter:blur(9px)!important;
}

/* Drawer raíz */
html body #cartDrawer,
html body #cartDrawer.drawer,
html body #cartDrawer.drawer.show{
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb,var(--tv-cart-accent) 16%, transparent), transparent 40%),
    linear-gradient(180deg,var(--tv-cart-bg) 0%,var(--tv-cart-bg-2) 100%)!important;
  color:var(--tv-cart-text)!important;
  border-left:1px solid var(--tv-cart-line)!important;
  box-shadow:var(--tv-cart-shadow)!important;
}

/* Variables locales para cualquier regla vieja que use var(--surface/--card/--text) dentro del carrito */
html body #cartDrawer{
  --surface:var(--tv-cart-bg)!important;
  --surface2:var(--tv-cart-surface-2)!important;
  --card:var(--tv-cart-surface)!important;
  --text:var(--tv-cart-text)!important;
  --muted:var(--tv-cart-muted)!important;
  --line:var(--tv-cart-line)!important;
  --accent:var(--tv-cart-accent)!important;
  --accent2:var(--tv-cart-accent-2)!important;
  --danger:var(--tv-cart-danger)!important;
  --green:var(--tv-cart-ok)!important;
}

/* Cabecera, cuerpo y pie */
html body #cartDrawer .drawer-head,
html body #cartDrawer .drawer-header,
html body #cartDrawer .drawer-body,
html body #cartDrawer .drawer-foot,
html body #cartDrawer .cart-footer,
html body #cartDrawer .modal-foot{
  color:var(--tv-cart-text)!important;
  border-color:var(--tv-cart-line)!important;
}

html body #cartDrawer .drawer-head,
html body #cartDrawer .drawer-header{
  background:linear-gradient(180deg,color-mix(in srgb,var(--tv-cart-surface) 94%, transparent),color-mix(in srgb,var(--tv-cart-surface-2) 90%, transparent))!important;
  border-bottom:1px solid var(--tv-cart-line)!important;
  box-shadow:0 10px 28px color-mix(in srgb,#000 10%, transparent)!important;
}

html body #cartDrawer .drawer-body{
  background:transparent!important;
}

html body #cartDrawer .drawer-foot,
html body #cartDrawer .cart-footer{
  background:linear-gradient(180deg,color-mix(in srgb,var(--tv-cart-surface) 96%, transparent),var(--tv-cart-surface-2))!important;
  border-top:1px solid var(--tv-cart-line)!important;
  box-shadow:0 -14px 34px color-mix(in srgb,#000 10%, transparent)!important;
}

/* Textos */
html body #cartDrawer,
html body #cartDrawer *{
  scrollbar-color:color-mix(in srgb,var(--tv-cart-accent) 62%, var(--tv-cart-surface)) var(--tv-cart-bg-2);
}

html body #cartDrawer .drawer-title,
html body #cartDrawer h2,
html body #cartDrawer h3,
html body #cartDrawer h4,
html body #cartDrawer .cart-name,
html body #cartDrawer .cart-line-total strong,
html body #cartDrawer .summary-row strong,
html body #cartDrawer .checkout-title,
html body #cartDrawer .checkout-section-title,
html body #cartDrawer .cart-addon-pro-head b,
html body #cartDrawer .cart-addon-pro-copy b,
html body #cartDrawer .cart-addon-pro-copy strong,
html body #cartDrawer label,
html body #cartDrawer b,
html body #cartDrawer strong{
  color:var(--tv-cart-text)!important;
}

html body #cartDrawer .drawer-sub,
html body #cartDrawer .cart-details,
html body #cartDrawer .cart-unit-price,
html body #cartDrawer .cart-line-total small,
html body #cartDrawer .summary-row span,
html body #cartDrawer .checkout-hint,
html body #cartDrawer .cart-addon-pro-head small,
html body #cartDrawer .cart-addon-pro-copy small,
html body #cartDrawer small,
html body #cartDrawer p{
  color:var(--tv-cart-muted)!important;
}

/* Items del carrito */
html body #cartDrawer .cart-item,
html body #cartDrawer .tv409-cart-item,
html body #cartDrawer .tv410-cart-item{
  background:linear-gradient(180deg,var(--tv-cart-surface),var(--tv-cart-surface-2))!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
  box-shadow:var(--tv-cart-shadow-sm)!important;
}

html body #cartDrawer .cart-item-main,
html body #cartDrawer .cart-item-foot{
  color:var(--tv-cart-text)!important;
}

html body #cartDrawer .cart-thumb-wrap,
html body #cartDrawer .cart-thumb{
  background:#fffaf2!important;
  border-color:var(--tv-cart-line)!important;
}

html body #cartDrawer .cart-category{
  background:color-mix(in srgb,var(--tv-cart-accent) 16%, var(--tv-cart-surface))!important;
  color:var(--tv-cart-accent)!important;
  border:1px solid var(--tv-cart-line-strong)!important;
}

html body #cartDrawer .cart-details{
  background:var(--tv-cart-surface-3)!important;
  border:1px solid var(--tv-cart-line)!important;
}

/* Controles cantidad */
html body #cartDrawer .qty-control,
html body #cartDrawer .cart-qty-control,
html body #cartDrawer .cart-addon-pro-control,
html body #cartDrawer .tv410-addon-control{
  background:var(--tv-cart-surface-2)!important;
  border:1px solid var(--tv-cart-line)!important;
  color:var(--tv-cart-text)!important;
  box-shadow:none!important;
}

html body #cartDrawer .qty-control span,
html body #cartDrawer .cart-addon-pro-control span,
html body #cartDrawer .tv410-addon-control span{
  background:transparent!important;
  color:var(--tv-cart-text)!important;
}

html body #cartDrawer .qty-control button,
html body #cartDrawer .cart-addon-pro-control button,
html body #cartDrawer .tv410-addon-control button{
  background:var(--tv-cart-surface-3)!important;
  color:var(--tv-cart-text)!important;
  border-color:transparent!important;
}

html body #cartDrawer .qty-control button:last-child,
html body #cartDrawer .cart-addon-pro-control button:last-child,
html body #cartDrawer .tv410-addon-control button:last-child{
  background:linear-gradient(180deg,var(--tv-cart-accent),var(--tv-cart-accent-2))!important;
  color:#211100!important;
}

html body #cartDrawer .qty-control button:disabled,
html body #cartDrawer .cart-addon-pro-control button:disabled{
  opacity:.42!important;
  filter:saturate(.7)!important;
}

/* Eliminar / cerrar */
html body #cartDrawer .cart-remove-icon,
html body #cartDrawer .drawer-close,
html body #cartDrawer [data-close-drawer],
html body #cartDrawer .close-btn{
  background:var(--tv-cart-surface-3)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
}

html body #cartDrawer .cart-remove-icon{
  color:var(--tv-cart-danger)!important;
}

/* Totales y resumen */
html body #cartDrawer .cart-line-total,
html body #cartDrawer .summary,
html body #cartDrawer .summary-row,
html body #cartDrawer .cart-total,
html body #cartDrawer #shippingBox,
html body #cartDrawer .shipping-box{
  background:var(--tv-cart-surface-2)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
}

html body #cartDrawer #cartTotal,
html body #cartDrawer .cart-total strong,
html body #cartDrawer .total strong{
  color:var(--tv-cart-accent)!important;
}

/* Agregados dentro del carrito */
html body #cartDrawer .cart-addons-pro,
html body #cartDrawer #cartAddonsV409,
html body #cartDrawer #cartAddonsV407,
html body #cartDrawer #addonsPanel,
html body #cartDrawer .addons,
html body #cartDrawer .follow-buy{
  background:linear-gradient(180deg,var(--tv-cart-surface),var(--tv-cart-surface-2))!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line-strong)!important;
  box-shadow:var(--tv-cart-shadow-sm)!important;
}

html body #cartDrawer .cart-addon-pro-card,
html body #cartDrawer .tv410-addon-card,
html body #cartDrawer .addon-card{
  background:var(--tv-cart-surface)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
  box-shadow:none!important;
}

html body #cartDrawer .cart-addon-pro-card.is-active,
html body #cartDrawer .tv410-addon-card.is-active{
  background:linear-gradient(180deg,color-mix(in srgb,var(--tv-cart-accent) 12%, var(--tv-cart-surface)),var(--tv-cart-surface))!important;
  border-color:var(--tv-cart-line-strong)!important;
}

html body #cartDrawer .cart-addon-pro-img,
html body #cartDrawer .tv410-addon-img{
  background:#fff8ee!important;
  border:1px solid var(--tv-cart-line)!important;
}

html body #cartDrawer .cart-addon-pro-tabs,
html body #cartDrawer .addon-tabs,
html body #cartDrawer #cartAddonsV409Tabs{
  background:var(--tv-cart-surface-2)!important;
  border:1px solid var(--tv-cart-line)!important;
}

html body #cartDrawer .cart-addon-pro-tabs button,
html body #cartDrawer .addon-tabs button,
html body #cartDrawer #cartAddonsV409Tabs button{
  background:transparent!important;
  color:var(--tv-cart-muted)!important;
  border-color:transparent!important;
}

html body #cartDrawer .cart-addon-pro-tabs button.active,
html body #cartDrawer .addon-tabs button.active,
html body #cartDrawer #cartAddonsV409Tabs button.active,
html body #cartDrawer [aria-pressed="true"][data-v409-addon-tab]{
  background:linear-gradient(180deg,var(--tv-cart-accent),var(--tv-cart-accent-2))!important;
  color:#211100!important;
}

/* Checkout / formularios */
html body #cartDrawer .checkout-panel,
html body #cartDrawer #checkoutPanel,
html body #cartDrawer .checkout-card,
html body #cartDrawer .delivery-card,
html body #cartDrawer .customer-card{
  background:var(--tv-cart-surface)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
  box-shadow:var(--tv-cart-shadow-sm)!important;
}

html body #cartDrawer input,
html body #cartDrawer textarea,
html body #cartDrawer select,
html body #cartDrawer .input,
html body #cartDrawer .field{
  background:var(--tv-cart-input)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
  caret-color:var(--tv-cart-accent)!important;
}

html body #cartDrawer input::placeholder,
html body #cartDrawer textarea::placeholder{
  color:color-mix(in srgb,var(--tv-cart-muted) 78%, transparent)!important;
}

html body #cartDrawer input:focus,
html body #cartDrawer textarea:focus,
html body #cartDrawer select:focus{
  border-color:var(--tv-cart-line-strong)!important;
  box-shadow:0 0 0 4px color-mix(in srgb,var(--tv-cart-accent) 22%, transparent)!important;
  outline:none!important;
}

/* Botones principales dentro del carrito */
html body #cartDrawer .btn.primary,
html body #cartDrawer #continueBtn,
html body #cartDrawer #checkoutBtn,
html body #cartDrawer #checkoutNextBtn,
html body #cartDrawer .checkout-btn,
html body #cartDrawer .primary{
  background:linear-gradient(180deg,var(--tv-cart-accent),var(--tv-cart-accent-2))!important;
  color:#211100!important;
  border-color:transparent!important;
  box-shadow:0 14px 32px color-mix(in srgb,var(--tv-cart-accent) 26%, transparent)!important;
}

html body #cartDrawer .btn:not(.primary),
html body #cartDrawer #checkoutBackBtn,
html body #cartDrawer .secondary{
  background:var(--tv-cart-surface-2)!important;
  color:var(--tv-cart-text)!important;
  border:1px solid var(--tv-cart-line)!important;
}

/* Vacío */
html body #cartDrawer .cart-empty,
html body #cartDrawer .tv409-empty,
html body #cartDrawer .tv410-empty{
  background:var(--tv-cart-surface)!important;
  color:var(--tv-cart-text)!important;
  border:1px dashed var(--tv-cart-line-strong)!important;
}

/* Modo noche: corregir blancos residuales del carrito */
html[data-theme="dark"] body #cartDrawer [style*="background:#fff"],
html[data-theme="dark"] body #cartDrawer [style*="background: #fff"],
html[data-theme="dark"] body #cartDrawer [style*="background:white"],
html[data-theme="dark"] body #cartDrawer [style*="background: white"]{
  background:var(--tv-cart-surface)!important;
}

html[data-theme="dark"] body #cartDrawer [style*="color:#111"],
html[data-theme="dark"] body #cartDrawer [style*="color: #111"],
html[data-theme="dark"] body #cartDrawer [style*="color:#000"],
html[data-theme="dark"] body #cartDrawer [style*="color: #000"]{
  color:var(--tv-cart-text)!important;
}

/* Accesibilidad */
html body #cartDrawer :focus-visible{
  outline:3px solid color-mix(in srgb,var(--tv-cart-accent) 36%, transparent)!important;
  outline-offset:3px!important;
}

@media (max-width:560px){
  html body #cartDrawer,
  html body #cartDrawer.drawer{
    border-left:0!important;
  }

  html body #cartDrawer .drawer-head{
    background:color-mix(in srgb,var(--tv-cart-surface) 94%, transparent)!important;
  }

  html body #cartDrawer .cart-item,
  html body #cartDrawer .cart-addon-pro-card{
    border-radius:18px!important;
  }
}
