/* ─────────────────────────────────────────────────────────────────────────────
   Deela Item Detail Page Styles v1.0
   Upload to: /wp-content/themes/astra/item-page.css
───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');

/* ── Astra overrides (same as city pages) ── */
body.item-page-template #content,
body.item-page-template #primary,
body.item-page-template .site-content,
body.item-page-template .content-area,
body.item-page-template .ast-container,
body.item-page-template .entry-content,
body.item-page-template article.page {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

body.item-page-template .entry-header {
  display: none !important;
}

/* ── Layout ── */
.item-page {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #1a1a1a;
}

.item-page__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 64px; /* 72px top = breathing room below navbar */
}

/* ── Gallery ── */
.item-page__main-img-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f5f5f5;
  aspect-ratio: 1 / 1;
}

.item-page__main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.item-page__status-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 6px;
  color: #fff;
}

.item-page__thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.item-page__thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #f5f5f5;
  transition: border-color 0.15s ease;
}

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

.item-page__thumb--active {
  border-color: #4caf72;
}

.item-page__thumb:hover {
  border-color: #4caf72;
}

/* ── Details ── */
.item-page__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.item-page__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4caf72;
  margin: 0;
}

.item-page__title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #1a1a1a;
}

/* ── Status pill ── */
.item-page__status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  width: fit-content;
}

.item-page__status--available {
  background: #e8f5ee;
  color: #3a9460;
}

.item-page__status--reserved {
  background: #fff3e0;
  color: #e65100;
}

.item-page__status--delivered {
  background: #f0f0f0;
  color: #666;
}

/* ── Meta ── */
.item-page__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.item-page__meta-tag {
  font-size: 12px;
  background: #f0f0f0;
  color: #555;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.item-page__meta-time {
  font-size: 12px;
  font-style: italic;
  color: #888;
}

/* ── Description ── */
.item-page__desc {
  font-size: 15px;
  line-height: 1.7;
  color: #444;
  margin: 0;
  white-space: pre-wrap;
}

/* ── Availability ── */
.item-page__avail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
}

.item-page__avail-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.item-page__avail-value {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── CTA button ── */
.item-page__cta {
  display: block;
  width: 100%;
  padding: 16px;
  background: #4caf72;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: auto;
}

.item-page__cta:hover {
  background: #3a9460;
  transform: translateY(-1px);
}

/* ── Unavailable state ── */
.item-page__unavail {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.item-page__badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.item-page__badges img {
  height: 42px;
  width: auto;
  display: block;
}

/* ── Responsive ── */

/* Tablet (768px–1024px), side-by-side but tighter */
@media (max-width: 1024px) and (min-width: 769px) {
  .item-page__layout {
    gap: 32px;
    padding: 100px 24px 48px;
  }

  .item-page__title {
    font-size: clamp(20px, 3vw, 28px);
  }

  .item-page__safety-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile (max 768px), single column */
@media (max-width: 768px) {
  .item-page__layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 100px 16px 32px;
  }

  .item-page__main-img-wrap {
    border-radius: 12px;
  }

  .item-page__thumbnails {
    gap: 8px;
  }

  .item-page__thumb {
    width: 60px;
    height: 60px;
  }

  .item-page__title {
    font-size: 22px;
  }

  .item-page__how {
    padding: 48px 16px;
  }

  .item-page__how .item-page__section-title {
    font-size: 20px;
  }

  .item-page__steps {
    gap: 20px;
  }

  .item-page__safety-grid {
    grid-template-columns: 1fr;
  }

  .item-page__pledge {
    padding: 40px 16px 56px;
  }

  .item-page__map-section,
  .item-page__safety {
    padding: 32px 16px;
  }

  #deela-map {
    height: 220px;
  }

  .deela-lightbox__prev { left: 8px; }
  .deela-lightbox__next { right: 8px; }
  .deela-lightbox__prev,
  .deela-lightbox__next {
    font-size: 30px;
    padding: 8px 12px;
  }
}

/* Small phone (max 400px) */
@media (max-width: 400px) {
  .item-page__layout {
    padding: 90px 12px 24px;
  }

  .item-page__cta {
    font-size: 15px;
    padding: 14px;
  }

  .deela-popup__box--contact {
    width: 95vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .item-page__main-img,
  .item-page__cta {
    transition: none;
  }
}

/* ── Info rows (availability, expiry) ── */
.item-page__info-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-page__info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
}

.item-page__info-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.item-page__info-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.item-page__info-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── Section shared styles ── */
.item-page__map-section,
.item-page__safety,
.item-page__pledge {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid #e8e8e8;
}

.item-page__section-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}

/* ── Map ── */
.item-page__map-note {
  font-size: 13px;
  color: #888;
  margin: 0 0 16px;
  font-style: italic;
}

.item-page__map-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.item-page__map {
  width: 100%;
  height: 280px;
  border: none;
  display: block;
}

/* ── How to get it, confidence section ── */
.item-page__how {
  background: linear-gradient(135deg, #2d5a3d 0%, #4caf72 100%);
  padding: 64px 24px;
  border-top: none;
}

.item-page__how .item-page__section-title {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 40px;
}

/* ── How to steps ── */
.item-page__steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 560px;
  margin: 0 auto 40px;
}

.item-page__step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.item-page__step-num {
  width: 42px;
  height: 42px;
  background: #fff;
  color: #2d5a3d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.item-page__step-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}

.item-page__step-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  line-height: 1.6;
}

.item-page__app-badges {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.item-page__app-badges a {
  display: inline-block;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.item-page__app-badges a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.item-page__app-badges img {
  height: 44px;
  width: auto;
  display: block;
  /* no filter, show badges in their natural colors against the lighter green */
}

/* ── Safety grid ── */
.item-page__safety-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.item-page__safety-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 12px;
}

.item-page__safety-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.item-page__safety-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #1a1a1a;
}

.item-page__safety-desc {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* ── Community pledge, full width ── */
.item-page__pledge {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 56px 24px 72px;
  text-align: center;
  background: linear-gradient(135deg, #f0faf4, #e8f5ee);
  border-top: 1px solid #d0eadb;
}

.item-page__pledge-logo {
  height: 52px;
  width: auto;
  display: block;
  margin: 0 auto 16px;
}

.item-page__pledge-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px;
}

.item-page__pledge-text {
  font-size: 15px;
  color: #444;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .item-page__safety-grid {
    grid-template-columns: 1fr;
  }

  .item-page__map-section,
  .item-page__how,
  .item-page__safety,
  .item-page__pledge {
    padding: 32px 16px;
  }

  .item-page__map {
    height: 220px;
  }
}

/* ── Image count badge ── */
.item-page__img-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ── Leaflet map ── */
#deela-map {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  margin-top: 16px;
}

/* ── Lightbox ── */
.deela-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.deela-lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.deela-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  opacity: 0.8;
}

.deela-lightbox__close:hover { opacity: 1; }

.deela-lightbox__prev,
.deela-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.15s ease;
}

.deela-lightbox__prev { left: 20px; }
.deela-lightbox__next { right: 20px; }
.deela-lightbox__prev:hover,
.deela-lightbox__next:hover { background: rgba(255,255,255,0.2); }

.deela-lightbox__counter {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 14px;
}

/* ── Redesigned contact popup ── */
.deela-popup__box--contact {
  max-width: 380px;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
}

.deela-popup__preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  background: #f9f9f9;
}

.deela-popup__preview-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.deela-popup__preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.deela-popup__preview-sub {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.deela-popup__divider {
  height: 1px;
  background: #e8e8e8;
}

.deela-popup__brand {
  display: flex;
  justify-content: center;
  padding: 20px 20px 4px;
}

.deela-popup__logo {
  height: 36px;
  width: auto;
  display: block;
}

.deela-popup__heading {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
  text-align: center;
  padding: 0 24px;
  padding-top: 24px;
}

.deela-popup__sub {
  font-size: 13px;
  color: #888;
  margin: 0 0 20px;
  text-align: center;
  padding: 0 24px;
}

/* Identical badge containers, let the official badges speak */
.deela-popup__store-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.deela-popup__store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.deela-popup__store-btn:hover {
  background: #ebebeb;
  transform: translateY(-1px);
  text-decoration: none;
}

.deela-popup__store-badge-img {
  height: 38px;
  width: auto;
  display: block;
}

.deela-popup__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(0,0,0,0.07);
  border: none;
  font-size: 18px;
  color: #555;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.deela-popup__close:hover {
  background: rgba(0,0,0,0.13);
  color: #1a1a1a;
}
