/* ============================================================
 * Aviso de Pausa por Agenda - CONCASAYA
 * Modal inescapable que se muestra al cargar la pagina.
 *
 * - Bloquea scroll mientras esta abierto.
 * - Persistencia 7 dias: no se vuelve a mostrar durante una semana
 *   (la logica de localStorage esta en descanso-alert.js).
 * - Solo se cierra con la X o el boton "Entendido, cerrar".
 * - El modal muestra la imagen oficial del cliente con el copy
 *   literal de la pausa (assets/images/pausa-concasaya.jpeg).
 * ============================================================ */

:root {
  --da-z: 9999;
  --da-radius: 14px;
  --da-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  --da-primary: #0077b6;
  --da-primary-dark: #023e7d;
}

/* ---------- Backdrop ---------- */
#da-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--da-z);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#da-backdrop.da-open { display: flex; opacity: 1; animation: daFadeIn 0.3s ease forwards; }
@keyframes daFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Card ---------- */
#da-card {
  position: relative;
  width: 100% !important;
  max-width: min(640px, calc(100vw - 24px)) !important;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: #ffffff;
  border-radius: var(--da-radius);
  box-shadow: var(--da-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box !important;
  min-width: 0;
}
#da-card * { box-sizing: border-box; max-width: 100%; }
#da-backdrop.da-open #da-card { transform: translateY(0) scale(1); }

/* ---------- Imagen del flyer (literal del cliente) ---------- */
.da-flyer-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Boton X ---------- */
#da-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #000;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, background 0.15s ease;
}
#da-close:hover { background: #dc2626; transform: rotate(90deg); }
#da-close:active { transform: scale(0.9); }

/* ---------- Accion principal ---------- */
.da-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  background: #fff;
  flex-shrink: 0;
}
#da-btn-confirm {
  width: 100%;
  border: none;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--da-primary) 0%, var(--da-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#da-btn-confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 119, 182, 0.4); }
#da-btn-confirm:active { transform: scale(0.98); }

/* ---------- Mobile pequeno ---------- */
@media (max-width: 380px) {
  #da-card { max-width: 100%; }
  #da-backdrop { padding: 6px; }
  .da-flyer-img { max-height: calc(100dvh - 120px); }
  .da-actions { padding: 10px 12px 12px; }
  #da-btn-confirm { font-size: 12.5px; padding: 11px 12px; }
  #da-close { width: 30px; height: 30px; font-size: 18px; top: 8px; right: 8px; }
}

@media (min-width: 640px) {
  #da-backdrop { padding: 20px; }
  .da-actions { padding: 14px 18px 16px; }
  #da-btn-confirm { font-size: 15px; padding: 13px 16px; }
  #da-close { width: 40px; height: 40px; font-size: 26px; top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #da-backdrop, #da-card, #da-close, #da-btn-confirm { transition: none; }
}
