/* ============================================
   Gem Sense USA — design tokens
   ============================================ */
:root {
  --navy: #232a4d;
  --navy-soft: #3a4270;
  --ivory: #faf8f4;
  --ivory-deep: #f1ede4;
  --charcoal: #2b2b2b;
  --border: #e3ded2;
  --sapphire: #0f52ba;
  --ruby: #e0115f;
  --emerald: #009b48;

  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --max-width: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--ivory);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.5em;
  line-height: 1.2;
}

p { margin: 0 0 1em; max-width: 62ch; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--sapphire);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================
   Header
   ============================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--ivory);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
}

.brand img { width: 44px; height: 44px; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.brand-name small {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: var(--navy-soft);
  margin-top: 2px;
}

.main-nav { display: flex; align-items: center; gap: 30px; }

.main-nav a {
  text-decoration: none;
  color: var(--charcoal);
  font-size: 0.94rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.main-nav a:hover, .main-nav a.active { border-bottom-color: var(--ruby); }

.nav-cta {
  background: var(--navy);
  color: var(--ivory) !important;
  padding: 9px 20px !important;
  border-radius: var(--radius);
  border-bottom: none !important;
}

.nav-cta:hover { background: var(--navy-soft); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 28px 24px;
    gap: 14px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-cta { margin-top: 6px; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid var(--navy);
  cursor: pointer;
  font-family: var(--sans);
}

.btn-primary { background: var(--navy); color: var(--ivory); }
.btn-primary:hover { background: var(--navy-soft); border-color: var(--navy-soft); }

.btn-outline { background: transparent; color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--ivory); }

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--border);
}

.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }

.hero-eyebrow-line {
  width: 46px;
  height: 2px;
  background: var(--ruby);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  color: var(--navy);
}

.hero p.lede { font-size: 1.08rem; color: #55554f; }

.hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

.hero-art {
  aspect-ratio: 4/5;
  background: linear-gradient(155deg, var(--ivory-deep), #e9e3d3 60%, #ded5bf);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-art svg { width: 55%; }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; aspect-ratio: 16/10; }
}

/* ============================================
   Section scaffolding
   ============================================ */
section { padding: 74px 0; }
.section-border { border-bottom: 1px solid var(--border); }
.section-tight { padding: 50px 0; }

.section-head { max-width: 640px; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); color: var(--navy); }
.section-head p { color: #55554f; }

/* ============================================
   Category tiles (home)
   ============================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.category-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  text-decoration: none;
  color: var(--ivory);
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background-size: cover;
  background-position: center;
}

.category-tile::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,24,45,0.78), rgba(20,24,45,0.05) 60%);
}

.category-tile span { position: relative; font-family: var(--serif); font-size: 1.05rem; }

@media (max-width: 780px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   Product grid + cards
   ============================================ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.toolbar select, .toolbar input[type="search"] {
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--charcoal);
}

.toolbar input[type="search"] { flex: 1; min-width: 180px; }

.result-count { font-size: 0.85rem; color: #6d6a60; margin-left: auto; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

@media (max-width: 940px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-photo {
  aspect-ratio: 1/1;
  background: var(--ivory-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }

.product-tag {
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--ruby);
  margin-bottom: 6px;
}

.product-name { font-family: var(--serif); font-size: 1.08rem; margin-bottom: 4px; color: var(--navy); }

.product-meta { font-size: 0.86rem; color: #6d6a60; margin-bottom: 14px; }

.product-body .btn { margin-top: auto; align-self: flex-start; padding: 8px 16px; font-size: 0.85rem; }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: #6d6a60;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ============================================
   Product detail modal
   ============================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 22, 35, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: #fff;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-photo { background: var(--ivory-deep); }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }

.modal-info { padding: 34px; position: relative; }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--navy);
  line-height: 1;
}

.spec-list { list-style: none; margin: 20px 0; padding: 0; border-top: 1px solid var(--border); }
.spec-list li {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.spec-list li span:first-child { color: #6d6a60; }

@media (max-width: 700px) {
  .modal { grid-template-columns: 1fr; }
  .modal-photo { aspect-ratio: 4/3; }
}

/* ============================================
   Trust strip / testimonials
   ============================================ */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.trust-item h3 { font-size: 1rem; color: var(--navy); }
.trust-item p { font-size: 0.92rem; color: #55554f; }

.gem-rule {
  height: 3px;
  width: 60px;
  background: linear-gradient(90deg, var(--sapphire), var(--ruby), var(--emerald));
  margin-bottom: 16px;
}

/* ============================================
   Forms (contact / admin)
   ============================================ */
.form-grid { display: grid; gap: 18px; max-width: 560px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.88rem; color: var(--navy); }
.form-row input, .form-row textarea, .form-row select {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--charcoal);
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: 0.82rem; color: #6d6a60; }
.form-status { font-size: 0.9rem; margin-top: 8px; }
.form-status.ok { color: var(--emerald); }
.form-status.err { color: var(--ruby); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--navy);
  color: #cfd2e0;
  padding: 56px 0 30px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h3 { color: #fff; font-size: 0.95rem; font-family: var(--sans); margin-bottom: 14px; }
.footer-grid a { color: #cfd2e0; text-decoration: none; display: block; margin-bottom: 8px; font-size: 0.92rem; }
.footer-grid a:hover { color: #fff; }

.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 38px; }
.footer-brand span { font-family: var(--serif); color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.8rem;
  color: #9ba0bd;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ============================================
   Admin page
   ============================================ */
.admin-shell { max-width: 760px; }
.admin-locked { text-align: center; padding: 100px 0; }
.product-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 16px;
}
.product-row .meta { font-size: 0.85rem; color: #6d6a60; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.row-actions button {
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius);
  padding: 6px 12px; font-size: 0.82rem; cursor: pointer;
}
.row-actions button.danger { color: var(--ruby); border-color: var(--ruby); }
