/* KIOSCO_NINE_IMPROVEMENTS: estilos compatibles con Bootstrap 5.3, modo claro y oscuro */

.kiosco-accent-text,
.kiosco-product-price {
  color: var(--accent, #f97316) !important;
}

.kiosco-product-detail-trigger {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kiosco-product-detail-trigger:hover,
.kiosco-product-detail-trigger:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb, 249, 115, 22), .65);
  box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .14);
  outline: none;
}

#productsGrid .prod-img-wrap {
  position: relative;
}

.kiosco-product-share-button {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  z-index: 4;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 .3rem .8rem rgba(0, 0, 0, .22);
}

@keyframes kioscoProductDeepLinkPulse {
  0%, 100% {
    border-color: rgba(var(--accent-rgb, 249, 115, 22), .15);
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 249, 115, 22), 0);
  }
  30%, 70% {
    border-color: var(--accent, #f97316);
    box-shadow: 0 0 0 .38rem rgba(var(--accent-rgb, 249, 115, 22), .3);
  }
}

.kiosco-product-deeplink-highlight {
  animation: kioscoProductDeepLinkPulse .75s ease-in-out 3;
}

.kiosco-product-detail-image {
  min-height: 330px;
  height: 100%;
  max-height: 520px;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.kiosco-product-detail-image img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: contain;
  background: var(--bs-tertiary-bg);
}

.kiosco-product-detail-placeholder {
  width: 100%;
  min-height: 330px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
  font-size: 6rem;
}

.kiosco-product-price {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
}

.kiosco-product-full-description {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.kiosco-stock-progress {
  height: .65rem;
  background: var(--bs-tertiary-bg);
}

.kiosco-related-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 190px);
  gap: .9rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  padding: .25rem .15rem .85rem;
  scrollbar-width: thin;
}

.kiosco-related-card {
  scroll-snap-align: start;
  min-width: 0;
  overflow: hidden;
  border-color: var(--bs-border-color);
}

.kiosco-related-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
}

.kiosco-related-image {
  height: 112px;
  overflow: hidden;
  background: var(--bs-tertiary-bg);
}

.kiosco-related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kiosco-related-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
  font-size: 2.4rem;
}

.kiosco-related-name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.5em;
}

.kiosco-qr-canvas-wrap {
  width: min(100%, 310px);
  padding: .9rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
}

.kiosco-qr-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.kiosco-scanner-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  background: #090909;
}

.kiosco-scanner-viewport video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kiosco-scanner-frame {
  position: absolute;
  inset: 15%;
  border: 3px solid var(--accent, #f97316);
  border-radius: 1rem;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .32);
  pointer-events: none;
}

.kiosco-month-input {
  width: auto;
  min-width: 145px;
}

.kiosco-expense-summary-card {
  border-color: rgba(var(--accent-rgb, 249, 115, 22), .25);
}

.kiosco-expense-summary-card .fw-bold {
  color: var(--accent, #f97316);
  font-size: 1.05rem;
}

.kiosco-expense-chart-wrap,
.kiosco-hourly-chart-wrap {
  position: relative;
  min-height: 320px;
}

.kiosco-admin-extra-actions {
  border-top: 1px solid var(--bs-border-color);
}

@keyframes kioscoStockOutBlink {
  0%, 45%, 100% { opacity: 1; }
  50%, 95% { opacity: .35; }
}

.kiosco-stock-out-badge {
  animation: kioscoStockOutBlink 1.25s linear infinite;
}

.kiosco-import-preview-wrap {
  min-height: 265px;
  max-height: 410px;
  overflow: auto;
}

.kiosco-heatmap-month-label {
  min-width: 145px;
  text-transform: capitalize;
}

.kiosco-heatmap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.kiosco-heat-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: .25rem;
  border: 1px solid var(--bs-border-color);
}

.kiosco-heatmap-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
}

.kiosco-heatmap-weekday {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  padding: .25rem 0 .45rem;
}

.kiosco-heatmap-day {
  position: relative;
  min-height: 76px;
  border: 1px solid var(--bs-border-color);
  border-radius: .65rem;
  padding: .5rem;
  text-align: left;
  color: var(--bs-body-color);
  transition: transform .15s ease, box-shadow .15s ease;
}

button.kiosco-heatmap-day:hover,
button.kiosco-heatmap-day:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 .45rem .9rem rgba(0, 0, 0, .14);
  outline: 2px solid rgba(var(--accent-rgb, 249, 115, 22), .55);
  outline-offset: 1px;
}

.kiosco-heatmap-day-empty {
  visibility: hidden;
}

.kiosco-heatmap-day-number {
  display: block;
  font-weight: 700;
}

.kiosco-heatmap-day-count {
  position: absolute;
  right: .45rem;
  bottom: .35rem;
  font-size: .72rem;
  font-weight: 800;
}

.kiosco-heat-0 {
  background: var(--bs-tertiary-bg);
}

.kiosco-heat-1 {
  background: rgba(var(--accent-rgb, 249, 115, 22), .28);
}

.kiosco-heat-2 {
  background: rgba(var(--accent-rgb, 249, 115, 22), .58);
  color: var(--bs-emphasis-color);
}

.kiosco-heat-3 {
  background: rgba(var(--accent-rgb, 249, 115, 22), .95);
  color: #fff;
  border-color: rgba(var(--accent-rgb, 249, 115, 22), 1);
}

html[data-bs-theme="dark"] .kiosco-heat-1 {
  background: rgba(var(--accent-rgb, 249, 115, 22), .22);
}

html[data-bs-theme="dark"] .kiosco-heat-2 {
  background: rgba(var(--accent-rgb, 249, 115, 22), .52);
  color: #fff;
}

@media (max-width: 767.98px) {
  .kiosco-product-detail-image,
  .kiosco-product-detail-image img,
  .kiosco-product-detail-placeholder {
    min-height: 240px;
    max-height: 340px;
  }

  .kiosco-related-scroll {
    grid-auto-columns: minmax(145px, 72vw);
  }

  .kiosco-expense-chart-wrap,
  .kiosco-hourly-chart-wrap {
    min-height: 275px;
  }

  .kiosco-heatmap-calendar {
    gap: .25rem;
  }

  .kiosco-heatmap-day {
    min-height: 54px;
    padding: .35rem;
    border-radius: .45rem;
  }

  .kiosco-heatmap-day-count {
    right: .3rem;
    bottom: .2rem;
    font-size: .63rem;
  }

  .kiosco-heatmap-weekday {
    font-size: .65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kiosco-product-detail-trigger,
  .kiosco-heatmap-day,
  .kiosco-stock-out-badge,
  .kiosco-product-deeplink-highlight {
    transition: none !important;
    animation: none !important;
  }
}
