/* ==========================================================================
   CALENDARIO DE 24 CASILLAS (GIFT BOX DRAWERS)
   Inspiración: hasta el 24 (cajones navideños, lazos, patrones festivos)
   ========================================================================== */

.advent-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
  margin: 0 auto;
  perspective: 1000px;
}

/* Casilla individual de regalo */
.advent-box {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  transform-style: preserve-3d;
  box-shadow: 0 8px 20px rgba(181, 43, 64, 0.1);
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.advent-box:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 32px rgba(181, 43, 64, 0.18);
}

.advent-box:active {
  transform: translateY(-2px) scale(0.98);
}

/* Cara principal del cajón */
.advent-box-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  border-radius: inherit;
  overflow: hidden;
}

/* Cinta decorativa vertical u horizontal simulada */
.box-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.box-ribbon-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 14px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

/* Insignia con el número del día */
.box-day-badge {
  position: relative;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFF;
  color: var(--cherry-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(216, 125, 138, 0.25);
  transition: transform 0.3s ease;
}

.advent-box:hover .box-day-badge {
  transform: scale(1.1);
}

/* Icono festivo decorativo en el centro */
.box-festive-icon {
  position: relative;
  z-index: 2;
  font-size: 1.8rem;
  margin: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.12));
  transition: transform 0.35s ease;
}

.advent-box:hover .box-festive-icon {
  transform: scale(1.18) rotate(5deg);
}

/* Pie del cajón (Lazo o texto de estado) */
.box-status-tag {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   PATRONES FESTIVOS Y TEMÁTICOS DE CADA CASILLA (ESTILO HASTA EL 24)
   ========================================================================== */

/* Patrón 1: Rayas diagonales rojo cereza y rosa (Candy Cane) */
.box-pattern-stripes-cherry {
  background: repeating-linear-gradient(
    45deg,
    #B52B40,
    #B52B40 14px,
    #C9384E 14px,
    #C9384E 28px
  );
  color: #FFF;
}
.box-pattern-stripes-cherry .box-ribbon-v,
.box-pattern-stripes-cherry .box-ribbon-h {
  background: rgba(255, 255, 255, 0.25);
}

/* Patrón 2: Rayas diagonales rosa suave y crema */
.box-pattern-stripes-pink {
  background: repeating-linear-gradient(
    -45deg,
    #FCE8EE,
    #FCE8EE 14px,
    #FFF6F8 14px,
    #FFF6F8 28px
  );
}

/* Patrón 3: Topos / Lunares coquette */
.box-pattern-polka-pink {
  background-color: #F8C8D4;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 20%, transparent 20%);
  background-size: 16px 16px;
}

.box-pattern-polka-red {
  background-color: #FFF0F5;
  background-image: radial-gradient(#E88B9C 20%, transparent 20%);
  background-size: 16px 16px;
}

/* Patrón 4: Menta festivo suave */
.box-pattern-mint {
  background: linear-gradient(135deg, #E6F3EC 0%, #D0E7DC 100%);
  border-color: rgba(120, 165, 141, 0.3);
}

/* Patrón 5: Oro rosa / Melocotón suave */
.box-pattern-rose {
  background: linear-gradient(135deg, #FDECEF 0%, #F8D5DE 100%);
}

/* Patrón 6: Borgoña elegante aterciopelado */
.box-pattern-burgundy {
  background: linear-gradient(135deg, #9E2B3E 0%, #7A1827 100%);
  color: #FFF;
}
.box-pattern-burgundy .box-day-badge {
  background: #FFF5F7;
  color: #7A1827;
}

/* ==========================================================================
   CASILLA 24: LA GRAN SORPRESA DE NOCHEBUENA (DORADA Y DESTACADA)
   ========================================================================== */
.advent-box.box-day-24 {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
  background: linear-gradient(135deg, #FFF4D0 0%, #F5D37E 30%, #DFB15B 60%, #BE8C2C 100%);
  border: 2px solid #FFF;
  box-shadow: 0 14px 35px rgba(223, 177, 91, 0.45);
  animation: goldPulse 3.5s infinite ease-in-out;
}

@keyframes goldPulse {
  0%, 100% {
    box-shadow: 0 14px 35px rgba(223, 177, 91, 0.45), 0 0 15px rgba(255, 232, 163, 0.6);
  }
  50% {
    box-shadow: 0 18px 45px rgba(223, 177, 91, 0.7), 0 0 30px rgba(255, 240, 190, 0.9);
  }
}

.box-day-24 .box-day-badge {
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  background: #FFFDF9;
  color: #9E3A4B;
  border: 2px solid var(--gold-metallic);
}

.box-day-24 .box-festive-icon {
  font-size: 2.4rem;
}

.box-day-24-label {
  position: absolute;
  bottom: 12px;
  left: 18px;
  font-family: var(--font-script);
  font-size: 1.45rem;
  color: #5E3E07;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* ==========================================================================
   ESTADOS DE LAS CASILLAS: BLOQUEADA, DISPONIBLE, ABIERTA
   ========================================================================== */

/* Bloqueada (Día futuro) */
.advent-box.status-locked {
  opacity: 0.92;
  filter: saturate(0.85);
}

.advent-box.status-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(74, 46, 53, 0.12);
  pointer-events: none;
}

.lock-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  z-index: 5;
}

/* Disponible para abrir hoy (resaltado vibrante) */
.advent-box.status-available {
  animation: readyGlow 2.5s infinite;
  border: 2px solid #FFF;
}

@keyframes readyGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(181, 43, 64, 0.25), 0 0 12px rgba(248, 200, 212, 0.6);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 14px 34px rgba(181, 43, 64, 0.4), 0 0 22px rgba(248, 200, 212, 0.9);
    transform: translateY(-4px);
  }
}

.available-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--cherry-red);
  color: #FFF;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(181, 43, 64, 0.35);
  animation: badgeBlink 1.6s infinite;
  z-index: 5;
}

@keyframes badgeBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

/* Ya abierta (Permite re-abrir) */
.advent-box.status-opened {
  opacity: 0.95;
}

.opened-seal {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #FFF;
  color: #2E7D32;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  z-index: 5;
}

/* Efecto al hacer clic en casilla bloqueada */
@keyframes shakeBox {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.advent-box.shake {
  animation: shakeBox 0.45s ease-in-out;
}

/* ==========================================================================
   RESPONSIVE DESIGN (ADAPTACIÓN PERFECTA A MÓVILES)
   ========================================================================== */
@media (max-width: 900px) {
  .advent-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .advent-box.box-day-24 {
    grid-column: span 3;
    aspect-ratio: 2.4 / 1;
  }
}

@media (max-width: 600px) {
  .advent-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .advent-box.box-day-24 {
    grid-column: span 2;
    aspect-ratio: 1.8 / 1;
  }
  .advent-box-inner {
    padding: 10px;
  }
  .box-day-badge {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }
  .box-festive-icon {
    font-size: 1.5rem;
  }
  .box-day-24-label {
    font-size: 1.15rem;
    bottom: 8px;
    left: 12px;
  }
}
