/* IMPORT FONTS */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Poppins:wght@300;400;500&display=swap');

/* GLOBAL RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f4e8e6; /* Light pastel burgundy */
  color: #3d3d3d; /* main text color matching pastel theme */
}

/* Hide header only on home page */
body.home header {
  display: none;
}

/* Paragraph defaults */
section p {
  font-size: 18px;
  color: #4a3a36; /* slightly darker for readability on pastel bg */
  margin-bottom: 40px;
}

/* HEADER */
header {
  padding: 45px 20px; /* slightly increased padding for other pages */
  background-color: #f4e8e6; /* match Spline bg */
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.site-header .logo {
  height: 80px;
  width: auto;
}

header h1 {
  font-size: 42px; /* slightly increased for non-home pages */
  color: #8F887D; /* Luxurious Furniture header color */
  font-family: 'Playfair Display', serif;
  text-align: center;
}

/* HAMBURGER MENU (mobile) */
.menu-icon {
  display: none;
  font-size: 28px;
  color: #3d3d3d;
  padding: 10px 20px;
  cursor: pointer;
  background-color: #f4e8e6; /* pastel bg */
}

/* NAVIGATION BAR */
nav {
  background-color: #f4e8e6; /* match Spline bg */
  overflow: hidden;
}

nav a {
  text-decoration: none;
  padding: 20px;
  text-align: center;
  float: left;
  color: #3d3d3d;
  transition: color 0.3s ease;
  font-weight: 500;
}

nav a:hover {
  color: #7B1E3A; /* burgundy accent */
}

/* MAIN CONTENT */
main {
  background-color: #f4e8e6; /* Light pastel burgundy */
  text-align: center;
  flex: 1;
}

/* SECTION STYLING */
section {
  padding: 40px 20px;
  background-color: #f4e8e6; /* unify bg to Spline */
}

h2 {
  padding: 20px;
  color: #3d3d3d;
  font-family: 'Playfair Display', serif;
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* PRODUCT CARD */
.product-card {
  background: #f4e8e6; /* match site bg */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.product-card .image-container {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f4e8e6;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-grow: 1;
}

.product-card h3 {
  font-size: 18px;
  color: #4a3a36;
  font-family: 'Playfair Display', serif;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 14px;
  color: #66504a;
  flex-grow: 1;
  margin-bottom: 12px;
}

/* BUTTON */
.view-details-btn {
  padding: 10px 18px;
  background-color: #7B1E3A; /* exact burgundy button */
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: background-color 0.3s ease;
  margin-top: auto;
}

.view-details-btn:hover {
  background-color: #5F1630; /* slightly darker on hover */
}

/* FOOTER */
footer {
  background-color: #f4e8e6; /* match site bg */
  overflow: hidden;
}

footer a {
  text-decoration: none;
  padding: 20px;
  text-align: center;
  float: left;
  color: #3d3d3d;
  font-size: 0.9em;
  transition: color 0.3s ease;
}

footer a:hover {
  background-color: #f4e8e6;
}

/* DECOR SECTION */
.decor-section {
  background-color: #f4e8e6;
  text-align: center;
  padding: 60px 20px;
}

.decor-section h2,
.signature-section h2,
.bespoke-section h2 {
  font-size: 36px;
  margin-bottom: 15px;
  font-family: 'Playfair Display', serif;
  color: #3d3d3d;
}

.bespoke-section,
.signature-section {
  background-color: #f4e8e6;
  padding: 60px 20px;
  text-align: center;
}

.bespoke-section p {
  font-size: 18px;
  color: #3d3d3d;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.bespoke-section .btn {
  padding: 12px 24px;
  background-color: #7B1E3A; /* burgundy button */
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.bespoke-section .btn:hover {
  background-color: #5F1630; /* slightly darker */
}

/* PAGE HEIGHT FIX */
html, body {
  height: 100%;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header h1 {
    font-size: 24px;
    padding: 10px;
  }

  .site-header {
    flex-direction: column;
    gap: 8px;
  }

  .menu-icon {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    text-align: left;
    width: 100%;
  }

  nav.active {
    display: flex;
  }

  nav a {
    float: none;
    padding: 15px;
    border-bottom: 1px solid #f4e8e6;
    background-color: #f4e8e6;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card .image-container {
    height: 200px;
  }

  .product-card h3,
  .product-card p {
    min-height: auto;
  }
}

/* Hamburger Icon */
.menu-icon {
  font-size: 28px;
  padding: 16px;
  cursor: pointer;
  display: none;
  background-color: #f4e8e6;
  color: #3d3d3d;
  z-index: 1001;
}

/* Side Navigation */
.side-nav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  background-color: #f4e8e6;
  overflow-x: hidden;
  transition: 0.3s;
  padding-top: 60px;
}

.side-nav a {
  padding: 12px 24px;
  text-decoration: none;
  font-size: 18px;
  color: #3d3d3d;
  display: block;
  transition: 0.3s;
}

/* Hover effect */
.side-nav a:hover {
  background-color: #f5dada;
}

/* ACTIVE LINK FIX: Home and other pages */
.side-nav a.active {
  color: #7B1E3A !important;
  font-weight: bold;
}

/* Also ensure Home link shows active if body.home */
body.home .side-nav a[href="index.html"] {
  color: #7B1E3A !important;
  font-weight: bold;
}

.side-nav .closebtn {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 36px;
  color: #3d3d3d;
  text-decoration: none;
}

/* Hamburger Button */
.openbtn {
  font-size: 26px;
  cursor: pointer;
  background-color: transparent;
  color: #3d3d3d;
  padding: 10px 20px;
  border: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
}

/* ===== SPLINE HERO ===== */
.spline-hero {
  width: 100%;
  height: 95vh; /* slightly cropped to hide logo */
  background: #f4e8e6; /* exact same as site bg */
}

.spline-hero spline-viewer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Spline wrapper as a viewport */
.spline-wrapper {
  width: 100%;
  height: 90vh;          /* smaller viewport */
  overflow: hidden;      /* hide overflowing content */
  position: relative;
}

/* Spline viewer inside wrapper */
spline-viewer {
  width: 100%;
  height: 120%;
  max-width: 1200px;
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  object-fit: cover;
}

/* ===========================
   RESPONSIVE FIXES (SAFE)
   NO DESIGN CHANGES
   =========================== */

/* Fix viewport height issues on mobile browsers */
@supports (-webkit-touch-callout: none) {
  .spline-hero,
  .spline-wrapper {
    height: 100svh;
  }
}

/* Ensure spline always stays centered */
.spline-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spline-wrapper spline-viewer {
  position: relative;
  top: 0;
  left: 0;
  transform: none;
}

/* ===========================
   DESKTOP PRODUCT GRID FIX
   3 CARDS PER ROW
   =========================== */

@media (min-width: 769px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile Optimization for Spline 3D */
@media screen and (max-width: 768px) {

  /* 1. Main Container */
  .hero-container-class-name {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    padding-top: 0;
    display: flex;
    flex-direction: column;
  }

  /* 2. The Spline Viewer */
  spline-viewer, .spline-wrapper {
    /* Keep width huge to show full text */
    width: 350% !important; 
    
    /* Centering & Scaling */
    position: relative;
    left: 50%;
    transform: translateX(-50%) scale(0.28); 
    transform-origin: top center;

    /* THE FIX: */
    /* 1. Increase height so the bottom of the sofa is NOT cropped */
    height: 70vh !important; 
    
    /* 2. Positioning */
    margin-top: 100px; 
    margin-left: 0 !important;
    margin-right: 0 !important;
    
    /* 3. Pull the "Signature Collection" text UP to cover empty space */
    margin-bottom: -180px; 
    
    display: block;
    z-index: 1;
  }

  /* 3. The Text Content Below */
  .text-content-class {
    position: relative;
    z-index: 5;
    text-align: center;
    padding-bottom: 50px;
    margin-top: 0;
  }

  /* 4. Menu Icon */
  .menu-icon-class {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 9999;
  }
}
/* Mobile Optimization for Spline 3D */
@media screen and (max-width: 768px) {

  /* 1. Main Container */
  .hero-container-class-name {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    padding-top: 0;
    display: flex;
    flex-direction: column;
  }

  /* 2. The Spline Viewer */
  spline-viewer, .spline-wrapper {
    /* --- EXACT POSITIONING (DO NOT CHANGE) --- */
    width: 350% !important;
    height: 90vh !important; 
    position: relative;
    left: 52%; 
    transform: translateX(-50%) scale(0.29); 
    transform-origin: top center;
    margin-top: 30px; 
    margin-left: 0 !important;
    margin-right: 0 !important;
    /* ----------------------------------------- */

    /* THE FIX: Reduced from -550px to -420px. 
       This pushes the text down JUST enough to show the legs. */
    margin-bottom: -500px; 
    
    display: block;
    z-index: 1;
  }

  /* 3. The Text Content Below */
  .text-content-class {
    position: relative;
    z-index: 5;
    text-align: center;
    padding-bottom: 50px;
    margin-top: 0;
  }

  /* 4. Signature Section */
  .signature-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 10;
  }

  /* 5. Menu Icon */
  .menu-icon-class {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 9999;
  }

  /* Extra safety to keep logo hidden */
  spline-viewer a {
    display: none !important;
  }
}