/* Catálogo: fotos completas, una sola tonalidad de acción y precios legibles. */
.portal-header { box-shadow: none; }
.header-titles h1 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); }
.badge-status, .product-tag { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.margin-calculator-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; box-shadow: none; padding: 10px 16px; }
.margin-calc-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0; }
.margin-calc-header::-webkit-details-marker { display: none; }
.margin-calc-title h3, .margin-calc-header h3 { font-size: .95rem; color: #0f172a; line-height: 1.4; }
.calc-subtitle { font-size: .8rem; line-height: 1.5; margin-top: 4px; }
.calculator-toggle-text { flex-shrink: 0; font-size: .8rem; color: #1d4ed8; font-weight: 700; }
.margin-calculator-panel .margin-controls { margin: 0; padding: 0; border: 0; }
.margin-controls[hidden] { display: none !important; }
.margin-calc-header { flex: 1 1 270px; }
.calculator-switch { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.calculator-switch .switch-label { cursor: pointer; font-size: .8rem; color: #475569; }
.calculator-switch .switch-container { display: inline-flex; align-items: center; min-height: 44px; }
.calculator-switch .switch-slider { top: 10px; bottom: 10px; }
.calculator-switch input:focus-visible + .switch-slider { outline: 3px solid #2563eb; outline-offset: 3px; }
.margin-presets-label { color: #334155; }
.margin-help-text { color: #64748b; font-size: .8rem; line-height: 1.6; }
.margin-preset-btn { min-height: 44px; background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.margin-preset-btn.active { color: #1d4ed8; background: #eff6ff; border-color: #93c5fd; box-shadow: none; }
.custom-margin-input { font-size: 16px; }
.products-container.view-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 24px; }
.product-card { box-shadow: none; border-radius: 16px; }
.product-card:hover { transform: none; border-color: #cbd5e1; box-shadow: 0 8px 24px #0f172a0a; }
.product-card.card-agotado { background: #fff; border-color: #e2e8f0; }
.product-image-container { height: auto; aspect-ratio: 4 / 5; background: #f5f5f4; border-bottom: 1px solid #e2e8f0; }
.product-photo-button { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0; border: 0; background: #f5f5f4; color: #475569; cursor: zoom-in; overflow: hidden; }
.product-image { display: block; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.product-card:hover .product-image { transform: none; }
.photo-enlarge-hint { position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; background: #ffffffed; border: 1px solid #e2e8f0; border-radius: 20px; color: #334155; font-size: .75rem; line-height: 1.4; }
.product-photo-button:hover .photo-enlarge-hint { background: #fff; border-color: #94a3b8; }
.product-photo-button.photo-unavailable { cursor: default; }
.product-photo-button.photo-unavailable .photo-enlarge-hint { position: static; }
.product-image[hidden], #productPhotoImage[hidden] { display: none; }
.image-placeholder { font-size: .875rem; color: #64748b; background: #f5f5f4; }
.product-badges-row { justify-content: space-between; margin-bottom: 10px; }
.product-stock-label, .product-badge-agotado { font-size: .75rem; font-weight: 500; color: #64748b; background: transparent; border: 0; padding: 3px 0; }
.product-name { line-height: 1.4; font-size: 1.1rem; }
.product-description { line-height: 1.6; color: #64748b; }
.product-info { min-width: 0; padding: 20px; gap: 0; }
.sizes-container { margin-bottom: 18px; }
.sizes-badges-wrap { gap: 8px; }
.size-badge { min-width: 40px; min-height: 40px; padding: 8px 10px; font: 600 .8rem/1.2 system-ui, sans-serif; border: 1px solid #dbe1e8; border-radius: 8px; background: #fff; color: #475569; cursor: pointer; }
.size-badge.selected { background: #eff6ff; color: #1d4ed8; border-color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; }
.pricing-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-top: auto; margin-bottom: 16px; }
.pricing-standard { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.pricing-standard .price-label { color: #64748b; font-size: .8rem; text-transform: none; letter-spacing: 0; }
.pricing-standard .price-amount { font-size: 1.6rem; color: #0f172a; font-weight: 800; font-variant-numeric: tabular-nums; }
.pricing-breakdown { display: flex; flex-direction: column; gap: 10px; }
.price-row { gap: 12px; line-height: 1.5; }
.price-row.cost-row, .price-row.profit-row { font-size: .8rem; color: #64748b; font-weight: 500; }
.price-row > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.profit-pill { background: transparent; padding: 0; color: #334155; font-size: .85rem; font-weight: 700; }
.price-row.pvp-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.pvp-label { color: #334155; font-size: .8rem; font-weight: 600; }
.pvp-value { color: #1d4ed8; font-size: 1.6rem; font-weight: 800; }
.whatsapp-btn, .list-action-btn { min-height: 46px; background: #1d4ed8; color: #fff; font-size: .875rem; line-height: 1.5; padding: 12px; }
.whatsapp-btn:hover, .list-action-btn:hover { background: #1e40af; transform: none; }
.whatsapp-btn.btn-agotado { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.product-list-item { min-width: 0; gap: 20px; box-shadow: none; }
.product-photo-small { width: 96px; height: 120px; flex-shrink: 0; border-radius: 10px; border: 1px solid #e2e8f0; }
.product-photo-small .list-thumb { width: 100%; height: 100%; object-fit: contain; border: 0; padding: 4px; border-radius: 0; }
.product-photo-small .photo-enlarge-hint { right: 4px; bottom: 4px; left: 4px; padding: 3px; text-align: center; font-size: .6rem; }
.list-thumb-placeholder { width: 96px; height: 120px; font-size: .75rem; }
.list-name { margin: 0; font-size: 1rem; line-height: 1.5; }
.list-title-row { margin-bottom: 10px; }
.list-sizes-row .sizes-badges-wrap { gap: 6px; }
.list-item-footer { width: min(45%, 320px); min-width: 220px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.list-pricing-box { width: 100%; min-width: 0; text-align: left; }
.list-item-footer .whatsapp-btn { width: 100%; white-space: normal; }
.product-photo-dialog { width: min(1000px, calc(100% - 32px)); max-height: 94dvh; padding: 20px; margin: auto; background: #fff; border: 0; border-radius: 18px; color: #0f172a; overflow-y: auto; overscroll-behavior: contain; }
.product-photo-dialog::backdrop { background: #0f172acc; }
.product-photo-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; }
.product-photo-header h2 { margin: 0; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
#closeProductPhoto { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #e2e8f0; border-radius: 50%; background: #fff; color: #334155; font-size: 20px; cursor: pointer; }
.product-photo-stage { display: flex; align-items: center; justify-content: center; min-height: 100px; background: #f5f5f4; border-radius: 10px; }
#productPhotoImage { display: block; width: 100%; height: auto; max-height: 74dvh; object-fit: contain; }
#productPhotoStatus { font: .875rem/1.5 system-ui,sans-serif; color: #64748b; margin-top: 10px; }
.product-photo-button:focus-visible, .size-badge:focus-visible, summary.margin-calc-header:focus-visible, #closeProductPhoto:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
@media (max-width: 768px) {
    .products-container.view-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .product-card { max-width: 520px; width: 100%; justify-self: center; }
    .product-image-container { height: auto; max-height: 480px; }
    .product-info { padding: 18px; }
    .margin-calc-header { align-items: center; flex-direction: row; gap: 12px; padding: 0; }
    .margin-calculator-panel .margin-controls { margin: 0; width: 100%; }
    .margin-presets { flex-wrap: wrap; }
    .product-list-item { padding: 16px; }
    .list-item-main { align-items: flex-start; }
    .list-item-footer { width: 100%; min-width: 0; }
    .product-photo-small { width: 80px; height: 104px; }
    .list-thumb-placeholder { width: 80px; height: 104px; }
    .size-badge { min-height: 44px; }
    .product-photo-dialog { width: calc(100% - 16px); padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .product-card, .product-image, .whatsapp-btn { transition: none; }
}
/* Mantener visibles los nombres de las vistas al retirar sus iconos anteriores. */
.view-toggle-btn .view-text { display: inline; }
.view-toggle-btn { min-height: 44px; }
.tabs-navigation { flex-wrap: wrap; overflow: visible; }
.tab-btn { min-height: 40px; }
.clear-filters-btn { background: #f1f5f9; color: #475569; }
.clear-filters-btn:hover { background: #e2e8f0; }
@media (max-width: 768px) {
    .search-bar-row { flex-wrap: wrap; }
    .search-input-wrapper { min-width: 0; flex: 1 1 100%; }
    .search-box { font-size: 16px; }
    .view-toggle-group { align-self: flex-end; }
}
.product-list-item.card-agotado { background: #fff; border-color: #e2e8f0; }
.custom-margin-box { min-height: 44px; }
.custom-margin-input { width: 130px; min-height: 38px; }

/* Descargar la imagen original desde el visor. */
.product-photo-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#downloadProductPhoto { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #1d4ed8; font: 600 .8rem/1.4 system-ui, sans-serif; cursor: pointer; }
#downloadProductPhoto:hover { background: #eff6ff; }
#downloadProductPhoto:disabled { color: #94a3b8; cursor: wait; }
#downloadProductPhoto:focus-visible, .product-photo-original:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.product-photo-original { display: inline-block; min-height: 44px; margin-top: 8px; padding: 10px 0; color: #1d4ed8; font: 600 .875rem/1.5 system-ui, sans-serif; }
.product-photo-original[hidden] { display: none; }
@media (max-width: 600px) { #downloadProductPhoto span { display: none; } #downloadProductPhoto { padding: 10px; } }
/* Carrusel sin avance automático: flechas y gesto horizontal. */
.product-carousel { position: relative; width: 100%; height: 100%; min-width: 0; }
.product-carousel:not(.product-photo-small) { aspect-ratio: 4 / 5; }
.product-carousel .product-photo-button { touch-action: pan-y pinch-zoom; }
.product-carousel.product-photo-small { width: 96px; height: 120px; flex-shrink: 0; }
.carousel-position { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 16px; border: 1px solid #e2e8f0; background: #fffffff0; color: #334155; font: 600 .75rem/1.4 system-ui,sans-serif; pointer-events: none; }
.carousel-controls { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; }
.carousel-controls button, .photo-viewer-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 1px solid #cbd5e1; background: #fffffff0; color: #334155; font: 28px/1 system-ui,sans-serif; cursor: pointer; box-shadow: 0 2px 8px #0f172a0d; }
.carousel-controls button { pointer-events: auto; }
.carousel-controls button:hover, .photo-viewer-arrow:hover { background: #fff; border-color: #94a3b8; }
.product-photo-small.has-multiple .photo-enlarge-hint { display: none; }
.product-photo-small .carousel-position { left: 50%; transform: translateX(-50%); bottom: 4px; padding: 2px 5px; font-size: .6rem; white-space: nowrap; }
.product-photo-small .carousel-controls { left: 0; right: 0; }
.product-photo-stage { position: relative; }
.photo-viewer-arrow { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
.photo-viewer-previous { left: 8px; }
.photo-viewer-next { right: 8px; }
.photo-viewer-arrow[hidden] { display: none; }
#productPhotoImage { touch-action: pan-y pinch-zoom; }
.photo-viewer-counter { text-align: center; color: #64748b; font: .8rem/1.5 system-ui,sans-serif; margin-top: 10px; }
.carousel-controls button:focus-visible, .photo-viewer-arrow:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
@media (max-width: 768px) { .product-carousel.product-photo-small { width: 96px; height: 120px; } }

/* Acceso directo a la guía para la talla seleccionada. */
.view-size-measures { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: #1d4ed8; font: 600 .8rem/1.5 system-ui,sans-serif; text-align: left; cursor: pointer; }
.view-size-measures:hover { text-decoration: underline; }
.view-size-measures:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; border-radius: 4px; }
.measure-size-label { color: #64748b; font-weight: 500; }
.list-sizes-row .view-size-measures { flex-basis: 100%; }
