@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* Design Tokens */
:root {
  --leather-tan: #A9744F;
  --leather-dark: #865A3C;
  --leather-light: #C79571;
  --ink-navy: #1F2A44;
  --ink-navy-dark: #131B2C;
  --ink-navy-light: #2D3D60;
  --gold-foil: #C9A227;
  --gold-foil-light: #E5C051;
  --gold-foil-dark: #9F7E1B;
  --linen-cream: #F3EBDD;
  --linen-light: #FAF6F0;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 4px rgba(31, 42, 68, 0.08);
  --shadow-md: 0 8px 24px rgba(31, 42, 68, 0.12);
  --shadow-lg: 0 16px 48px rgba(31, 42, 68, 0.18);
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Montserrat', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Styles */
body {
  font-family: var(--font-sans);
  color: var(--ink-navy);
  background-color: var(--linen-cream);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--linen-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--leather-tan);
  border-radius: 5px;
  border: 2px solid var(--linen-cream);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--leather-dark);
}

/* Gold Foil Accents & Borders */
.gold-border {
  border: 1px solid var(--gold-foil);
  position: relative;
}
.gold-border-double {
  border: 3px double var(--gold-foil);
}
.gold-text {
  color: var(--gold-foil);
  background: linear-gradient(135deg, var(--gold-foil-light) 0%, var(--gold-foil) 50%, var(--gold-foil-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Stitching Border Effect */
.stitch-border {
  border: 1px dashed var(--leather-tan);
  outline: 6px solid transparent;
  outline-offset: -3px;
  position: relative;
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}
.stitch-border::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px solid rgba(169, 116, 79, 0.2);
  pointer-events: none;
}
.stitch-border:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* Buttons */
.btn-premium {
  font-family: var(--font-serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.8rem 2rem;
  border-radius: 0;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-premium-navy {
  background-color: var(--ink-navy);
  color: var(--linen-cream);
  border: 1px solid var(--ink-navy);
}
.btn-premium-navy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--leather-tan);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-premium-navy:hover {
  color: var(--white);
  border-color: var(--leather-tan);
}
.btn-premium-navy:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-premium-gold {
  background: linear-gradient(135deg, var(--gold-foil-light) 0%, var(--gold-foil) 50%, var(--gold-foil-dark) 100%);
  color: var(--ink-navy-dark) !important;
  border: 1px solid var(--gold-foil);
  box-shadow: 0 4px 10px rgba(201, 162, 39, 0.2);
}
.btn-premium-gold:hover {
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
  transform: translateY(-2px);
}

.btn-premium-outline {
  background-color: transparent;
  color: var(--ink-navy);
  border: 1px solid var(--ink-navy);
}
.btn-premium-outline:hover {
  background-color: var(--ink-navy);
  color: var(--linen-cream);
}

/* Header & Navbar */
.navbar-custom {
  background-color: var(--ink-navy-dark);
  border-bottom: 2px solid var(--gold-foil);
  padding: 1rem 0;
  transition: var(--transition-smooth);
}
.navbar-custom .navbar-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--linen-cream);
  font-size: 1.6rem;
}
.navbar-custom .nav-link {
  font-family: var(--font-serif);
  color: var(--linen-cream);
  margin: 0 0.8rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  position: relative;
  transition: var(--transition-smooth);
}
.navbar-custom .nav-link:hover {
  color: var(--gold-foil-light);
  text-shadow: 0 0 8px rgba(229, 192, 81, 0.4);
}
.navbar-custom .nav-link.active {
  color: var(--gold-foil);
  text-shadow: 0 0 8px rgba(201, 162, 39, 0.3);
}

/* Hero Section */
.hero-section {
  position: relative;
  background-color: var(--ink-navy);
  color: var(--linen-cream);
  overflow: hidden;
  padding: 10rem 0;
}
.hero-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  filter: grayscale(30%);
}
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

/* Page Headers */
.page-header {
  background-color: var(--ink-navy);
  color: var(--linen-cream);
  padding: 5rem 0;
  border-bottom: 2px solid var(--gold-foil);
  position: relative;
  overflow: hidden;
}

/* 3D Book Spin Viewer */
.book-viewer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 450px;
  perspective: 1200px;
  position: relative;
  cursor: grab;
  user-select: none;
}
.book-viewer-container:active {
  cursor: grabbing;
}
.book-3d {
  width: 240px;
  height: 340px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(15deg) rotateY(-30deg);
  transition: transform 0.1s ease-out;
}
.book-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.book-front {
  background-color: var(--leather-tan);
  background-image: radial-gradient(circle at 50% 50%, var(--leather-light) 0%, var(--leather-tan) 60%, var(--leather-dark) 100%);
  border-radius: 4px 8px 8px 4px;
  transform: translateZ(20px);
  border: 1px solid var(--leather-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
}
.book-front::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 15px;
  right: 15px;
  border: 2px solid var(--gold-foil);
  pointer-events: none;
  opacity: 0.85;
}
.book-front-content {
  text-align: center;
  margin: auto;
}
.book-front-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-foil-light);
  border: 1px solid var(--gold-foil);
  padding: 0.5rem 1rem;
  display: inline-block;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.book-back {
  background-color: var(--leather-tan);
  background-image: radial-gradient(circle at 50% 50%, var(--leather-light) 0%, var(--leather-tan) 60%, var(--leather-dark) 100%);
  border-radius: 8px 4px 4px 8px;
  transform: rotateY(180deg) translateZ(20px);
  border: 1px solid var(--leather-dark);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
}
.book-back::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 15px;
  right: 15px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  pointer-events: none;
}
.book-spine {
  width: 40px;
  background-color: var(--leather-dark);
  background-image: linear-gradient(to right, #61402a, var(--leather-dark) 50%, #61402a 100%);
  position: absolute;
  height: 100%;
  transform: rotateY(-90deg) translateZ(20px);
  left: -20px;
  border-radius: 4px 0 0 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.book-spine-text {
  font-family: var(--font-serif);
  color: var(--gold-foil-light);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.book-spine::after {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 2px;
  background: var(--gold-foil);
  transform: translateX(-50%);
  opacity: 0.3;
}
.book-pages-right {
  width: 38px;
  background: linear-gradient(to right, #f4e8d1 0%, #fffbf2 80%, #ebdcb9 100%);
  position: absolute;
  height: calc(100% - 10px);
  top: 5px;
  right: -18px;
  transform: rotateY(90deg);
  border-radius: 0 4px 4px 0;
  box-shadow: inset 5px 0 10px rgba(0,0,0,0.1);
  background-size: 3px 100%;
  /* Page lines effect */
  background-image: linear-gradient(90deg, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 4px 100%;
}
.book-pages-top {
  height: 38px;
  background: linear-gradient(to bottom, #ebdcb9 0%, #fffbf2 80%, #f4e8d1 100%);
  position: absolute;
  width: calc(100% - 10px);
  left: 5px;
  top: -18px;
  transform: rotateX(90deg);
  background-image: linear-gradient(0deg, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 100% 4px;
}
.book-pages-bottom {
  height: 38px;
  background: linear-gradient(to top, #ebdcb9 0%, #fffbf2 80%, #f4e8d1 100%);
  position: absolute;
  width: calc(100% - 10px);
  left: 5px;
  bottom: -18px;
  transform: rotateX(-90deg);
  background-image: linear-gradient(0deg, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 100% 4px;
}

/* Before / After Restoration Slider */
.slider-container {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  border: 4px solid var(--leather-tan);
  box-shadow: var(--shadow-md);
  user-select: none;
}
.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}
.slider-img.before {
  z-index: 1;
}
.slider-img.after {
  z-index: 2;
  width: 50%; /* JS alters this */
  border-right: 3px solid var(--gold-foil);
}
.slider-bar {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 50%; /* JS alters this */
  width: 4px;
  background-color: var(--gold-foil);
  cursor: ew-resize;
  transform: translateX(-50%);
}
.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background-color: var(--ink-navy);
  border: 2px solid var(--gold-foil);
  color: var(--gold-foil);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
  pointer-events: none;
}
.slider-label {
  position: absolute;
  bottom: 20px;
  padding: 0.5rem 1rem;
  background-color: rgba(31, 42, 68, 0.85);
  color: var(--linen-cream);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  z-index: 3;
  letter-spacing: 0.1em;
  border: 1px solid var(--gold-foil);
}
.slider-label.before-label {
  right: 20px;
}
.slider-label.after-label {
  left: 20px;
}

/* Materials Interactive Selector */
.material-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-smooth);
}
.material-card.active {
  border-color: var(--gold-foil);
  box-shadow: var(--shadow-md);
  transform: scale(1.03);
}
.material-preview-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Gallery Styles */
.gallery-filter-btn {
  font-family: var(--font-serif);
  border: none;
  background: transparent;
  padding: 0.5rem 1.5rem;
  color: var(--ink-navy);
  position: relative;
  letter-spacing: 0.08em;
  transition: var(--transition-smooth);
}
.gallery-filter-btn.active {
  color: var(--gold-foil-dark);
  font-weight: bold;
}
.gallery-filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background-color: var(--gold-foil);
}
.gallery-item {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(31, 42, 68, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-smooth);
  padding: 2rem;
  text-align: center;
  border: 2px solid var(--gold-foil);
  margin: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Shopping Cart Offcanvas */
.cart-offcanvas {
  background-color: var(--linen-light);
  border-left: 2px solid var(--gold-foil);
  color: var(--ink-navy);
}
.cart-header {
  border-bottom: 1px solid var(--leather-tan);
}
.cart-footer {
  border-top: 1px solid var(--leather-tan);
  padding-top: 1.5rem;
}
.cart-item {
  border-bottom: 1px dashed rgba(169, 116, 79, 0.3);
  padding: 1rem 0;
}

/* Form Styles */
.form-custom {
  background-color: var(--white);
  padding: 3rem;
}
.form-custom label {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink-navy);
}
.form-custom .form-control, 
.form-custom .form-select {
  border-radius: 0;
  border: 1px solid rgba(31, 42, 68, 0.2);
  padding: 0.75rem 1rem;
  background-color: var(--linen-light);
  transition: var(--transition-smooth);
}
.form-custom .form-control:focus, 
.form-custom .form-select:focus {
  border-color: var(--leather-tan);
  box-shadow: 0 0 0 0.25rem rgba(169, 116, 79, 0.15);
  background-color: var(--white);
}

/* Footer Section */
.footer-custom {
  background-color: var(--ink-navy-dark);
  color: var(--linen-cream);
  padding: 5rem 0 0 0;
  border-top: 3px double var(--gold-foil);
}
/* Newsletter Form Customizations */
.footer-custom .form-control {
  border-radius: 0 !important;
  color: var(--white) !important;
}
.footer-custom .form-control::placeholder {
  color: rgba(243, 235, 221, 0.6) !important;
  opacity: 1 !important;
}
.footer-custom .input-group {
  border-radius: 0 !important;
}
.footer-custom .input-group .btn {
  background-color: var(--gold-foil) !important;
  color: var(--ink-navy-dark) !important;
  border-radius: 0 !important;
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: var(--transition-smooth);
}
.footer-custom .input-group .btn:hover {
  background-color: var(--gold-foil-light) !important;
  color: var(--ink-navy-dark) !important;
}
.footer-custom h5 {
  color: var(--gold-foil-light);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}
.footer-custom p, .footer-custom li {
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-custom a {
  color: var(--linen-cream);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-custom a:hover {
  color: var(--gold-foil-light);
  padding-left: 5px;
}
.footer-bottom {
  background-color: #111827;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(243, 235, 221, 0.1);
  font-size: 0.85rem;
  color: rgba(243, 235, 221, 0.65) !important;
}

/* Animations */
@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}
.shine-effect {
  position: relative;
  overflow: hidden;
}
.shine-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shine 6s infinite;
}
