:root {
  --rust: #c1440e;
  --rust-dark: #9c3609;
  --khaki: #d8c3a5;
  --brown: #3e2723;
  --cream: #fbf7f0;
  --green: #4e5d45;
  --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Verdana, sans-serif;
  background: var(--cream);
  color: var(--brown);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

header { background: var(--brown); color: var(--white); position: sticky; top: 0; z-index: 100; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; max-width: 1100px; margin: 0 auto;
}

.nav-brand { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; font-weight: 700; letter-spacing: 0.5px; }
.nav-brand img { height: 68px; width: auto; max-width: 230px; object-fit: contain; }
.nav-brand { padding: 4px 0; }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { font-weight: 600; padding: 6px 2px; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.nav-links a:hover, .nav-links a.active { border-color: var(--rust); }

.nav-cta { background: var(--rust); color: var(--white) !important; padding: 10px 20px; border-radius: 4px; font-weight: 700; }
.nav-cta:hover { background: var(--rust-dark); }

.hero { background: linear-gradient(135deg, var(--khaki) 0%, var(--cream) 100%); padding: 70px 0; }
.hero-inner { display: flex; align-items: center; gap: 48px; flex-wrap: wrap; }
.hero-text { flex: 1 1 420px; }
.hero-text h1 { font-size: 2.6rem; margin-bottom: 16px; color: var(--rust-dark); }
.hero-text p { font-size: 1.15rem; margin-bottom: 28px; max-width: 480px; }
.hero-img { flex: 1 1 380px; }
.hero-img img { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.btn {
  display: inline-block; background: var(--rust); color: var(--white);
  padding: 14px 30px; border-radius: 4px; font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
}
.btn:hover { background: var(--rust-dark); }
.btn-outline { background: transparent; border: 2px solid var(--rust); color: var(--rust); margin-left: 12px; }
.btn-outline:hover { background: var(--rust); color: var(--white); }

section { padding: 64px 0; }
.section-title { text-align: center; font-size: 2rem; color: var(--rust-dark); margin-bottom: 12px; }
.section-sub { text-align: center; max-width: 600px; margin: 0 auto 40px; color: #6b5a4e; }

.product-grid { display: flex; flex-wrap: wrap; gap: 28px; }
.product-card { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.08); transition: transform 0.2s, flex-basis 0.05s; position: relative; flex: 1 1 240px; max-width: 100%; }
.product-card:hover { transform: translateY(-4px); }
.product-card .img-wrap { height: 200px; overflow: hidden; background: var(--khaki); position: relative; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 20px; }
.product-body h3 { color: var(--rust-dark); margin-bottom: 6px; font-size: 1.2rem; }
.product-body p { font-size: 0.95rem; color: #6b5a4e; margin-bottom: 14px; }
.price-tag { font-weight: 700; color: var(--green); font-size: 1.05rem; display: block; margin-bottom: 14px; }
.placeholder-note { font-size: 0.75rem; background: #fff3e0; color: #8a5a00; padding: 3px 8px; border-radius: 3px; display: inline-block; margin-bottom: 10px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; text-align: center; }
.feature h3 { color: var(--rust-dark); margin-bottom: 8px; }
.feature .icon { font-size: 2.2rem; margin-bottom: 12px; }

.band { background: var(--green); color: var(--white); text-align: center; padding: 50px 0; }
.band h2 { margin-bottom: 10px; font-size: 1.7rem; }
.band p { margin-bottom: 22px; opacity: 0.9; }
.band .btn { background: var(--rust); }

.about-grid { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; }
.about-grid img { border-radius: 12px; flex: 1 1 340px; }
.about-text { flex: 1 1 400px; }
.about-text h2 { color: var(--rust-dark); margin-bottom: 16px; font-size: 1.8rem; }
.about-text p { margin-bottom: 16px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.info-card { background: var(--white); padding: 28px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.info-card h3 { color: var(--rust-dark); margin-bottom: 12px; }

form { display: flex; flex-direction: column; gap: 14px; }
form input, form textarea { padding: 12px; border: 1px solid var(--khaki); border-radius: 6px; font-family: inherit; font-size: 1rem; }
form textarea { min-height: 120px; resize: vertical; }

footer { background: var(--brown); color: var(--white); padding: 36px 0; text-align: center; font-size: 0.9rem; }
footer a { text-decoration: underline; }

@media (max-width: 700px) {
  .nav { flex-wrap: wrap; gap: 12px; }
  .nav-links { gap: 16px; font-size: 0.9rem; }
  .hero-text h1 { font-size: 2rem; }
}

/* --- Inline Edit Mode --- */
#edit-toolbar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1000;
  background: var(--brown);
  padding: 10px 14px;
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

#edit-toolbar button {
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

#edit-toggle-btn { background: var(--rust); color: var(--white); }
#edit-toggle-btn:hover { background: var(--rust-dark); }
#edit-save-btn { background: var(--green); color: var(--white); }
#edit-save-btn:hover { opacity: 0.9; }

#edit-hint {
  color: var(--white);
  font-size: 0.8rem;
  max-width: 160px;
}

body.site-editing .editing-target {
  outline: 2px dashed var(--rust);
  outline-offset: 2px;
  cursor: text;
}

body.site-editing .editing-target:hover {
  background: rgba(193, 68, 14, 0.08);
}

body.site-editing .editing-target-img {
  cursor: pointer;
  outline: 2px dashed var(--green);
  outline-offset: 2px;
}

body.site-editing .editing-target-img:hover {
  filter: brightness(0.85);
}

@media print {
  #edit-toolbar { display: none; }
}


/* --- Resize handles (edit mode) --- */
.resize-handle {
  display: none;
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  background: var(--rust);
  border: 2px solid var(--white);
  border-radius: 4px;
  cursor: ns-resize;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body.site-editing .resize-handle { display: block; }


/* --- Delete button (edit mode) --- */
.delete-card-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #c0392b;
  color: var(--white);
  border: 2px solid var(--white);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.delete-card-btn:hover { background: #922b21; }

body.site-editing .delete-card-btn { display: block; }


/* --- Section delete (edit mode) --- */
section { position: relative; }

.delete-section-btn {
  display: none;
  position: absolute;
  top: 16px;
  right: 24px;
  background: #c0392b;
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.delete-section-btn:hover { background: #922b21; }

body.site-editing .delete-section-btn { display: block; }


/* --- Width resize handle (edit mode) --- */
.resize-handle-w {
  display: none;
  position: absolute;
  top: 50%;
  right: -3px;
  transform: translateY(-50%);
  width: 14px;
  height: 40px;
  background: var(--green);
  border: 2px solid var(--white);
  border-radius: 4px;
  cursor: ew-resize;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body.site-editing .resize-handle-w { display: block; }

/* --- Spacing control (edit mode) --- */
#spacing-control {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--white);
  font-size: 0.8rem;
}

body.site-editing #spacing-control { display: flex; }

/* --- About page slideshow --- */
.about-slideshow {
  position: relative;
  flex: 1 1 340px;
  border-radius: 12px;
  overflow: hidden;
  height: 320px;
  background: var(--khaki);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.about-slideshow .slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.about-slideshow .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--khaki);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.about-slideshow .slide.active { opacity: 1; }

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: var(--white);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-arrow:hover { background: rgba(0,0,0,0.7); }
.slide-arrow.prev { left: 12px; }
.slide-arrow.next { right: 12px; }

.slide-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.slide-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.2);
}

.slide-dots .dot.active { background: var(--rust); }

/* --- Slideshow edit-mode controls --- */
.resize-handle-slideshow, .resize-handle-photo-w, .resize-handle-photo-h {
  display: none;
  position: absolute;
  background: var(--green);
  border: 2px solid var(--white);
  border-radius: 4px;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.resize-handle-slideshow-w, .resize-handle-photo-w {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 44px;
  cursor: ew-resize;
}

.resize-handle-slideshow-h, .resize-handle-photo-h {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 16px;
  cursor: ns-resize;
}

body.site-editing .resize-handle-slideshow,
body.site-editing .resize-handle-photo-w,
body.site-editing .resize-handle-photo-h { display: block; }

/* --- About page: resizable stationary photo --- */
.resizable-photo-wrap {
  position: relative;
  flex: 1 1 340px;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.resizable-photo-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.slide-add-btn {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--rust);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.slide-add-btn:hover { background: var(--rust-dark); }
body.site-editing .slide-add-btn { display: block; }

/* --- Section title delete (edit mode) --- */
.title-delete-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.title-delete-btn {
  display: none;
  position: absolute;
  top: -6px;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c0392b;
  color: var(--white);
  border: 2px solid var(--white);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.title-delete-btn:hover { background: #922b21; }
body.site-editing .title-delete-btn { display: block; }

.slide-remove-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c0392b;
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.slide-remove-btn:hover { background: #922b21; }
body.site-editing .slide-remove-btn { display: block; }

/* --- In-store-only tag --- */
.instore-tag {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}

/* --- Mobile safety net ---
   Elements resized via the edit tools get fixed pixel widths (e.g. "width: 640px")
   set as inline styles so they hold their size on desktop. Inline styles normally
   beat stylesheet rules, so on small screens we force them back to full width
   with !important, which is the one thing that can override an inline style. */
@media (max-width: 640px) {
  .about-slideshow,
  .resizable-photo-wrap,
  .product-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  body { overflow-x: hidden; }
}

/* --- Standalone text delete (edit mode) --- */
.text-delete-wrap {
  position: relative;
  display: block;
}

.text-delete-btn {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c0392b;
  color: var(--white);
  border: 2px solid var(--white);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.text-delete-btn:hover { background: #922b21; }
body.site-editing .text-delete-btn { display: block; }

/* --- Add Text Box button (edit mode) --- */
#add-text-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

#add-text-btn:hover { opacity: 0.9; }

/* --- Add Product button (edit mode) --- */
.add-product-btn {
  display: none;
  margin: 20px auto 0;
  background: transparent;
  border: 2px dashed var(--green);
  color: var(--green);
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
}

.add-product-btn:hover { background: rgba(78, 93, 69, 0.08); }
body.site-editing .add-product-btn { display: block; }
