
/* ==========================================
   MODAL STYLES
   ========================================== */

/* Bot\u00f3n Ver M\u00e1s */
.btn-ver-mas {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-ver-mas:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45, 80, 22, 0.3);
}

/* Modal Container */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Modal Content */
.modal-content {
  background: var(--color-cream);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.4s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@keyframes slideIn {
  from {
    transform: scale(0.9) translateY(30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Scrollbar personalizado para el modal */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* Bot\u00f3n Cerrar */
.modal-close {
  position: sticky;
  top: .8rem;
  right: .8rem;
  float: right;
  font-size: 3rem;
  font-weight: 300;
  color: var(--color-text);
  cursor: pointer;
  /* padding: .2rem .2rem; */
  line-height: 1;
  transition: var(--transition);
  z-index: 10;
  background: var(--color-cream);
}

.modal-close:hover {
  color: var(--color-primary);
  transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
  padding: 2rem 3rem 3rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 2rem;
  line-height: 1.2;
}

/* Modal Galer\u00eda de Im\u00e1genes */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.modal-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.modal-image:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Modal Sections */
.modal-section {
  margin-bottom: 2.5rem;
}

.modal-section h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent-light);
}

.modal-section p {
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Modal Lists */
.modal-list {
  list-style: none;
  padding: 0;
}

.modal-list li {
  padding: 0.75rem 0;
  color: var(--color-text);
  line-height: 1.7;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-list li:last-child {
  border-bottom: none;
}

/* Modal Grid */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.modal-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

.modal-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.modal-item h4 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.modal-item p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0;
}

/* Expandable Cards */
.modal-item.expandable {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.modal-item.expandable.expanded {
  grid-column: 1 / -1;
}

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

.expand-icon {
  font-size: 1.2rem;
  color: var(--color-primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-top: 0.2rem;
  user-select: none;
}

.modal-item.expandable.expanded .expand-icon {
  transform: rotate(180deg);
}

.expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
}

.modal-item.expandable.expanded .expandable-content {
  max-height: 800px;
  margin-top: 1.5rem;
}

/* Expanded Layout */
.expanded-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.expanded-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.expanded-images img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.expanded-images img:hover {
  transform: scale(1.05);
}

.expanded-info {
  display: flex;
  flex-direction: column;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-list li {
  padding: 0.6rem 0;
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.6;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-list li:last-child {
  border-bottom: none;
}

.detail-list strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* Hover effect enhancement for expandable cards */
.modal-item.expandable:hover {
  border: 2px solid var(--color-primary);
  padding: calc(1.5rem - 2px);
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal {
    padding: 1rem;
  }

  .modal-content {
    max-height: 90vh;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-title {
    font-size: 2rem;
  }

  .modal-section h3 {
    font-size: 1.5rem;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-close {
    padding: 0.75rem 1rem;
    font-size: 2rem;
  }

  .expanded-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .expanded-images {
    grid-template-columns: 1fr;
  }
}
