/* ========================================
 * Agenda de Conciertos - Styles
 * ======================================== */

:root {
  --agenda-primary: #F47617;
  --agenda-secondary: #54595F;
  --agenda-white: #fff;
  --agenda-black: #000;
  --agenda-bg: #1b2129;
  --agenda-bg-input: #111;
  --agenda-bg-thumb: #0f1318;
  --agenda-border: rgba(255, 255, 255, 0.2);
  --agenda-text-light: #d9dde3;
  --agenda-text-title: #e7d0e9;
}

/* ===== WRAPPER ===== */
.agenda-wrap {
  color: var(--agenda-white);
  background: var(--agenda-bg);
  padding: 16px;
  border-radius: 14px;
}

/* ===== FILTERS ===== */
.agenda-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.agenda-search {
  position: relative;
  flex: 1 1 360px;
  min-width: 260px;
}

.agenda-search input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--agenda-border);
  background: var(--agenda-bg-input);
  color: var(--agenda-white);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.agenda-search input:focus {
  outline: none;
  border-color: var(--agenda-primary);
}

.agenda-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--agenda-border);
  background: var(--agenda-primary);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.agenda-search button:hover {
  opacity: 0.9;
}

.agenda-search button:active {
  transform: translateY(-50%) scale(0.98);
}

.agenda-search button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pills en carrusel horizontal en pantallas pequeñas */
.pillbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--agenda-border);
  color: var(--agenda-white);
  text-decoration: none;
  font-weight: 800;
  opacity: 0.9;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  transition: all 0.2s ease;
  user-select: none;
}

.pill:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.pill:focus {
  outline: 2px solid var(--agenda-primary);
  outline-offset: 2px;
}

.pill.is-active {
  background: var(--agenda-white);
  color: #111;
  border-color: var(--agenda-white);
}

.pill-genre {
  background: rgba(244, 118, 23, 0.12);
  border-color: var(--agenda-primary);
}

.pill-genre.is-active {
  background: var(--agenda-primary);
  color: #fff;
  border-color: var(--agenda-primary);
}

@media (max-width: 768px) {
  .pillbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    margin-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  
  .pillbar::-webkit-scrollbar {
    height: 4px;
  }
  
  .pillbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }
  
  .pillbar::-webkit-scrollbar-thumb {
    background: var(--agenda-primary);
    border-radius: 2px;
  }
  
  .pill {
    scroll-snap-align: start;
  }
}

/* Rango fechas */
.datebox {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.datebox-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.datebox-label {
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
  color: var(--agenda-text-light);
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1;
}

.datebox-input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--agenda-border);
  background: #101419;
  color: var(--agenda-white);
  font-size: 12px;
  transition: border-color 0.2s ease;
  height: 36px;
  width: 135px;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

/* Firefox y otros navegadores */
.datebox-input[type="date"] {
  min-height: 36px;
}

.datebox-input::-moz-placeholder {
  color: var(--agenda-text-light);
  opacity: 0.6;
}

.datebox-input::placeholder {
  color: var(--agenda-text-light);
  opacity: 0.6;
}

.datebox-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  filter: invert(1);
  padding: 2px;
  width: 16px;
  height: 16px;
}

.datebox-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.datebox-input:focus {
  outline: none;
  border-color: var(--agenda-primary);
}

.datebox-input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.datebox-input::-webkit-datetime-edit-text {
  padding: 0 2px;
  color: var(--agenda-text-light);
}

.datebox-input::-webkit-datetime-edit-month-field,
.datebox-input::-webkit-datetime-edit-day-field,
.datebox-input::-webkit-datetime-edit-year-field {
  color: var(--agenda-white);
}

.datebox-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--agenda-primary);
  background: var(--agenda-primary);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  height: 36px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-end;
}

.datebox-btn:hover {
  opacity: 0.9;
}

.datebox-btn:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .agenda-filters {
    gap: 12px;
  }
  
  .agenda-search {
    flex: 1 1 100%;
  }
  
  .datebox {
    width: 100%;
    gap: 10px;
  }
  
  .datebox-item {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }
  
  .datebox-label {
    font-size: 9px;
  }
  
  .datebox-input {
    width: 100%;
    min-width: 0;
  }
  
  .datebox-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    align-self: stretch;
  }
}

/* ===== LOADING STATE ===== */
.agenda-loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.agenda-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--agenda-primary);
  border-radius: 50%;
  animation: agenda-spin 0.8s linear infinite;
}

@keyframes agenda-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.agenda-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--agenda-text-light);
}

.agenda-empty-state p {
  margin: 0;
  font-size: 16px;
}

/* ===== LISTA / CARDS ===== */
.agenda-day {
  margin: 28px 0 12px;
  border-top: 1px solid var(--agenda-border);
  padding-top: 22px;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.agenda-day strong {
  font-weight: 800;
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Desktop: 3 columnas (thumb / body / CTA) */
.agenda-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.2s ease;
}

.agenda-item:hover {
  opacity: 0.95;
}

.agenda-thumb {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--agenda-bg-thumb);
  position: relative;
}

.agenda-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agenda-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.agenda-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-genre {
  background: rgba(244, 118, 23, 0.15);
  color: #fff;
  border: 1px solid var(--agenda-primary);
}

.tag-sala {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  opacity: 0.85;
}

.agenda-title {
  font-size: clamp(18px, 2.2vw, 20px);
  font-weight: 800;
  margin: 0;
  color: var(--agenda-text-title);
  line-height: 1.2;
}

.agenda-sub {
  font-size: 14px;
  color: var(--agenda-text-light);
  opacity: 0.9;
}

.agenda-dot {
  opacity: 0.5;
  margin: 0 6px;
}

.agenda-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

/* CTA */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  border: 2px solid #fff;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-cta--buy {
  background: var(--agenda-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(244, 118, 23, 0.25);
}

.btn-cta--buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(244, 118, 23, 0.35);
  opacity: 0.95;
}

.btn-cta--sold {
  background: #bfbfbf;
  color: #333;
  border-color: #bfbfbf;
  cursor: not-allowed;
  opacity: 0.85;
}

.agenda-price {
  font-weight: 800;
  margin-left: 10px;
}

/* ===== PAGINACION ===== */
.agenda-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--agenda-border);
}

.agenda-pagination button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--agenda-border);
  background: transparent;
  color: var(--agenda-white);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agenda-pagination button:hover:not(:disabled) {
  background: var(--agenda-primary);
  border-color: var(--agenda-primary);
}

.agenda-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== BREAKPOINTS ===== */

/* Tablet */
@media (max-width: 1024px) {
  .agenda-item {
    grid-template-columns: 90px 1fr auto;
  }
  
  .agenda-thumb {
    width: 90px;
    height: 90px;
  }
}

/* Tablet vertical / móvil grande: CTA baja en su propia fila */
@media (max-width: 900px) {
  .agenda-item {
    grid-template-columns: 80px 1fr;
    grid-template-areas:
      "thumb body"
      "cta   cta";
    row-gap: 12px;
  }
  
  .agenda-thumb {
    width: 80px;
    height: 80px;
    grid-area: thumb;
  }
  
  .agenda-right {
    grid-area: cta;
    justify-self: start;
  }
  
  .btn-cta {
    padding: 12px 18px;
  }
}

/* Móvil */
@media (max-width: 640px) {
  .agenda-item {
    grid-template-columns: 64px 1fr;
    row-gap: 10px;
  }
  
  .agenda-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
  }
  
  .agenda-meta {
    gap: 8px;
  }
  
  .agenda-title {
    font-size: 18px;
  }
  
  .agenda-sub {
    font-size: 13px;
  }
  
  /* CTA full-width en móvil */
  .agenda-right {
    width: 100%;
  }
  
  .btn-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Móvil chico */
@media (max-width: 420px) {
  .agenda-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .tag {
    padding: 5px 10px;
    font-size: 11px;
  }
}