/* Forma C, subforma 1. Las reglas solo afectan la ventana seleccionada. */
#modalProducto .v3-indicadores[hidden]{display:none!important}
#modalProducto.ventana-v3{padding:0;align-items:stretch;justify-content:stretch;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;overflow:hidden}
#modalProducto.ventana-v3 .modal-panel{width:100%;max-width:none;height:100vh;height:100dvh;min-height:0;max-height:100dvh;border:0;border-radius:0;display:block;overflow:auto;overscroll-behavior:contain;box-shadow:none;animation:none;scrollbar-width:thin;background:var(--color-catalogo-modal-informacion-fondo)}
#modalProducto.ventana-v3 .modal-desktop-header,#modalProducto.ventana-v3 .modal-mobile-header{position:sticky;top:0;inset-inline:auto;z-index:30;height:0;min-height:0;padding:0;border:0;box-shadow:none;background:transparent;pointer-events:none;overflow:visible;justify-content:flex-end}
#modalProducto.ventana-v3 .modal-desktop-identidad,#modalProducto.ventana-v3 .modal-mobile-categoria{display:none}
#modalProducto.ventana-v3 .cerrar,#modalProducto.ventana-v3 .modal-mobile-cerrar{position:absolute;top:max(12px,env(safe-area-inset-top));right:clamp(12px,1.4vw,26px);width:44px;height:44px;min-height:44px;flex:none;pointer-events:auto;background:#c52232;color:#fff;border:1px solid #aa1726;border-radius:50%;box-shadow:0 2px 9px #0003;padding:12px;display:grid;place-items:center}
#modalProducto.ventana-v3 .cerrar svg,#modalProducto.ventana-v3 .modal-mobile-cerrar svg{width:100%;height:100%;stroke:#fff}
#modalProducto.ventana-v3 .modal-contenido{height:auto;min-height:100%;max-height:none;overflow:visible;display:grid;align-items:start;grid-template-columns:minmax(0,1.85fr) minmax(320px,1fr);gap:clamp(12px,1.4vw,28px);padding:8px 8px 24px}
#modalProducto.ventana-v3 .modal-galeria{grid-row:auto;height:auto;min-height:0;overflow:hidden;border:0;background:var(--color-catalogo-modal-imagen-fondo)}
#modalProducto.ventana-v3 .media-principal{height:auto;min-height:0;padding:0;max-height:none}
#modalProducto.ventana-v3 .media-principal.v3-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:stretch;background:var(--color-catalogo-modal-informacion-fondo)}
#modalProducto.ventana-v3 .v3-media-tile{grid-column:span 2;min-width:0;aspect-ratio:4/5;display:grid;place-items:center;padding:0;border:0;border-radius:0;overflow:hidden;background:var(--color-catalogo-modal-imagen-fondo);color:var(--color-catalogo-modal-nombre-texto);cursor:zoom-in}
#modalProducto.ventana-v3 .v3-media-tile:nth-child(-n+2){grid-column:span 3}
#modalProducto.ventana-v3 .v3-single .v3-media-tile{grid-column:1/-1;aspect-ratio:auto;height:min(85dvh,1000px)}
#modalProducto.ventana-v3 .v3-media-tile img{width:100%;height:100%;min-height:0;object-fit:contain;border-radius:0}
#modalProducto.ventana-v3 .v3-video-tile{cursor:pointer;font:inherit;font-weight:700;min-height:100px}
#modalProducto.ventana-v3 .modal-info{grid-row:auto;position:sticky;top:0;align-self:start;height:auto;max-height:100dvh;overflow:auto;min-width:0;padding:64px clamp(12px,1.7vw,36px) 32px 8px;background:var(--color-catalogo-modal-informacion-fondo);overscroll-behavior:auto}
#modalProducto.ventana-v3 .modal-categoria--panel{display:block;font-size:12px}
#modalProducto.ventana-v3 .modal-info h2{font-size:clamp(21px,1.65vw,34px);line-height:1.18;margin:0 0 10px;letter-spacing:0;overflow-wrap:anywhere}
#modalProducto.ventana-v3 .modal-precio{font-size:clamp(22px,1.65vw,34px);margin-bottom:16px}
#modalProducto.ventana-v3 .modal-descripcion{margin-top:26px;max-width:none;white-space:pre-line;overflow-wrap:anywhere}
#modalProducto.ventana-v3 .modal-desktop-footer,#modalProducto.ventana-v3 .modal-mobile-footer{position:static;border:0;background:transparent;box-shadow:none;grid-template-columns:minmax(0,1fr);padding:0;margin:18px 0 12px;min-height:0}
#modalProducto.ventana-v3 .modal-desktop-footer::before{display:none}
#modalProducto.ventana-v3 .modal-desktop-actions{padding:0;grid-template-columns:minmax(0,1fr) minmax(110px,.42fr);gap:10px}
#modalProducto.ventana-v3 .modal-desktop-actions .control-producto-carrito{min-width:0}
#modalProducto.ventana-v3 .modal-panel .agregar-carrito-modal{border-radius:999px}
#modalProducto.ventana-v3 .v3-colores-fotos{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:10px}
#modalProducto.ventana-v3 .v3-color{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;min-width:0;height:auto;padding:3px;border-radius:2px;box-shadow:none;overflow:hidden;background:transparent;color:var(--color-catalogo-modal-nombre-texto);border:1px solid transparent;font:inherit;font-size:11px;text-align:center;overflow-wrap:anywhere}
#modalProducto.ventana-v3 .v3-color img{display:block;width:100%;aspect-ratio:4/5;object-fit:contain;background:var(--color-catalogo-modal-imagen-fondo);border:1px solid var(--color-catalogo-modal-borde)}
#modalProducto.ventana-v3 .v3-color.seleccionada{border:2px solid var(--color-catalogo-modal-nombre-texto);padding:2px;font-weight:800}
#modalProducto.ventana-v3 .v3-color span{max-width:100%;padding:2px}
#modalProducto.ventana-v3 .v3-color:not(:has(img)){min-height:44px;justify-content:center;border:1px solid var(--color-catalogo-modal-borde)}
#modalProducto.ventana-v3 .v3-color.seleccionada:not(:has(img)){border:2px solid var(--color-catalogo-modal-nombre-texto)}
#modalProducto.ventana-v3 .v3-indicadores{display:none}
@media(min-width:921px){
 #modalProducto.ventana-v3 .modal-desktop-header{display:flex}
 #modalProducto.ventana-v3 .modal-mobile-header,#modalProducto.ventana-v3 .modal-mobile-footer{display:none}
 #modalProducto.ventana-v3 .modal-desktop-footer{display:grid}
 #modalProducto.ventana-v3 .media-principal:not(.v3-grid){min-height:280px}
 #modalProducto.ventana-v3 .media-principal.v3-grid~.indicador-media{display:none}
}
@media(min-width:1800px){#modalProducto.ventana-v3 .v3-colores-fotos{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}}
@media(max-width:920px){
 #modalProducto.ventana-v3 .modal-desktop-header,#modalProducto.ventana-v3 .modal-desktop-footer{display:none}
 #modalProducto.ventana-v3 .modal-mobile-header{display:flex}
 #modalProducto.ventana-v3 .modal-contenido{display:block;padding:0 0 calc(24px + env(safe-area-inset-bottom))}
 #modalProducto.ventana-v3 .modal-galeria{height:auto;aspect-ratio:4/5;max-height:78dvh;min-height:220px;margin:0 8px;touch-action:pan-y}
 #modalProducto.ventana-v3 .media-principal{height:100%;min-height:0;touch-action:pan-y}
 #modalProducto.ventana-v3 .media-principal img,#modalProducto.ventana-v3 .media-principal video,#modalProducto.ventana-v3 .media-principal iframe{border-radius:0;object-fit:contain}
 #modalProducto.ventana-v3 .modal-info{position:static;height:auto;max-height:none;overflow:visible;padding:20px 14px 28px}
 #modalProducto.ventana-v3 .modal-info h2{font-size:clamp(21px,5.5vw,29px)}
 #modalProducto.ventana-v3 .modal-precio{font-size:clamp(23px,6vw,32px)}
 #modalProducto.ventana-v3 .modal-mobile-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(95px,.44fr);gap:8px}
 #modalProducto.ventana-v3 .modal-mobile-footer .agregar-carrito{min-height:48px}
 #modalProducto.ventana-v3 .v3-colores-fotos{grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px}
 #modalProducto.ventana-v3 .v3-indicadores:not([hidden]){display:flex;position:absolute;bottom:10px;left:50%;transform:translateX(-50%);z-index:6;max-width:70%;gap:3px;padding:2px 4px;background:#0004;border-radius:5px}
 #modalProducto.ventana-v3 .v3-indicadores button{width:25px;height:22px;min-width:0;border:0;padding:0;background:transparent;position:relative;cursor:pointer}
 #modalProducto.ventana-v3 .v3-indicadores button:after{content:'';position:absolute;top:9px;left:2px;right:2px;height:3px;background:#ffffff80}
 #modalProducto.ventana-v3 .v3-indicadores button.activo:after{background:#fff}
 #modalProducto.ventana-v3 .indicador-media{left:10px;bottom:38px;transform:none;font-size:10px;padding:5px 7px}
 #modalProducto.ventana-v3 .abrir-zoom-modal{right:10px;bottom:38px}
}

/* Entrada de Forma C: solo al abrir, no al cambiar de variante. */
@keyframes formaCEntradaEscritorio {
  0% { transform: translate3d(100%,0,0); }
  76% { transform: translate3d(-1.2%,0,0); }
  90% { transform: translate3d(.35%,0,0); }
  100% { transform: none; }
}
@keyframes formaCEntradaMovil {
  from { transform: translate3d(0,100%,0); }
  to { transform: none; }
}
#modalProducto.ventana-v3.abierto { overflow: hidden; }
@media (min-width:921px) {
  #modalProducto.ventana-v3.abierto .modal-panel { animation: formaCEntradaEscritorio 560ms cubic-bezier(.22,.75,.28,1) both; }
}
@media (max-width:920px) {
  #modalProducto.ventana-v3.abierto .modal-panel { animation: formaCEntradaMovil 380ms cubic-bezier(.22,.8,.25,1) both; }
}
@media (prefers-reduced-motion:reduce) {
  #modalProducto.ventana-v3.abierto .modal-panel { animation: none; }
}

/* Salida y gesto de cierre exclusivos de Forma C. */
.forma-c-arrastre{display:none}
@keyframes formaCSalidaEscritorio{from{transform:translate3d(0,0,0)}to{transform:translate3d(100%,0,0)}}
@keyframes formaCSalidaMovil{from{transform:translate3d(0,var(--forma-c-y,0px),0)}to{transform:translate3d(0,100%,0)}}
#modalProducto.ventana-v3.abierto.forma-c-cerrando .modal-panel{animation:formaCSalidaEscritorio 330ms cubic-bezier(.4,0,.7,1) both;pointer-events:none}
@media(max-width:920px){
 #modalProducto.ventana-v3 .modal-mobile-header{height:44px;min-height:44px; background:var(--color-catalogo-modal-informacion-fondo)}
 #modalProducto.ventana-v3 .forma-c-arrastre{display:block;position:absolute;top:0;left:50%;transform:translateX(-50%);width:96px;height:44px;border:0;padding:0;background:transparent;pointer-events:auto;touch-action:none;cursor:grab}
 #modalProducto.ventana-v3 .forma-c-arrastre::after{content:'';position:absolute;left:25px;right:25px;top:12px;height:5px;border-radius:8px;background:var(--color-catalogo-modal-nombre-texto);opacity:.48}
 #modalProducto.ventana-v3.abierto.forma-c-arrastrando .modal-panel{animation:none;transform:translate3d(0,var(--forma-c-y,0px),0);transition:none}
 #modalProducto.ventana-v3.abierto.forma-c-retorno .modal-panel{animation:none;transform:translate3d(0,0,0);transition:transform 200ms ease-out}
 #modalProducto.ventana-v3.abierto.forma-c-cerrando .modal-panel{animation:formaCSalidaMovil 330ms cubic-bezier(.4,0,.7,1) both}
}
@media(prefers-reduced-motion:reduce){#modalProducto.ventana-v3.abierto.forma-c-cerrando .modal-panel{animation:none}}

#modalProducto.ventana-v3.abierto.forma-c-entrada-lista:not(.forma-c-cerrando) .modal-panel{animation:none}

/* Forma C: el fondo pertenece al panel móvil, no a la capa fija. */
#modalProducto.ventana-v3.abierto{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;overflow:hidden}
#modalProducto.ventana-v3 .modal-panel{flex:none;overflow-x:hidden;background:var(--color-catalogo-modal-informacion-fondo,var(--superficie,#fff))}
@media(min-width:921px){
 #modalProducto.ventana-v3.forma-c-scroll-unido .modal-info{position:static;top:auto;height:auto;max-height:none;overflow:visible;overscroll-behavior:auto}
 #modalProducto.ventana-v3.forma-c-scroll-unido .modal-contenido{height:auto;max-height:none;overflow:visible;align-items:start}
}
@media(max-width:920px){
 #modalProducto.ventana-v3 .modal-panel{width:100%;height:100vh;height:100dvh;max-height:100dvh}
 #modalProducto.ventana-v3.abierto .modal-panel{animation:formaCEntradaMovil 420ms cubic-bezier(.22,.8,.25,1) both}
 #modalProducto.ventana-v3.abierto.forma-c-cerrando .modal-panel{animation:formaCSalidaMovil 330ms cubic-bezier(.4,0,.7,1) both}
 #modalProducto.ventana-v3.abierto.forma-c-arrastrando .modal-panel{animation:none}
 #modalProducto.ventana-v3.abierto.forma-c-entrada-lista:not(.forma-c-cerrando) .modal-panel{animation:none}
}
@media(prefers-reduced-motion:reduce){#modalProducto.ventana-v3.abierto .modal-panel,#modalProducto.ventana-v3.abierto.forma-c-cerrando .modal-panel{animation:none}}
