/* ===== WAYFINDER'S COMPANION - Shared Detail Page Styles ===== */
/* Used by: albergues/show, pois/show, corrections pages */

/* ===== CSS CUSTOM PROPERTIES ===== */
.detail-page {
  --theme-color: #d97706;
  --theme-shadow: rgba(217, 119, 6, 0.4);
  min-height: 100vh;
  background: #fafafa;
}

/* ===== LOCATION DOT ===== */
.location-dot {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--theme-color, #d97706);
  border-radius: 50%;
  flex-shrink: 0;
}

.location-dot--large {
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 8px var(--theme-shadow, rgba(217, 119, 6, 0.4));
  border: 3px solid white;
}

/* ===== ACTION GRID ===== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

.action-grid--1 { grid-template-columns: 1fr; max-width: 200px; margin: 0 auto; }
.action-grid--2 { grid-template-columns: repeat(2, 1fr); }
.action-grid--3 { grid-template-columns: repeat(3, 1fr); }
.action-grid--4 { grid-template-columns: repeat(4, 1fr); }

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.action-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-card__icon--call {
  background: #dbeafe;
  color: #2563eb;
}

.action-card__icon--whatsapp {
  background: #dcfce7;
  color: #16a34a;
}

.action-card__icon--email {
  background: #fce7f3;
  color: #db2777;
}

.action-card__icon--web {
  background: #f3e8ff;
  color: #7c3aed;
}

.action-card__icon--instagram {
  background: #fce7f3;
  color: #db2777;
}

.action-card__icon--facebook {
  background: #dbeafe;
  color: #1877f2;
}

.action-card__label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

/* ===== MAP CARD ===== */
.map-card {
  position: relative;
  margin: 0 16px 16px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.map-card__map {
  width: 100%;
  height: 200px;
  background: #e5e7eb;
}

.map-card__directions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--theme-color, #d97706);
  color: white;
  font-size: 14px;
  font-weight: 700;
  border-radius: 24px;
  box-shadow: 0 4px 12px var(--theme-shadow, rgba(217, 119, 6, 0.4));
  transition: transform 0.15s, box-shadow 0.15s;
}

.map-card__directions:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--theme-shadow, rgba(217, 119, 6, 0.5));
  color: white;
}

/* ===== CONTENT SECTION ===== */
.content-section {
  padding: 0 16px 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

/* ===== INFO CARD ===== */
.info-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.info-card__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin: 0 0 14px 0;
}

.info-card__text {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}

.info-card__text p {
  margin: 0 0 8px 0;
}

.info-card__text p:last-child {
  margin-bottom: 0;
}

/* ===== LEAF & SHELL CARD ===== */
.leafshell-card {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: #ecfdf5;
  border: 2px solid #10b981;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.leafshell-card--top {
  margin: 16px;
  margin-bottom: 0;
}

.leafshell-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  flex: 1;
  min-width: 0;
}

.leafshell-card__icon {
  flex-shrink: 0;
}

.leafshell-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

.leafshell-card__divider {
  width: 1px;
  height: 48px;
  background: #10b981;
  opacity: 0.4;
  flex-shrink: 0;
}

.leafshell-card__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
  min-height: 48px;
}

.leafshell-card__link:hover {
  background: rgba(16, 185, 129, 0.15);
}

.leafshell-card__link:active {
  background: rgba(16, 185, 129, 0.25);
}

/* ===== PHOTO GRID ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.photo-grid__item {
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  background: #f3f4f6;
}

.photo-grid__item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.photo-grid__item:active {
  transform: scale(0.98);
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  top: calc(16px + env(safe-area-inset-top, 0px));
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox__nav:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox__nav--prev {
  left: 16px;
}

.lightbox__nav--next {
  right: 16px;
}

.lightbox__counter {
  position: absolute;
  bottom: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0,0,0,0.6);
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 480px) {
  .lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox__nav--prev {
    left: 8px;
  }

  .lightbox__nav--next {
    right: 8px;
  }
}

/* ===== REVIEWS CARD ===== */
.reviews-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.reviews-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.reviews-card__header .info-card__title {
  margin: 0;
}

.reviews-card__summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviews-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
}

.reviews-card__count {
  font-size: 13px;
  color: #6b7280;
}

/* ===== REVIEW FORM ===== */
.review-form {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.review-form__title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 14px 0;
}

.review-form__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-form__stars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-form__label {
  font-size: 13px;
  color: #6b7280;
}

.star-input {
  display: flex;
  gap: 4px;
}

.star-input__btn {
  cursor: pointer;
}

.star-input__btn input {
  display: none;
}

.star-input__btn svg {
  width: 32px;
  height: 32px;
  fill: #d1d5db;
  transition: fill 0.15s;
}

.star-input__btn:hover svg,
.star-input__btn input:checked ~ svg,
.star-input:has(.star-input__btn input:checked) .star-input__btn:has(~ .star-input__btn input:checked) svg,
.star-input .star-input__btn:has(~ .star-input__btn input:checked) svg {
  fill: #f59e0b;
}

.review-form__textarea,
.review-form__input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  background: white;
  transition: border-color 0.15s;
}

.review-form__textarea {
  resize: vertical;
  min-height: 80px;
}

.review-form__textarea:focus,
.review-form__input:focus {
  outline: none;
  border-color: var(--theme-color, #d97706);
}

.review-form__submit {
  width: 100%;
  padding: 14px;
  background: var(--theme-color, #d97706);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.review-form__submit:hover {
  opacity: 0.9;
}

/* ===== REVIEWS LIST ===== */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  padding: 14px;
  background: #f9fafb;
  border-radius: 10px;
}

.review-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-item__author {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.review-item__stars {
  display: flex;
  gap: 2px;
}

.review-item__comment {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.review-item__date {
  font-size: 12px;
  color: #9ca3af;
}

.reviews-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 24px;
  margin: 0;
}

/* ===== FEEDBACK LINK ===== */
.feedback-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  margin-top: 24px;
  color: #9ca3af;
  font-size: 13px;
}

.feedback-link svg {
  flex-shrink: 0;
}

.feedback-link a {
  color: var(--theme-color, #d97706);
  font-weight: 500;
  text-decoration: none;
}

.feedback-link a:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .content-section {
    max-width: 600px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }

  .action-grid {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .map-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .leafshell-card--top {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}
