/* =========================
   TEMPLATE SEARCH
========================= */

.template-search-wrap {
  margin: 30px 0 22px;
}

.template-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid #d8d8d4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .055);
}

.template-search > i {
  margin-left: 20px;
  color: var(--gold-dark);
}

.template-search input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.template-search button {
  height: 48px;
  margin-right: 5px;
  padding: 0 24px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--maroon-dark), #b41437);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
}

.template-search-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.template-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 18px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.template-results-label {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.template-results-header h3 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 22px;
}

.template-results-count {
  color: var(--muted);
  font-size: 12px;
}


/* =========================
   PREVIEW MODAL
========================= */

.template-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
}

.template-preview-modal.is-open {
  display: block;
}

.template-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(5px);
}

.template-preview-dialog {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  width: min(1380px, calc(100% - 48px));
  height: calc(100vh - 48px);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(212, 154, 24, .45);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.template-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 13px 20px;
  border-bottom: 1px solid #dededb;
  background: #080808;
  color: #fff;
}

.template-preview-toolbar span,
.template-preview-toolbar strong {
  display: block;
}

.template-preview-toolbar span {
  margin-bottom: 4px;
  color: #e5ab26;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.template-preview-toolbar strong {
  font-family: "Poppins", sans-serif;
  font-size: 15px;
}

.template-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-preview-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.sample-site {
  overflow-y: auto;
  background: #fff;
  color: #161616;
}

.sample-site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.sample-site-logo {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  letter-spacing: -.5px;
}

.sample-site-header nav {
  display: flex;
  gap: 28px;
}

.sample-site-header nav a {
  font-size: 11px;
  font-weight: 700;
}

.sample-site-header-cta,
.sample-site-primary-btn,
.sample-site-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 4px;
  background: var(--maroon);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sample-site-hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}

.sample-site-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-site-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, .94) 0%,
      rgba(0, 0, 0, .73) 47%,
      rgba(0, 0, 0, .15) 100%
    );
}

.sample-site-hero-content {
  position: relative;
  z-index: 1;
  width: min(650px, calc(100% - 48px));
  margin-left: clamp(24px, 7vw, 105px);
  padding: 90px 0;
}

.sample-site-hero-content > span,
.sample-site-intro > span,
.sample-site-section-heading > span,
.sample-site-contact span {
  color: #e9ae28;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.sample-site-hero-content h2 {
  margin: 17px 0 20px;
  font-family: "Poppins", sans-serif;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.04;
  letter-spacing: -2px;
}

.sample-site-hero-content p {
  max-width: 570px;
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 16px;
  line-height: 1.8;
}

.sample-site-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.sample-site-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sample-site-intro {
  max-width: 780px;
  margin: auto;
  padding: 90px 24px;
  text-align: center;
}

.sample-site-intro h2,
.sample-site-section-heading h2,
.sample-site-contact h2 {
  margin: 12px 0 18px;
  font-family: "Poppins", sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

.sample-site-intro p {
  margin: 0;
  color: #686868;
  font-size: 15px;
  line-height: 1.8;
}

.sample-site-services {
  padding: 85px clamp(24px, 6vw, 90px);
  background: #f7f7f5;
}

.sample-site-section-heading {
  max-width: 650px;
  margin-bottom: 38px;
}

.sample-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.sample-service-grid article {
  padding: 32px;
  border: 1px solid #e0e0dc;
  border-radius: 8px;
  background: #fff;
}

.sample-service-grid i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 17px;
}

.sample-service-grid h3 {
  margin: 21px 0 10px;
  font-family: "Poppins", sans-serif;
  font-size: 18px;
}

.sample-service-grid p {
  margin: 0;
  color: #686868;
  font-size: 13px;
  line-height: 1.7;
}

.sample-site-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  padding: 60px clamp(24px, 6vw, 90px);
  background: #0a0a0a;
  color: #fff;
}

.sample-site-contact h2 {
  margin-bottom: 0;
  max-width: 690px;
}

body.preview-open {
  overflow: hidden;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .sample-site-header nav {
    display: none;
  }

  .sample-service-grid {
    grid-template-columns: 1fr;
  }

  .sample-site-contact {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .template-search {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .template-search button {
    grid-column: 1 / -1;
    width: calc(100% - 10px);
    margin: 0 5px 5px;
  }

  .template-results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .template-preview-dialog {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .template-preview-toolbar {
    min-height: 68px;
  }

  .template-preview-toolbar .btn {
    display: none;
  }

  .sample-site-header {
    min-height: 62px;
  }

  .sample-site-header-cta {
    display: none;
  }

  .sample-site-hero {
    min-height: 540px;
  }

  .sample-site-overlay {
    background: rgba(0, 0, 0, .68);
  }

  .sample-site-hero-content {
    margin: 0 auto;
  }

  .sample-site-hero-content h2 {
    font-size: 42px;
  }

  .sample-site-buttons {
    flex-direction: column;
  }

  .sample-site-primary-btn,
  .sample-site-secondary-btn {
    width: 100%;
  }
}