/* CSS Variables - Design Tokens */
:root {
  /* Paleta de colores principal */
  --color-primary: #86BE1E;
  --color-secondary: #193986;
  --color-text: #7A7A7A;
  --color-accent: #61CE70;
  --color-white: #FFFFFF;
  --color-black: #000000;
  
  /* Variables de aplicación */
  --background: #FFFFFF;
  --foreground: #000000;
  --card: #FFFFFF;
  --card-foreground: #000000;
  --primary: #193986;
  --primary-foreground: #FFFFFF;
  --secondary: #86BE1E;
  --secondary-foreground: #FFFFFF;
  --muted: #F5F5F5;
  --muted-foreground: #7A7A7A;
  --accent: #61CE70;
  --accent-foreground: #FFFFFF;
  --destructive: #d4183d;
  --destructive-foreground: #FFFFFF;
  --border: rgba(25, 57, 134, 0.15);
  --input-background: #F8F9FA;
  --switch-background: #cbced4;
  --radius: 10px;
  --shadow-sm: 0 1px 2px 0 rgb(25 57 134 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(25 57 134 / 0.15);
  --shadow-lg: 0 10px 15px -3px rgb(25 57 134 / 0.2);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background) !important; 
  min-height: 100vh;
}

h1 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--primary);
}

h2 {
  font-size: 1.25rem !important; 
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: var(--primary) !important;
}

h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
}

h4 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

h5 {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--card) !important;
  position: sticky;
  top: 37px;
  z-index: 50;
  box-shadow: 0 2px 4px rgba(25, 57, 134, 0.05);
}

.header-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0;
}



.mobile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.mobile-title-row h1 {
  font-size: 1.25rem;
}

.mobile-search-row {
  display: flex;
  gap: 0.5rem;
}

/* Search and Filters */
.search-filters-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  max-width: 48rem;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-wrapper input {
  width: 100%;
  height: 2.25rem;
  padding: 0.5rem 2.5rem;
  background-color: var(--input-background)!important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.2s;
  color: var(--foreground);
}

.search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 57, 134, 0.1);
}

.clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.clear-search:hover {
  color: var(--primary);
}

/* Buttons */
.btn-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  height: 2.25rem;
  background-color: var(--background)!important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
  color: var(--foreground);
}

.btn-filter:hover {
  background-color: rgba(134, 190, 30, 0.1) !important;
  border-color: var(--secondary);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  background-color: var(--primary)!important;
  color: var(--primary-foreground);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.btn-view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--background)!important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  color: var(--muted-foreground);
}

.btn-view:hover {
  background-color: rgba(134, 190, 30, 0.1) !important;
  color: var(--secondary)!important;
  border-color: var(--secondary)!important;
}

.btn-view.active {
  background-color: var(--primary) !important;
  color: var(--primary-foreground)!important;
  border-color: var(--primary)!important;
}

.btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: var(--secondary)!important;
  color: var(--secondary-foreground)!important;
  border-radius: var(--radius);
  transition: all 0.2s;
  gap: 0.5rem;
  font-weight: 500;
}

.btn:hover {
  background-color: #75a919 !important;
  transform: translateY(-1px)!important;
  box-shadow: 0 4px 8px rgba(134, 190, 30, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background-color: var(--background);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
  opacity: 1;
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: rgba(134, 190, 30, 0.1);
  opacity: 1;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Active Filters */
.active-filters-container {
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
}

.filter-badge button {
  margin-left: 0.25rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: inherit;
  transition: color 0.2s;
}

.filter-badge button:hover {
  color: var(--secondary);
}

/* Main Content */
.main-content {
  padding: 1.5rem 0;
}

.top-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .top-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Day Filter */
.day-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-pill {
  padding: 0.5rem 1rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  transition: all 0.2s;
  white-space: nowrap;
  color: var(--foreground);
}

.day-pill:hover {
  background-color: rgba(134, 190, 30, 0.1);
  border-color: var(--secondary);
  color: var(--secondary);
}

.day-pill.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Results Info */
.results-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .results-info {
    justify-content: flex-end;
  }
}

.results-count {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.show-all-link {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.show-all-link:hover {
  color: var(--secondary);
  opacity: 1;
}

/* Category Section */
.category-section {
  margin-bottom: 2rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.category-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-count {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background-color: rgba(134, 190, 30, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
}

.category-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-toggle {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle:hover {
  background-color: rgba(134, 190, 30, 0.1);
  color: var(--secondary);
}

/* Horizontal Scroll Container */
.horizontal-scroll-wrapper {
  position: relative;
}

.scroll-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity 0.2s;
  display: none;
  color: var(--primary);
}

@media (min-width: 768px) {
  .scroll-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.horizontal-scroll-wrapper:hover .scroll-arrow {
  opacity: 1;
}

.scroll-arrow:hover {
  opacity: 1 !important;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.scroll-arrow-left {
  left: 0;
}

.scroll-arrow-right {
  right: 0;
}

.scroll-gradient {
  position: absolute;
  top: 0;
  right: 0;
  width: 4rem;
  height: 100%;
  background: linear-gradient(to left, var(--background), transparent);
  pointer-events: none;
}

/* Grid View */
.grid-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-view {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-view {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid-view {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Activity Card */
.activity-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 420px;
}

.activity-card.horizontal {
  width: 256px;
  flex-shrink: 0;
}

.activity-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.activity-image {
  width: 100%;
  height: 160px;
  object-fit: contain;
  transition: transform 0.2s;
}

.activity-card:hover .activity-image {
  transform: scale(1.05);
}

.activity-image-container {
  width: 100%;
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: transparent;
}

.activity-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.activity-top-section {
  margin-bottom: 0.75rem;
}

.activity-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  min-height: 2.5rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--foreground);
}

.activity-day {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.activity-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.25;
  min-height: 2.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-bottom-section {
  flex-shrink: 0;
}

.activity-meta {
  min-height: 2.5rem;
  margin-bottom: 0.75rem;
}

.activity-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.activity-meta-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--primary);
}

.activity-meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enroll-btn {
  width: 40%;
  height: 2rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.enroll-btn svg {
  width: 12px;
  height: 12px;
}

/* List View */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-list-item {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: all 0.2s;
  cursor: pointer;
}

.activity-list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.list-item-image {
  width: 120px;
  height: 80px;
  object-fit: contain;
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.list-item-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.list-item-info-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.list-item-info-item svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem 0;
}

.no-results p {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

/* Filter Panel */
.filter-panel { 
  position: fixed; 
  top: 0; 
  right: 0; 
  width: 320px; 
  max-width: 90vw; 
  height: 100vh; 
  background-color: var(--card); 
  border-left: 1px solid var(--border); 
  box-shadow: var(--shadow-lg); 
  z-index: 1050 !important; /* Mantenemos este !important */
  transform: translateX(100%); 
  transition: transform 0.3s ease; 
  overflow-y: auto; 
}

.filter-panel.active {
  transform: translateX(0);
}

.filter-panel-content {
  padding: 1.5rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filter-header h4 {
  color: var(--primary);
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section h5 {
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.filter-scroll {
  max-height: 8rem;
  overflow-y: auto;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.filter-checkbox label {
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  flex: 1;
  color: var(--foreground);
}

.filter-divider {
  height: 1px;
  background-color: var(--border);
  margin: 1rem 0;
}

/* Modal */
.modal { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  z-index: 1060 !important; /* Añadido !important */
  /* display: none; es controlado por JS */
}

.modal-backdrop { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.5); 
  z-index: 1065 !important; /* Añadido z-index (detrás del contenido) */
}

.modal-content { 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  width: calc(100% - 2rem); 
  max-width: 672px; 
  max-height: 90vh; 
  background-color: var(--card); 
  border-radius: var(--radius); 
  box-shadow: var(--shadow-lg); 
  overflow-y: auto; 
  z-index: 1070 !important; /* Añadido z-index (encima del backdrop) */
}

@media (max-width: 640px) {
  .modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }
}

.modal-mobile-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .modal-mobile-header {
    display: none;
  }
}

.modal-mobile-header h2 {
  flex: 1;
  text-align: center;
  font-size: 1.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-mobile-header button {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
}

.modal-desktop-header {
  display: none;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  padding-bottom: 1rem;
}

@media (min-width: 640px) {
  .modal-desktop-header {
    display: flex;
  }
}

.modal-desktop-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

.modal-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(134, 190, 30, 0.1);
  color: var(--secondary);
}

.modal-body {
  padding: 1rem;
}

@media (min-width: 640px) {
  .modal-body {
    padding: 0 1.5rem 1.5rem;
  }
}

.modal-image {
  width: calc(91% + 2rem);
  margin: 0 -1rem 1.5rem;
  height: 256px;
  object-fit: contain;
  border-radius: var(--radius);
  position: relative;
}

@media (min-width: 640px) {
  .modal-image {
    width: 100%;
    margin: 0 0 1.5rem;
  }
}

.modal-image-container {
  position: relative;
  width: calc(98% + 2rem);
  margin: 0 -10px 1.5rem;
  height: 256px;
  border-radius: var(--radius);
  overflow: hidden;
  
}

@media (min-width: 640px) {
  .modal-image-container {
    width: 100%;
    margin: 0 0 1.5rem;
  }
}

.modal-category-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h3 {
  color: var(--primary);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.modal-info-item svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.modal-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.modal-detail-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.modal-detail-content h3 {
  margin-bottom: 0.5rem;
}

.modal-detail-content p {
  color: var(--muted-foreground);
}

.modal-divider {
  height: 1px;
  background-color: var(--border);
  margin: 1.5rem 0;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-tag {
  padding: 0.25rem 0.75rem;
  background-color: rgba(134, 190, 30, 0.1);
  border: 1px solid var(--secondary);
  color: var(--secondary);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
}

.modal-actions {
  padding-top: 0.5rem;
  padding-left: 1.5rem;
}

.modal-primary-btn {
  width: 95%;
  height: 3.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.modal-primary-btn:hover {
  background-color: #142d6b;
}

.modal-secondary-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-secondary-btn {
  flex: 1;
  height: 3rem;
}

@media (max-width: 640px) {
  .modal-secondary-btn .btn-text-desktop {
    display: none;
  }
}

@media (min-width: 640px) {
  .modal-secondary-btn .btn-text-mobile {
    display: none;
  }
  .modal-share-btn-mobile {
    display: none !important;
  }
}

.modal-instructor {
  font-weight: 500;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.modal-bio {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.modal-capacity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.modal-capacity svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.capacity-available {
  color: var(--accent);
  margin-left: 0.5rem;
}

.capacity-full {
  color: #dc2626;
  margin-left: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .modal-body h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  .modal-body .modal-subtitle {
    margin-bottom: 1rem;
  }
}

/* Loading and transitions */
.fade-in {
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

.icon-sm {
  width: 12px;
  height: 12px;
}

.icon-md {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

/* --- Añadido para el botón 'X' del panel de filtros --- */

.filter-header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Arreglo para Panel de Filtros y Botón 'X' --- */

/* 1. Esto arregla el fondo oscuro (el 'wrapper') 
   Le da posición fija para que cubra la pantalla. */
#filter-panel-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1040 !important; /* Detrás del panel (que tiene z-index: 100) */
}

#filter-panel-wrapper .modal-backdrop {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1045 !important; /* Asegura que esté detrás del panel (100) pero encima del wrapper (90) */
}



/* --- INICIO: Estilos del Nuevo Top-Bar --- */

.top-bar {
  background: linear-gradient(to right, var(--primary) 30%, var(--secondary) 100%);
  color: var(--white);
  padding: 0.5rem 0;
  font-size: 0.8rem;
  font-weight: 500;
  
  /* Definimos una altura fija para el sticky offset */
  height: 37px; 
  
  /* Hacemos que la barra superior sea pegajosa */
  position: sticky;
  top: 0;
  z-index: 51; /* Por encima del header principal */
}

.top-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-icons a {
  color: var(--white);
  transition: transform 0.2s;
}

.social-icons a:hover {
  transform: scale(1.1);
}

/* --- FIN: Estilos del Nuevo Top-Bar --- */


/* --- INICIO: Estilos del Botón del Carrito --- */

.btn-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; /* Un poco más grande que los de vista */
  height: 2.5rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  color: var(--primary); /* Color azul */
  margin-left: 1rem; /* Espacio para separarlo */
}

.btn-cart:hover {
  background-color: rgba(25, 57, 134, 0.1); /* Fondo azul claro */
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  background-color: var(--secondary); /* Color verde */
  color: var(--secondary-foreground);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 2px solid var(--card);
}

/* --- FIN: Estilos del Botón del Carrito --- */

/* --- INICIO: Estilos Responsive --- */

/* ----------------------------------
 * Para Tablets y Móviles (Menos de 1024px)
 * ---------------------------------- */
@media (max-width: 1024px) {

  /* 1. Barra Superior (Top-Bar) */
  .top-bar .location {
    display: none; /* Ocultamos el texto de ubicación */
  }
  
  .top-bar-content {
    justify-content: center; /* Centramos los íconos sociales */
  }

  /* 2. Barra de Header Principal (app-header) */
  .app-header .header-desktop {
     flex-wrap: wrap; /* Permitimos que los elementos salten a la siguiente línea */
     gap: 1rem; /* Añadimos espacio vertical entre líneas */
  }

  /* El título ahora ocupa su propia línea */
  .app-header h1 {
    width: 100%;
    text-align: center; /* Centramos el título */
    order: 1; /* (1) Título primero */
  }

  /* El contenedor de búsqueda/filtro ocupa su propia línea */
  .search-filters-container {
    width: 100%;
    order: 2; /* (2) Búsqueda/Filtro segundo */
  }

  /* Centramos los botones restantes */
  .view-toggle {
    order: 3; /* (3) Botones de vista */
    margin-left: auto; /* Empujamos los botones a la derecha */
  }

  .btn-cart {
    order: 4; /* (4) Botón de carrito */
    margin-left: 0.5rem;
  }
  
  /* En tablets, ocultamos el botón "Mostrar todas" de las categorías */
  
}


/* ----------------------------------
 * Solo para Móviles (Menos de 640px)
 * ---------------------------------- */
@media (max-width: 640px) {
  
  .container {
    padding: 0 1rem; /* Menos espacio en los bordes */
  }
  
  .app-header h1 {
    font-size: 1.25rem; /* Título más pequeño */
  }
  
  /* Hacemos que la búsqueda y el filtro se separen */
  .search-filters-container {
    /*flex-wrap: wrap;*/
    gap: 0.75rem;
  }
  
  .search-wrapper {
    /*width: 100%; *//* El buscador ocupa todo el ancho */
    flex-grow: 1;
  }
  
  /* .btn-filter: no se necesitan estilos adicionales en móvil */
  
  .view-toggle {
     margin-left: 0; /* Quitamos el margen auto */
  }
  
  /* Hacemos que las píldoras de categorías se puedan scrollear */
  .day-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.75rem; /* Espacio para la barra de scroll */
  }
  
  /* Ajustamos los modales para que ocupen toda la pantalla */
  .modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  /* **** NUEVO BLOQUE PARA AMPLIAR EL BUSCADOR **** */
  .search-wrapper input {
    /* Reducimos el padding para dar más espacio al texto */
    padding-left: 2rem;  
    padding-right: 2rem; 
  }

  .search-icon {
    /* Acercamos la lupa al borde */
    left: 0.5rem; 
  }

  .clear-search {
    /* Acercamos la 'X' al borde */
    right: 0.5rem; 
  }
  /* **** FIN DEL NUEVO BLOQUE **** */
  
}


/* --- FIN: Estilos Responsive --- */


/* --- INICIO: Estilos del Panel del Carrito --- */

/* 1. Wrapper (Contenedor + Fondo) */
#cart-panel-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1070 !important; /* Mismo nivel que el filtro */
}

/* 2. Fondo Oscuro */
#cart-panel-wrapper .modal-backdrop {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1075 !important; /* Detrás del panel */
}

/* 3. Panel Deslizable */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 395px; /* Un poco más ancho que el de filtros */
  max-width: 90vw;
  height: 100vh;
  background-color: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 1080 !important; /* Encima del fondo */
  transform: translateX(100%);
  transition: transform 0.3s ease;
  
  display: flex;
  flex-direction: column;
}

.cart-panel.active {
  transform: translateX(0);
}

/* 4. Contenido Interno */
.cart-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Evita que el footer se mueva */
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-header h4 {
  color: var(--primary);
  margin-bottom: 0;
  font-weight: 700;
}

/* ... (reglas de .cart-header, .cart-items-container, etc. sin cambios) ... */

/* --- INICIO DE ESTILOS MODIFICADOS --- */
.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem; /* <-- MODIFICA ESTA LÍNEA (de 1.5rem) */
}


.cart-item {
  display: flex;
  align-items: center; /* Centra todo verticalmente */
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cart-item-image {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: var(--radius); /* Esquinas redondeadas */
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-item-info {
  flex-grow: 1; /* Empuja el stepper hacia la derecha */
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cart-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0;
  line-height: 1.3;
}

.cart-item-subtitle {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.cart-item-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--foreground);
}

/* Estilos para el nuevo stepper +/- en el carrito */
.cart-item .quantity-stepper {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* Espacio entre botones y texto */
  flex-shrink: 0;
}

.cart-item .btn-quantity {
  width: 2rem; /* 32px */
  height: 2rem; /* 32px */
  border-radius: 50%; /* Circular */
  background-color: var(--muted); /* Fondo gris claro */
  color: var(--foreground);
  border: 1px solid var(--border);
  font-size: 1.25rem;
  line-height: 1; /* Ayuda a centrar el +/- */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item .btn-quantity:hover {
  background-color: #e0e0e0; /* Gris un poco más oscuro */
  border-color: #ccc;
}

.cart-item .quantity-display {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  min-width: 1rem;
  text-align: center;
}
/* --- FIN DE ESTILOS MODIFICADOS --- */
.cart-empty-message {
  text-align: center;
  padding: 2rem 0;
  color: var(--muted-foreground);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--card);
  flex-shrink: 0;
}

.cart-total {
  display: flex; 
  justify-content: space-between;
  align-items: center;
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.cart-checkout-btn {
  width: 100%;
  background-color: var(--primary) !important;
  color: var(--white) !important;
}
.cart-checkout-btn:hover {
  background-color: #142d6b !important;
}

/* --- FIN: Estilos del Panel del Carrito --- */

