/* ================================
   Jacob & Co – Maison & Jardin
   Global Styles
=================================== */

:root {
  --green: #708E6C;
  --green-header: rgba(145, 175, 141, 0.94);
  --green-dark: #5b7557;
  --beige: #F7F5F0;
  --text: #2F2F2F;
  --white: #ffffff;
  --shadow: 0 4px 14px rgba(0,0,0,.12);
  --radius: 15px;
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--beige);
  color: var(--text);
  line-height: 1.6;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--green-header);
  color: var(--white);
  padding: 1.1rem 2.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  backdrop-filter: blur(3px);
  transition: transform .25s ease;
}

.header--hidden {
  transform: translateY(-100%);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 260px;
}

.logo {
  height: 120px;
  width: auto;
  border-radius: 10px;
}

.logo-link {
  display: inline-block;
  transition: transform 0.2s ease;
}
.logo-link:hover {
  transform: scale(1.03);
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.9rem;
  margin: 0;
}

.slogan {
  margin: .15rem 0 0;
  font-style: italic;
  font-size: 1rem;
  color: #eef2ea;
}

/* ---------- Navigation ---------- */
nav {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: .25rem .1rem;
  transition: opacity .2s ease, transform .2s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: rgba(255,255,255,.85);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

nav a:hover {
  opacity: .95;
  transform: translateY(-1px);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 70vh;
  min-height: 520px;
  background: url('images/provencal-house.jpg') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.44));
}

.hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.25rem;
}

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw + .5rem, 3rem);
  margin-bottom: 1.25rem;
}

/* HERO BUTTON GROUP */
.hero-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Buttons (IDENTICAL HERO) ---------- */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--green);
  color: var(--white);
  padding: 0.9rem 2rem;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  line-height: 1.1;
  white-space: nowrap;
}

/* HERO buttons get big size */
.hero-buttons .btn {
  width: 100%;
  height: 64px;
}

/* Secondary hero button */
.btn-secondary {}

/* Hover */
.btn:hover,
.btn-secondary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

/* ---------- CONTACT BUTTON FIX ---------- */
section#contact .btn {
  width: auto !important;
  height: auto !important;
  padding: 0.9rem 2rem !important;
  font-size: 1rem !important;
  border-radius: 40px !important;
}

/* ---------- Sections ---------- */
section {
  padding: 3.25rem 2rem;
  text-align: center;
}

section[id] {
  scroll-margin-top: 120px;
}

section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: .75rem;
}

section p {
  margin: .5rem auto;
  max-width: 900px;
}

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 26px rgba(0,0,0,.14);
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.gallery-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: .85rem 1.1rem;
  font-weight: 500;
}

/* ---------- Footer ---------- */
footer {
  background: var(--green);
  color: var(--white);
  text-align: center;
  padding: 1.3rem 1rem;
  margin-top: 2rem;
}

/* ---------- Modal Contact ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
}

.modal-content {
  background: var(--white);
  margin: 8% auto;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
  max-width: 500px;
  text-align: left;
  position: relative;
}

.modal-content h3 {
  text-align: center;
  margin-top: 0;
}

.close {
  position: absolute;
  right: 15px; top: 10px;
  font-size: 1.8rem;
  color: var(--green-dark);
  cursor: pointer;
}

.close:hover {
  color: var(--green);
}

/* ---------- Contact Form ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  resize: vertical;
}

.status {
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--green-dark);
}

/* ---------- Chat Widget ---------- */

#jcq-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1f2937;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 9999;
}

#jcq-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  max-width: 100vw;
  max-height: 420px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

#jcq-window.jcq-hidden {
  display: none;
}

.jcq-header {
  background: #111827;
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

.jcq-messages {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jcq-msg {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.3;
  word-wrap: break-word;
}

.jcq-bot {
  background: #e5e7eb;
  align-self: flex-start;
}
.jcq-user {
  background: #1f2937;
  color: var(--white);
  align-self: flex-end;
}

.jcq-service-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.jcq-service-buttons button {
  flex: 1 1 calc(50% - 6px);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  background: #111827;
  color: var(--white);
}

/* Quote form */
.jcq-form {
  border-top: 1px solid #e5e7eb;
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: stretch;
}

#jcq-input {
  border: none;
  padding: 10px;
  font-size: 14px;
  border-right: 1px solid #e5e7eb;
  outline: none;
}

.jcq-form button {
  border: none;
  font-size: 14px;
  font-weight: 600;
  background: #111827;
  color: var(--white);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .logo {
    height: 96px;
  }

  nav {
    gap: 1.25rem;
  }

  .hero-buttons {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

/* ---------- FINAL MOBILE FIX ---------- */
@media (max-width: 600px) {

  #jcq-window {
    left: 10px;
    right: 10px;
    bottom: 80px;
    width: auto;
    max-height: 60vh;
    overflow-y: auto !important;
  }

  .jcq-form {
    display: block;
    padding: 10px;
  }

  #jcq-input {
    display: block;
    width: 100%;
    margin: 0 0 10px 0;
    padding: 10px;
    font-size: 16px;
    border-right: none;
    border: 1px solid #e5e7eb;
  }

  .jcq-form button {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
  }

  #jcq-bubble {
    right: 14px;
    bottom: 20px;
    width: 50px;
    height: 50px;
  }
}
