/* ==========================================================================
   TABLE STORY - BESPOKE ARCHITECTURAL STUDIO DESIGN SYSTEM
   Gold & Charcoal Brand Palette • Paper Linen Grain • TS SVG Icon System
   ========================================================================== */

:root {
  --color-brand-gold: #C99A44;
  --color-brand-gold-light: #F3D08A;
  --color-brand-gold-dark: #8C6420;
  --color-brand-ink: #141210;
  --color-brand-charcoal: #1C1917;
  --color-brand-cream: #FAF9F6;
  --color-brand-canvas: #F7F6F2;
  --color-brand-border: #E7E5E4;
  --color-brand-hairline: rgba(201, 154, 68, 0.35);
  --color-brand-whatsapp: #25D366;
  
  --shadow-ambient: 0 4px 20px -4px rgba(20, 18, 16, 0.04);
  --shadow-lookbook: 0 10px 30px -5px rgba(20, 18, 16, 0.04), 0 2px 6px -2px rgba(20, 18, 16, 0.02);
  --shadow-lookbook-hover: 0 20px 40px -10px rgba(20, 18, 16, 0.08), 0 4px 10px -2px rgba(20, 18, 16, 0.03);
  --transition-studio: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Base resets & typography */
html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-brand-cream);
  color: var(--color-brand-ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.01em;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, p, span, div, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Subtle Paper / Linen Grain Texture (2-3% opacity) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1, h2, h3, .font-display, .font-serif {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.025em;
}

/* Gold Gradient Text Utility */
.gold-gradient-text {
  background: linear-gradient(135deg, #F3D08A 0%, #C99A44 50%, #8C6420 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hairline Gold Dividers */
.gold-hairline-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 154, 68, 0.4) 30%, rgba(201, 154, 68, 0.6) 50%, rgba(201, 154, 68, 0.4) 70%, transparent 100%);
  border: none;
}

/* TS Icon Sprite System */
.ts-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
  flex-shrink: 0;
  color: var(--color-brand-gold);
}

.ts-icon use {
  pointer-events: none;
}

/* Phosphor Icon Normalization */
[class^="ph-"], [class*=" ph-"] {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

/* Custom Architectural Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #FAF9F6;
}
::-webkit-scrollbar-thumb {
  background: #D6D3D1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #C99A44;
}

.scrollbar-none::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.scrollbar-none,
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   PERMANENTLY FIXED ARCHITECTURAL HEADER SYSTEM
   ========================================================================== */
#main-site-header,
.glass-header,
header.sticky {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
  background-color: #FAF8F5 !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(231, 229, 228, 0.8) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Centered Toast Notification Container */
#cartToastContainer,
#cart-toast {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Responsive Cart Drawer Panel */
#cartDrawerPanel {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

@media (min-width: 640px) {
  #cartDrawerPanel {
    max-width: 28rem !important; /* 448px (sm:max-w-md) */
  }
}

/* Architectural Section Dividers & Hairlines */
.studio-hairline {
  height: 1px;
  background-color: var(--color-brand-border);
  width: 100%;
}

.studio-card-sharp {
  background: #FFFFFF;
  border: 1px solid var(--color-brand-border);
  box-shadow: var(--shadow-ambient);
  transition: var(--transition-studio);
}

.studio-card-sharp:hover {
  border-color: #D6D3D1;
  box-shadow: var(--shadow-lookbook);
}

/* Interactive Color Swatch Styling (Double-Ring Studio Highlight) */
.color-swatch-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  transition: var(--transition-studio);
  position: relative;
  outline: none;
  cursor: pointer;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px #E7E5E4;
}

.color-swatch-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 0 0 0 1.5px var(--color-brand-gold);
  z-index: 10;
}

.color-swatch-btn.active {
  transform: scale(1.18);
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3.5px var(--color-brand-gold), 0 4px 12px rgba(201, 154, 68, 0.3);
  z-index: 20;
}

.color-swatch-btn.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #FFFFFF;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

/* Tooltip Badge for Swatches */
.swatch-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #141210;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 50;
}

.color-swatch-btn:hover .swatch-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Product Card Bespoke Studio Aesthetics */
.product-card-wrapper,
.product-card-item,
.product-card {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.product-card {
  background: #FFFFFF;
  border: 1px solid var(--color-brand-border);
  box-shadow: var(--shadow-lookbook);
  transition: var(--transition-studio);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #D6D3D1;
  box-shadow: var(--shadow-lookbook-hover);
}

.product-card:active {
  background-color: #FFFFFF;
}

/* For product cards in grids & showcases */
.product-card-image-wrap,
.product-image-container {
  width: 100%;
  aspect-ratio: 4 / 3; /* Symmetric product framing */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FAF8F5; /* Neutral tone from brand palette */
}

/* Keep the actual product visible (no edge cropping / distortion) */
.product-card-image-wrap img,
.product-image-container img,
.card-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* CRITICAL FIX: No edge is chopped, entire product fits cleanly */
  object-position: center center;
  display: block;
  transition: transform 0.3s ease;
  padding: 0.5rem; /* Consistent breathing room for product silhouettes */
}

/* Hover effects without edge distortion */
.product-card:hover .product-card-image-wrap img,
.product-card:hover .product-image-container img {
  transform: scale(1.03);
}

/* Editorial Badges & Indicators */
.editorial-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-brand-gold);
  display: inline-block;
}

.badge-gold,
.badge-bronze,
.badge-taupe {
  background: #FBF6EE;
  color: #8C6420;
  border: 1px solid #EEDBBE;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
}

/* Clean Header Glass */
.glass-header {
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-brand-border);
}

/* Sleek Horizontal Architectural Brand Logo */
.navbar-brand-logo,
.footer-brand-logo {
  object-fit: contain;
  object-position: left center;
  display: block;
}

.navbar-brand-logo {
  height: 56px;
  width: auto;
  max-width: 240px;
}

@media (max-width: 768px) {
  .navbar-brand-logo {
    height: 48px;
    max-width: 200px;
  }
}

.footer-brand-logo {
  height: 64px;
  width: auto;
  max-width: 220px;
}

@media (max-width: 768px) {
  .footer-brand-logo {
    height: 56px;
  }
}

/* Floating WhatsApp Minimal Button (Pure Brand Green only on WhatsApp widget) */
.floating-whatsapp {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #25D366;
  color: #FFFFFF;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  transition: var(--transition-studio);
  text-decoration: none;
}

.floating-whatsapp:hover {
  transform: scale(1.08);
  background: #1EBE5D;
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45);
}

.floating-whatsapp svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Studio Tabs */
.catalog-product-tab,
.studio-model-btn,
.filter-tab {
  transition: var(--transition-studio);
  cursor: pointer;
}

.catalog-product-tab.active,
.studio-model-btn.active,
.filter-tab.active {
  background-color: var(--color-brand-ink) !important;
  color: #FFFFFF !important;
  border-color: var(--color-brand-ink) !important;
  box-shadow: 0 2px 8px rgba(20, 18, 16, 0.2);
}

/* Finish Cards */
.finish-card {
  background: #FFFFFF;
  border: 1px solid var(--color-brand-border);
  box-shadow: var(--shadow-ambient);
  transition: var(--transition-studio);
}

.finish-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-brand-gold);
  box-shadow: var(--shadow-lookbook);
}

/* Custom Modal Animation */
.modal-overlay {
  background: rgba(20, 18, 16, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-enter {
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
  0% {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Image Optimization, Anti-Stretching & CLS Prevention */
img, picture, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

img {
  image-rendering: -webkit-optimize-contrast;
  content-visibility: auto;
}

.card-preview-img,
.product-img-main,
#heroShowcaseImg,
#studioPreviewImg,
#mainVariantImage,
#main-product-image,
#active-product-image,
.product-main-img,
#modalImg {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
  transition: transform 0.3s ease;
}

/* Fluid Responsive Helper Rules */
@media (max-width: 640px) {
  .product-card {
    border-radius: 1rem;
  }
}

/* ==========================================================================
   DYNAMIC FILTER SINGLE-CARD CENTERING
   ========================================================================== */
#catalogCardsGrid.single-model-active,
#products-grid.single-model-active,
#product-grid.single-model-active,
#directoryGrid.single-model-active,
.single-model-active {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  width: 100% !important;
  grid-template-columns: none !important;
}

#catalogCardsGrid.single-model-active .product-card-wrapper,
#products-grid.single-model-active .product-card,
#product-grid.single-model-active .product-card,
#directoryGrid.single-model-active .directory-card-wrapper {
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  max-width: 440px !important;
}

/* ==========================================================================
   TEMPLES 2-COLUMN NAVIGATION & FOOTER LIST
   ========================================================================== */
.temples-nav-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 8px;
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.temples-nav-list li {
  min-width: 0;
  break-inside: avoid;
}

.temples-nav-list a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

@media (max-width: 640px) {
  .temples-nav-list {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }
}

/* ==========================================================================
   MOBILE-FRIENDLY & RESPONSIVE FILTER BAR
   ========================================================================== */
.filter-pills-container {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
}

.filter-pill {
  flex-shrink: 0;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .filter-pills-container {
    justify-content: flex-start;
  }
}



