:root {
  --primary: #c1121f; /* Premium Jam Red */
  --primary-light: #e63946;
  --secondary: #2a9d8f; /* Brand Teal/Aqua */
  --bg-color: #f6f3f0; /* Softer contrast background */
  --text-dark: #2c2825;
  --text-light: #f4ecf0;
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

/* Dark Mode Overrides */
body.dark-mode {
  --bg-color: #1a1517;
  --text-dark: #fcf9f5;
  --text-light: #111;
  --primary: #ff4d5a;
  --secondary: #3ecfc1;
}

body.dark-mode header,
body.dark-mode .form-wrapper,
body.dark-mode .gallery-card,
body.dark-mode .contact-info,
body.dark-mode .jam-grid-item {
  background: rgba(40, 30, 35, 0.95);
  color: var(--text-dark);
}

body.dark-mode .filter-btn {
  background: rgba(40, 30, 35, 0.95);
  color: var(--text-dark);
}

body.dark-mode .nav-arrow {
  background: #333;
}

body.dark-mode .filter-btn:hover {
  background: #555;
  color: white;
}

body.dark-mode .jam-grid-item:hover {
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: rgba(252, 249, 245, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 50px;
  height: 50px;
  animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: 1px;
}

/* Theme Toggle Pill Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}
.theme-switch {
  display: inline-block;
  height: 28px;
  position: relative;
  width: 58px;
}
.theme-switch input {
  display: none;
}
.slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 28px;
}
.slider:before {
  background-color: #fff;
  bottom: 4px;
  content: "";
  height: 20px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 20px;
  border-radius: 50%;
  z-index: 2;
}
.slider:after {
  content: '☀️';
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 14px;
  z-index: 1;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(30px);
}
input:checked + .slider:after {
  content: '🌙';
  left: 8px;
  right: auto;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary);
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-image: url('beccas_jams_hero.webp');
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(74, 14, 46, 0.6));
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 2rem;
}

.hero-content h2 {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  margin-bottom: 1rem;
  line-height: 1.1;
  animation: fadeInDown 1s ease-out;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  font-weight: 300;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 500;
  border-radius: 30px;
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.btn:hover {
  background-color: transparent;
  color: white;
  border-color: white;
}

/* About Section */
.about {
  padding: 6rem 5%;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.about h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.about p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1rem;
}

/* Gallery Section */
.gallery-section {
  padding: 6rem 5%;
  background-color: #f7f0f4;
}

.gallery-section h2 {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 3rem;
}

.gallery-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.nav-arrow {
  background: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--primary);
}

.nav-arrow:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.gallery-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 450px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-card.fade-enter {
  opacity: 0;
  transform: scale(0.95);
}

.gallery-card.fade-enter-active {
  opacity: 1;
  transform: scale(1);
}

.gallery-image-wrapper {
  height: 350px;
  overflow: hidden;
}

.gallery-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image-wrapper img {
  transform: scale(1.05);
}

.gallery-info {
  padding: 2rem;
  text-align: center;
}

.gallery-info h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.gallery-info .price {
  color: var(--secondary);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.gallery-info p {
  color: #666;
  font-size: 0.95rem;
}

/* Contact Section */
.contact-section {
  padding: 6rem 5%;
  background-image: linear-gradient(135deg, rgba(74, 14, 46, 0.95), rgba(43, 8, 27, 0.95)), url('blackberry_jalapeno_jam.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-section h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-section p {
  margin-bottom: 3rem;
  font-weight: 300;
}

.form-wrapper {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  color: var(--text-dark);
}

/* --- Premium SurveyJS V2 Form Styling --- */
.sd-root-modern {
  font-family: var(--font-body) !important;
  --sjs-primary-backcolor: var(--primary);
  --sjs-primary-hovercolor: var(--secondary);
}

.sd-container-modern {
  background: transparent !important;
}

/* Remove excess SurveyJS whitespace - MAXIMUM OVERRIDE */
.sd-root-modern,
.sd-container-modern,
.sd-body,
.sd-page,
.sv-components-row,
.sd-element,
.sd-row {
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.sd-footer, .sd-navigation, .sd-action-bar {
  padding-top: 0.5rem !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Hide empty SurveyJS structural elements that take up space */
.sd-logo, 
.sd-page__empty-header,
.sd-question__erbox:empty,
.sd-question__description:empty {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.sv-action-bar-item {
  margin-bottom: 0 !important;
}

.form-wrapper {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem 2rem 0.5rem 2rem !important; /* Severely slice bottom padding */
  width: 100%;
  max-width: 600px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  color: var(--text-dark);
  margin-bottom: 0 !important;
  height: max-content !important;
}

.sd-btn--action {
  background-color: var(--primary) !important;
  color: white !important;
  border-radius: 30px !important;
  padding: 1rem 3rem !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(193, 18, 31, 0.3) !important;
  margin-top: 1rem;
}

.sd-btn--action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(193, 18, 31, 0.4) !important;
  background-color: var(--secondary) !important;
}

.sd-input {
  border: 1px solid rgba(0,0,0,0.1) !important;
  border-radius: 12px !important;
  padding: 0.9rem 1.2rem !important;
  background: #fff !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
  transition: all 0.3s ease !important;
  color: var(--text-dark) !important;
}

.sd-input:focus {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2) !important;
  outline: none;
}

.sd-item__control:checked + .sd-item__decorator {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.sd-question__title {
  font-family: var(--font-heading) !important;
  color: var(--primary) !important;
  font-size: 1.25rem !important;
  margin-bottom: 0.5rem !important;
}

.sd-title {
  font-family: var(--font-heading) !important;
  color: var(--primary) !important;
}

/* Dark Mode Form Overrides */
body.dark-mode .sd-input {
  background: rgba(0,0,0,0.2) !important;
  color: var(--text-dark) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

body.dark-mode .sd-question__title,
body.dark-mode .sd-item__control-label {
  color: var(--text-dark) !important;
}

body.dark-mode .sd-title {
  color: var(--text-dark) !important;
}

.contact-info {
  margin-top: 3rem;
  text-align: center;
  background: rgba(255,255,255,0.1);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

.contact-info p {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Footer */
footer {
  background: #111;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid additions */
.gallery-subtitle {
  text-align: center;
  color: #666;
  margin-top: -2rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.filter-btn {
  background: white;
  border: 1px solid #e0c8d6;
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
}

.filter-btn:hover {
  background: #f7eaf0;
  border-color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.jam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.jam-grid-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jam-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.jam-grid-image {
  height: 200px;
  overflow: hidden;
}

.jam-grid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.jam-grid-item:hover .jam-grid-image img {
  transform: scale(1.05);
}

.jam-grid-info {
  padding: 1rem;
  text-align: center;
}

.jam-grid-info h4 {
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.jam-grid-info span {
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 90%;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--secondary);
}

.gallery-card.full-view {
  width: 90vw;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .hero-content h2 { font-size: 3rem; }
  .gallery-container { flex-direction: column; }
  .modal-content {
    flex-direction: column;
  }
  .modal-close {
    top: -10px;
    right: 10px;
    z-index: 10;
    color: var(--text-dark);
  }
  .nav-arrow { transform: rotate(90deg); margin: 1rem 0; }
  .nav-arrow:hover { transform: rotate(90deg) scale(1.1); }
  .gallery-image-wrapper { height: 250px; }
}
