/* ========================================
   SiteBuilder Engine - Default Styles
   Mobile-first responsive design
   Override via client css/custom.css
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Safe fallback defaults - overridden by each client's custom.css */
  /* These prevent invisible text/nav when a client CSS misses a variable */
  --color-primary: #2563eb;
  --color-primary-dark: #1e3a5f;
  --color-primary-light: #3b82f6;
  --color-accent: #0ea5e9;
  --color-accent-light: #bae6fd;
  --color-surface: #ffffff;
  --color-white: #ffffff;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-muted: #767676;
  --color-border: #e0e0e0;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Structural - same for all clients */
  --max-width: 1200px;
  --spacing: 1rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.6;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  line-height: 1.2;
}

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

/* --- Header --- */
.site-header {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--spacing) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing);
}

.logo img {
  width: 180px;
  height: auto;
}

.header-info {
  text-align: right;
}

.header-info .tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.9;
}

.header-info .phone {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-info .phone a {
  color: var(--color-white);
}

.header-info .phone a:hover {
  color: var(--color-accent-light);
}

/* --- Navigation --- */
.main-nav {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 0.75rem;
}

.nav-toggle {
  display: block;
  background: none;
  border: 2px solid rgba(255,255,255,0.5);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: var(--radius);
  width: 100%;
  text-align: center;
}

.nav-toggle:hover {
  border-color: var(--color-white);
}

.nav-menu {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 0;
  margin-top: 0.5rem;
}

.nav-menu.is-open {
  display: flex;
}

.nav-menu li a {
  display: block;
  color: var(--color-white);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 500;
  transition: background 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] {
  background: rgba(255,255,255,0.15);
  color: var(--color-accent-light);
}

/* Desktop nav */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    gap: 0;
    margin-top: 0;
  }

  .nav-menu li a {
    border-bottom: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
  }
}

/* --- Hero (Home Page) --- */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: var(--color-white);
  padding: 3rem var(--spacing);
  text-align: center;
}

.hero h1 {
  color: var(--color-white);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-cta {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.hero-cta:hover {
  background: var(--color-accent-light);
  color: var(--color-white);
}

@media (min-width: 768px) {
  .hero {
    padding: 5rem var(--spacing);
  }
  .hero h1 {
    font-size: 3rem;
  }
}

/* --- Category Cards (Home Page) --- */
.categories-section {
  padding: 3rem var(--spacing);
}

.categories-section h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--color-border);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--color-border);
  transition: transform 0.3s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card .card-body {
  padding: 1rem;
}

.category-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* --- Product Catalog Page --- */
.page-header {
  background: var(--color-surface);
  padding: 2rem var(--spacing);
  border-bottom: 3px solid var(--color-primary);
}

.page-header h1 {
  font-size: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header p {
  max-width: var(--max-width);
  margin: 0.5rem auto 0;
  color: var(--color-text-light);
}

.product-section {
  padding: 2rem var(--spacing);
  max-width: var(--max-width);
  margin: 0 auto;
}

.category-heading {
  font-size: 1.6rem;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
}

.category-heading:first-child {
  margin-top: 0;
}

.subcategory-heading {
  font-size: 1.2rem;
  color: var(--color-primary-light);
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--color-surface);
  transition: transform 0.3s ease;
}

.product-card:hover img {
  transform: scale(1.05);
}

.product-card .product-info {
  padding: 0.75rem;
}

.product-card h3 {
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.product-card .product-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary, #2a5a2a);
  margin-bottom: 0.25rem;
}

.product-card .product-desc {
  font-size: 0.8rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.product-placeholder {
  width: 100%;
  height: 140px;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.product-placeholder span {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
}

.product-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  columns: 2;
  column-gap: 2rem;
}

@media (max-width: 480px) {
  .product-list {
    columns: 1;
  }
}

.product-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
  break-inside: avoid;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.product-list-name {
  font-weight: 500;
}

.product-list-price {
  font-weight: 600;
  color: var(--color-primary, #2a5a2a);
  margin-left: 1rem;
  white-space: nowrap;
}

.subcategory-desc {
  color: var(--color-text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* --- Category Detail Page --- */
.category-intro {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.product-detail-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.product-detail-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-surface);
  transition: transform 0.3s ease;
}

.product-detail-card:hover img {
  transform: scale(1.03);
}

.product-detail-card .product-info {
  padding: 1.25rem;
}

.product-detail-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.product-detail-card .product-desc {
  margin-bottom: 0.5rem;
}

.product-detail-card .product-uses {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.product-detail-card .product-uses strong {
  color: var(--color-text);
}

@media (min-width: 768px) {
  .product-detail-card {
    flex-direction: row;
  }
  .product-detail-card img {
    width: 250px;
    height: auto;
    min-height: 180px;
  }
}

/* --- About Page --- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem var(--spacing);
}

.about-content h2 {
  font-size: 1.6rem;
  margin: 2rem 0 1rem;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.about-photos img {
  border-radius: var(--radius);
  border: 2px solid var(--color-border);
  transition: transform 0.3s ease;
}

.about-photos img:hover {
  transform: scale(1.03);
}

@media (min-width: 768px) {
  .about-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Contact Page --- */
.contact-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--spacing);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-details h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.contact-details p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.contact-details .address {
  font-size: 1.1rem;
}

.contact-map {
  min-height: 300px;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 0;
}

/* Single-column contact layout for clients without address/map */
.contact-grid--single {
  grid-template-columns: 1fr;
  max-width: 600px;
}

/* --- Info Banner (used on home) --- */
.info-banner {
  background: var(--color-surface);
  padding: 2rem var(--spacing);
  text-align: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.info-banner .info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (min-width: 600px) {
  .info-banner .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.info-item h2 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.info-item p {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 2rem var(--spacing) 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

@media (min-width: 600px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-content a {
  color: rgba(255,255,255,0.85);
}

.footer-content a:hover {
  color: var(--color-accent-light);
}

.copyright {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
  padding-top: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Shop / Shopify Integration --- */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.shop-product-card {
  display: flex;
  flex-direction: column;
}

.shop-product-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.shop-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.shop-product-card .product-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.shop-product-card:hover .product-image img {
  transform: scale(1.05);
}

.shop-product-card .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.shop-product-card .product-name {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.shop-product-card .product-price {
  margin-bottom: 0.75rem;
}

.price-compare {
  text-decoration: line-through;
  color: var(--color-text-light);
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.price-current {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.shop-add-to-cart {
  margin-top: auto;
  width: 100%;
  cursor: pointer;
}

.collection-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.collection-filter {
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white, #fff);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.collection-filter:hover,
.collection-filter.active {
  background: var(--color-primary);
  color: var(--color-white, #fff);
  border-color: var(--color-primary);
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none;
  transition: visibility 0.3s;
}

.cart-drawer[aria-hidden="false"] {
  pointer-events: auto;
}

.cart-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
}

.cart-drawer[aria-hidden="false"] .cart-drawer-overlay {
  opacity: 1;
}

.cart-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 85vw);
  background: var(--color-white, #fff);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer[aria-hidden="false"] .cart-drawer-content {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text);
}

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  color: var(--color-text-light);
  padding: 2rem 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-image {
  border-radius: var(--radius);
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.cart-item-variant {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.cart-item-price {
  font-size: 0.85rem;
  font-weight: 500;
}

.cart-item-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0.25rem;
}

.cart-item-remove:hover {
  color: #e11d48;
}

.cart-drawer-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.cart-checkout-button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

/* Cart badge in nav */
.cart-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-white, #fff);
  position: relative;
  padding: 0.25rem 0.5rem;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent);
  color: var(--color-white, #fff);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* --- Image Gallery --- */
.sb-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.sb-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sb-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (min-width: 768px) {
  .sb-gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .sb-gallery img {
    height: 200px;
  }
}

/* --- Lightbox Overlay --- */
.sb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
}

.sb-lightbox[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
}

.sb-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.sb-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sb-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.sb-lightbox-caption {
  color: #fff;
  text-align: center;
  padding: 0.75rem 1rem 0;
  font-size: 0.95rem;
  max-width: 600px;
}

.sb-lightbox-counter {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  padding-top: 0.25rem;
}

.sb-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2001;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.sb-lightbox-close:hover {
  opacity: 1;
}

.sb-lightbox-prev,
.sb-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2001;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  line-height: 1;
  border-radius: var(--radius);
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.sb-lightbox-prev:hover,
.sb-lightbox-next:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}

.sb-lightbox-prev {
  left: 1rem;
}

.sb-lightbox-next {
  right: 1rem;
}

@media (max-width: 600px) {
  .sb-lightbox-prev,
  .sb-lightbox-next {
    font-size: 2rem;
    padding: 0.4rem 0.6rem;
  }
}

/* --- Carousel --- */
.sb-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.sb-carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.sb-carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.sb-carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.sb-carousel-prev,
.sb-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  line-height: 1;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s;
}

.sb-carousel:hover .sb-carousel-prev,
.sb-carousel:hover .sb-carousel-next {
  opacity: 1;
}

.sb-carousel-prev { left: 0.75rem; }
.sb-carousel-next { right: 0.75rem; }

.sb-carousel-prev:hover,
.sb-carousel-next:hover {
  background: rgba(0,0,0,0.6);
}

.sb-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.sb-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.sb-carousel-dot.active {
  background: rgba(255,255,255,0.9);
}

/* Carousel caption overlay */
.sb-carousel-caption {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  padding: 0.5rem 1rem;
}

.sb-carousel-caption h2 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.sb-carousel-caption p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Contact form styles */
.contact-form {
  margin-top: 2rem;
}

.contact-form h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(45, 90, 39, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-submit {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* --- Scroll-triggered animations --- */
/* Elements start hidden/offset, become visible when .sb-visible is added by scroll-animate.js */

.sb-animate-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.sb-animate-fade.sb-visible {
  opacity: 1;
}

.sb-animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sb-animate-slide-up.sb-visible {
  opacity: 1;
  transform: translateY(0);
}

.sb-animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sb-animate-slide-left.sb-visible {
  opacity: 1;
  transform: translateX(0);
}

.sb-animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sb-animate-slide-right.sb-visible {
  opacity: 1;
  transform: translateX(0);
}

.sb-animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sb-animate-scale.sb-visible {
  opacity: 1;
  transform: scale(1);
}

/* Blur-in animation - content blurs into focus */
.sb-animate-blur-in {
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.7s ease, filter 0.7s ease;
}
.sb-animate-blur-in.sb-visible {
  opacity: 1;
  filter: blur(0);
}

/* Zoom animation - subtle zoom from 85% */
.sb-animate-zoom {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sb-animate-zoom.sb-visible {
  opacity: 1;
  transform: scale(1);
}

/* Slow variant for hero sections */
.sb-animate-slow {
  transition-duration: 1s !important;
}

/* FAQ section styles */
.faq-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 var(--spacing);
}

.faq-section h2 {
  margin-bottom: 1.5rem;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 0;
}

.faq-question {
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::before {
  content: "+";
  display: inline-block;
  width: 1.5em;
  font-weight: 700;
  color: var(--color-primary);
  transition: transform 0.2s;
}

details[open] .faq-question::before {
  content: "−";
}

.faq-answer {
  padding: 0 0 1rem 1.5em;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* --- Video embed (responsive 16:9) --- */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 1.5rem auto;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.video-embed iframe,
.video-embed video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed--native {
  padding-bottom: 0;
  height: auto;
  background: transparent;
}

.video-embed--native video {
  position: static;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* --- Search page (Pagefind) --- */
.search-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 var(--spacing);
}

.search-page h1 {
  margin-bottom: 1.5rem;
}

/* Theme Pagefind UI to match site colors */
.pagefind-ui {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--color-primary);
  --pagefind-ui-text: var(--color-text);
  --pagefind-ui-background: var(--color-white);
  --pagefind-ui-border: var(--color-border);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: var(--radius);
  --pagefind-ui-font: var(--font-body);
}

.pagefind-ui__result-link {
  color: var(--color-primary);
}

.pagefind-ui__result-link:hover {
  color: var(--color-primary-dark);
}

/* ========================================
   Video Hero & Parallax
   ======================================== */

/* --- Video Background Hero --- */
.sb-video-hero {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-video-hero video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}
.sb-video-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}
.sb-video-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  padding: var(--spacing);
  max-width: var(--content-width, 900px);
}
.sb-video-hero-content h1,
.sb-video-hero-content h2 {
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Mobile: replace video with poster image for performance */
@media (max-width: 768px) {
  .sb-video-hero video {
    display: none;
  }
  .sb-video-hero {
    background-size: cover;
    background-position: center;
  }
}

/* --- Parallax Sections --- */
.sb-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* iOS doesn't support background-attachment: fixed - fallback to scroll */
@supports (-webkit-touch-callout: none) {
  .sb-parallax {
    background-attachment: scroll;
  }
}

/* ========================================
   Interactive Components
   ======================================== */

/* --- Back to Top Button --- */
.sb-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
  z-index: 90;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.sb-back-to-top.sb-visible {
  opacity: 0.85;
  transform: translateY(0);
}
.sb-back-to-top:hover {
  opacity: 1;
  background: var(--color-primary-dark);
}

/* --- Animated Counter --- */
.sb-counter {
  font-variant-numeric: tabular-nums;
}

/* --- Cookie Consent Banner --- */
.sb-cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-dark);
  color: var(--color-white);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.sb-cookie-consent.sb-visible {
  transform: translateY(0);
}
.sb-cookie-consent-inner {
  max-width: var(--content-width, 1200px);
  margin: 0 auto;
  padding: 1rem var(--spacing);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.sb-cookie-consent-text {
  margin: 0;
  font-size: 0.9rem;
  flex: 1;
  min-width: 200px;
}
.sb-cookie-consent-btn {
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background-color 0.2s;
}
.sb-cookie-consent-btn:hover {
  background: var(--color-primary-dark, var(--color-primary-dark));
}

/* --- Announcement Bar --- */
.sb-announcement {
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  padding: 0.65rem var(--spacing);
  position: relative;
  font-size: 0.9rem;
  transition: max-height 0.3s, opacity 0.3s, padding 0.3s;
  overflow: hidden;
}
.sb-announcement p {
  margin: 0;
}
.sb-announcement a {
  color: var(--color-white);
  text-decoration: underline;
}
.sb-announcement-close {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.sb-announcement-close:hover {
  opacity: 1;
}
.sb-announcement.sb-dismissed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

/* --- Tabs --- */
.sb-tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.sb-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-light, var(--color-text));
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.sb-tab-btn:hover {
  color: var(--color-primary);
}
.sb-tab-btn.sb-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.sb-tab-panel {
  display: none;
}
.sb-tab-panel.sb-active {
  display: block;
}

/* --- Before/After Image Comparison --- */
.sb-before-after {
  position: relative;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  border-radius: var(--radius);
  line-height: 0;
}
.sb-before-after img {
  display: block;
  width: 100%;
  height: auto;
}
.sb-ba-after {
  position: relative;
  width: 100%;
}
.sb-ba-after img {
  display: block;
  width: 100%;
}
.sb-ba-before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}
.sb-ba-before img {
  display: block;
  width: auto;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  object-position: left;
}
.sb-ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: var(--color-white);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.sb-ba-handle-line {
  flex: 1;
  width: 3px;
  background: var(--color-white);
}
.sb-ba-handle-grip {
  background: var(--color-white);
  color: var(--color-dark);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  letter-spacing: 4px;
  padding-left: 4px;
}
.sb-ba-label {
  position: absolute;
  bottom: 0.75rem;
  background: rgba(0,0,0,0.6);
  color: var(--color-white);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
  line-height: 1.4;
}
.sb-ba-label-before { left: 0.75rem; }
.sb-ba-label-after { right: 0.75rem; }

/* --- Floating CTA --- */
.sb-floating-cta {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
  z-index: 89;
  white-space: nowrap;
}
.sb-floating-cta.sb-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.sb-floating-cta:hover {
  background: var(--color-primary-dark, var(--color-primary-dark));
  color: var(--color-white);
}

/* --- Form Validation --- */
.sb-invalid {
  border-color: var(--color-danger, #dc2626) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.sb-field-error {
  display: block;
  color: var(--color-danger, #dc2626);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* --- Scroll Progress Bar --- */
.sb-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-primary);
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ========================================
   Reduced Motion & Accessibility
   ======================================== */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  [class*="sb-animate-"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .sb-back-to-top,
  .sb-cookie-consent,
  .sb-floating-cta {
    transition: none !important;
  }
  .sb-counter {
    /* Skip animation - show final value immediately */
  }
  .sb-video-hero video {
    display: none;
  }
  .sb-video-hero {
    background-size: cover;
    background-position: center;
  }
  .sb-parallax {
    background-attachment: scroll;
  }
}

/* ========================================
   Editable Tracker
   ======================================== */

/* Toolbar above editable tables */
.sb-tracker-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sb-tracker-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  background: var(--color-white, #fff);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.sb-tracker-btn:hover {
  background: var(--color-surface, #f8f8f8);
  border-color: var(--color-primary);
}

.sb-tracker-btn--clear {
  color: var(--color-danger, #dc2626);
  border-color: var(--color-danger, #dc2626);
}

.sb-tracker-btn--clear:hover {
  background: var(--color-danger, #dc2626);
  color: var(--color-white, #fff);
}

.sb-tracker-btn--pdf {
  color: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
}

.sb-tracker-btn--pdf:hover {
  background: var(--color-primary, #2563eb);
  color: var(--color-white, #fff);
}

/* Editable cell hover/focus */
table.sb-editable td[contenteditable="true"] {
  cursor: text;
  transition: background-color 0.15s;
}

table.sb-editable td[contenteditable="true"]:hover {
  background-color: rgba(37, 99, 235, 0.04);
}

table.sb-editable td[contenteditable="true"]:focus {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: -2px;
  background-color: rgba(37, 99, 235, 0.06);
}

/* --- Cloud Save/Load Panel (encrypted storage) --- */

.sb-cloud-panel {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--color-surface, #f8f9fa);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--radius, 6px);
}

.sb-cloud-panel__header {
  margin-bottom: 1rem;
}

.sb-cloud-panel__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary, #2563eb);
  margin-bottom: 0.35rem;
}

.sb-cloud-panel__desc {
  font-size: 0.9rem;
  color: var(--color-muted, #666);
  line-height: 1.5;
  margin: 0;
}

.sb-cloud-panel__fields {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.sb-cloud-field {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.sb-cloud-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text, #333);
  margin-bottom: 0.3rem;
}

.sb-cloud-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--color-border, #ddd);
  border-radius: var(--radius, 4px);
  background: var(--color-white, #fff);
  color: var(--color-text, #333);
  outline: none;
  transition: border-color 0.15s;
}

.sb-cloud-input:focus {
  border-color: var(--color-primary, #2563eb);
}

.sb-cloud-toggle-pass {
  position: absolute;
  right: 0.5rem;
  top: 1.65rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--color-muted, #888);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.sb-cloud-panel__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.sb-cloud-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius, 4px);
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.sb-cloud-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.sb-cloud-btn--save {
  background: var(--color-primary, #2563eb);
  color: var(--color-white, #fff);
}

.sb-cloud-btn--save:hover:not(:disabled) {
  opacity: 0.9;
}

.sb-cloud-btn--load {
  background: var(--color-white, #fff);
  color: var(--color-primary, #2563eb);
  border: 1px solid var(--color-primary, #2563eb);
}

.sb-cloud-btn--load:hover:not(:disabled) {
  background: var(--color-primary, #2563eb);
  color: var(--color-white, #fff);
}

.sb-cloud-status {
  padding: 0.6rem 1rem;
  border-radius: var(--radius, 4px);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.sb-cloud-status--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.sb-cloud-status--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sb-cloud-status--working {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.sb-cloud-panel__warning {
  font-size: 0.8rem;
  color: var(--color-muted, #888);
  font-style: italic;
  margin: 0;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  /* Hide non-content elements */
  .site-header,
  .site-footer,
  .main-nav,
  .sb-tracker-toolbar,
  .sb-cloud-panel,
  .sb-cookie-consent,
  .sb-floating-cta,
  .sb-back-to-top,
  .sb-announcement,
  .sb-scroll-progress,
  .preview-banner {
    display: none !important;
  }

  /* Reset backgrounds and shadows */
  body {
    background: #fff !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* Clean table output */
  table.sb-editable {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  table.sb-editable th,
  table.sb-editable td {
    border: 1px solid #999 !important;
    padding: 0.4rem 0.6rem !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
  }

  table.sb-editable thead th {
    background: #eee !important;
    font-weight: 700 !important;
  }

  /* Remove editable styling */
  table.sb-editable td[contenteditable="true"] {
    outline: none !important;
  }
}
