/* ===================================================
   Hesperia Morrocoy — Gallery & FAQ Page
   =================================================== */

/* ── Variables ──────────────────────────────────── */
:root {
  --gold:        #c5a572;
  --gold-dark:   #9f8255;
  --gold-light:  #e8d5b0;
  --dark:        #111111;
  --text:        #222222;
  --gray:        #666666;
  --gray-light:  #888888;
  --border:      #e8e8e8;
  --bg:          #ffffff;
  --bg-soft:     #fafafa;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.14);
  --transition:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

/* ── Page Main ──────────────────────────────────── */
.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 60px 0;
}

/* ── GALLERY SECTION ────────────────────────────── */
.gallery-section {
  padding: 28px 24px 32px;
}

/* Main Viewer */
.main-viewer {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  gap: 0;
}

.main-image-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #f0ebe3;
  aspect-ratio: 5 / 4;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  user-select: none;
}

#mainImage {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ensures the 5:4 image isn't cropped if the container is slightly off */
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
  will-change: opacity;
}

#mainImage.fading {
  opacity: 0;
  transform: scale(1.015);
}

/* Image counter badge */
.image-counter {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Loader overlay */
.loader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebe3;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.loader-overlay.visible {
  opacity: 1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(197, 165, 114, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Carousel Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.carousel-arrow svg {
  width: 22px;
  height: 22px;
}

.arrow-prev {
  left: 12px;
}

.arrow-next {
  right: 12px;
}

.carousel-arrow:hover {
  background: var(--gold);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

/* On mobile: smaller arrows */
@media (max-width: 480px) {
  .carousel-arrow {
    width: 36px;
    height: 36px;
  }
  .carousel-arrow svg {
    width: 18px;
    height: 18px;
  }
  .arrow-prev { left: 8px; }
  .arrow-next { right: 8px; }
}

/* ── Thumbnail Strip ─────────────────────────────── */
.thumbnails-scroll-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
}

.thumbnails-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.thumbnails-strip {
  display: flex;
  gap: 10px;
  padding: 0 2px;
  width: max-content;
}

.thumb-item {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  background: #f0ebe3;
  position: relative;
}

@media (min-width: 640px) {
  .thumb-item {
    width: 90px;
    height: 68px;
  }
}

@media (min-width: 1024px) {
  .thumb-item {
    width: 110px;
    height: 80px;
  }
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumb-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.thumb-item:hover img {
  transform: scale(1.05);
}

.thumb-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-light), var(--shadow-sm);
}

/* ── FAQ SECTION ─────────────────────────────────── */
.faq-section {
  padding: 40px 24px 0;
  border-top: 1px solid var(--border);
}

.faq-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
  text-align: center;
}

/* Search */
.search-container {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}

.search-container input {
  width: 100%;
  max-width: 600px;
  padding: 13px 18px;
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
}

.search-container input::placeholder {
  color: #aaa;
}

.search-container input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.12);
}

/* FAQ List */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}


.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-question {
  padding: 18px 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: color var(--transition);
  line-height: 1.4;
  user-select: none;
}

.faq-question .faq-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 300;
  color: var(--gold);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  line-height: 1;
}

.faq-item.active .faq-icon {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  transform: rotate(45deg);
}

@media (hover: hover) {
  .faq-question:hover {
    color: var(--gold);
  }
}

.faq-item.active .faq-question {
  color: var(--gold-dark);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 4px;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
}

.faq-item.active .faq-answer {
  padding-bottom: 20px;
}

.faq-line {
  margin-bottom: 4px;
}

.faq-spacer {
  height: 8px;
}

.indented-item {
  padding-left: 20px;
  position: relative;
  color: var(--gray-light);
  font-size: 14px;
}

.indented-item::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--gold);
}

/* FAQ image */
.faq-image-wrap {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-image-wrap img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.loading-text {
  text-align: center;
  color: #ccc;
  font-size: 13px;
  padding: 30px 0;
}

/* Disable anim during search */
#faqList.is-searching .faq-answer {
  transition: none !important;
}

/* ── Contact Section ─────────────────────────────── */
.contact-section {
  margin: 48px auto 0;
  max-width: 800px;
  padding: 32px 28px;
  background: var(--dark);
  border-radius: var(--radius-lg);
  text-align: center;
}

.contact-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  background: #25d366;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: "Outfit", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
  width: 100%;
  max-width: 400px;
}

.btn-whatsapp:hover {
  background: #1eb85a;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

.wa-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Responsive Tweaks ──────────────────────────── */
@media (max-width: 600px) {
  .gallery-section {
    padding: 16px 14px 24px;
  }

  .faq-section {
    padding: 32px 14px 0;
  }

  .contact-section {
    margin: 36px 14px 0;
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }

  .faq-title {
    font-size: 22px;
  }

  .brand-logo {
    height: 32px;
  }
}

@media (min-width: 1024px) {
  .gallery-section {
    padding: 36px 40px 40px;
  }

  .faq-section {
    padding: 52px 40px 0;
  }

  .contact-section {
    margin: 56px auto 0;
    max-width: 800px;
  }
}

/* ── Fullscreen Overlay ─────────────────────────── */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fullscreen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.fullscreen-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
}

.fullscreen-overlay.active img {
  transform: scale(1);
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 1001;
}

.fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}
