/* ===================================================================
   CAVTILES SHOP — DESIGN TOKENS
=================================================================== */
:root{
  --white:  #FFFFFF;
  --paper:  #F5F3EE;
  --ink:    #1C1B18;
  --slate:  #33443A;
  --slate-dark: #253029;
  --brass:  #A8895C;
  --line:   #E4E0D6;
  --muted:  rgba(28,27,24,0.62);
  --danger: #A8412F;

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1360px;
  --gutter: clamp(18px, 4vw, 60px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body{
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}
body.has-mobile-nav{ padding-bottom: 66px; }

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
h1,h2,h3{ font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
p{ margin: 0; }
select, input{ font: inherit; }

.skip-link{ position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white); padding: 12px 20px; z-index: 999; }
.skip-link:focus{ left: 12px; top: 12px; }
:focus-visible{ outline: 2px solid var(--slate); outline-offset: 3px; }

/* ===================================================================
   BUTTONS
=================================================================== */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; font-size: 0.92rem; border: 1px solid transparent; border-radius: 2px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary{ background: var(--slate); color: var(--white); }
.btn-primary:hover{ background: var(--slate-dark); }
.btn-ghost{ border-color: var(--white); color: var(--white); }
.btn-ghost:hover{ background: rgba(255,255,255,0.16); }
.btn-outline{ border-color: var(--ink); color: var(--ink); }
.btn-outline:hover{ background: var(--ink); color: var(--white); }
.btn-small{ padding: 10px 18px; font-size: 0.84rem; }
.btn-text{ border: none; text-decoration: underline; text-underline-offset: 3px; padding: 10px 6px; }

/* ===================================================================
   ANNOUNCEMENT BAR
=================================================================== */
.announcement-bar{ background: var(--slate); color: var(--white); text-align: center; padding: 8px var(--gutter); font-size: 0.8rem; letter-spacing: 0.01em; }

/* ===================================================================
   HEADER
=================================================================== */
.site-header{ position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--line); }

.header-top-inner{
  max-width: var(--container); margin: 0 auto; padding: 16px var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
}
.logo{ font-family: var(--serif); font-size: 1.5rem; grid-column: 2; justify-self: center; }
.header-icons{ grid-column: 3; display: flex; align-items: center; gap: 16px; }
.icon-btn{ width: 22px; height: 22px; position: relative; color: var(--ink); }
.icon-btn svg{ width: 20px; height: 20px; }
.basket-count{
  position: absolute; top: -8px; right: -10px; background: var(--slate); color: var(--white);
  font-size: 0.62rem; line-height: 1; padding: 3px 5px; border-radius: 20px; min-width: 16px; text-align: center;
}
.nav-toggle{ display: none; grid-column: 1; width: 26px; height: 20px; flex-direction: column; justify-content: space-between; }
.nav-toggle span{ display: block; height: 1px; background: var(--ink); width: 100%; }

@media (min-width: 861px){
  .header-top-inner{ grid-template-columns: 1fr auto 1fr; }
  .logo{ grid-column: 1; justify-self: start; }
  .header-icons{ justify-self: end; }
}

.search-panel{ max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); border-top: 1px solid transparent; }
.search-panel.is-open{ max-height: 90px; border-top-color: var(--line); }
.search-panel-inner{ max-width: var(--container); margin: 0 auto; padding: 16px var(--gutter); display: flex; gap: 12px; }
.search-panel-inner input{ flex: 1; border: 1px solid var(--line); padding: 12px 16px; border-radius: 2px; }
.search-panel-inner button{ background: var(--slate); color: var(--white); padding: 0 22px; border-radius: 2px; }

.primary-nav{
  max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: clamp(16px, 2vw, 28px);
  font-size: 0.86rem; overflow-x: auto;
}
.primary-nav a{ padding: 13px 0; white-space: nowrap; position: relative; }
.primary-nav a:not(.nav-shop)::after{
  content:''; position: absolute; left: 0; right: 100%; bottom: 9px; height: 1px; background: var(--ink);
  transition: right 0.3s var(--ease);
}
.primary-nav a:not(.nav-shop):hover::after{ right: 0; }
.nav-shop{
  font-weight: 600; background: var(--ink); color: var(--white); padding: 8px 18px !important;
  border-radius: 2px; margin: 8px 0;
}
.nav-shop:hover{ background: var(--slate); }

@media (max-width: 860px){
  .primary-nav{
    position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); height: 100vh; background: var(--white);
    flex-direction: column; align-items: flex-start; padding: 100px 32px; gap: 22px; font-size: 1.05rem;
    transform: translateX(100%); transition: transform 0.4s var(--ease); overflow-x: visible; z-index: 90;
  }
  .primary-nav.is-open{ transform: translateX(0); }
  .nav-toggle{ display: flex; }
  body.nav-locked{ overflow: hidden; }
}

/* ===================================================================
   HERO
=================================================================== */
.hero{ position: relative; min-height: 84vh; display: flex; align-items: center; overflow: hidden; color: var(--white); }
.hero-media{ position: absolute; inset: 0; }
.hero-media img{ width: 100%; height: 100%; object-fit: cover; }
.hero-media::after{ content:''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(27,26,23,0.78) 0%, rgba(27,26,23,0.5) 48%, rgba(27,26,23,0.25) 100%); }
.hero-content{ position: relative; z-index: 2; max-width: var(--container); width: 100%; margin: 0 auto; padding: 90px var(--gutter) 150px; }
.hero-content h1{ font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.03; max-width: 15ch; }
.hero-content p{ margin-top: 22px; max-width: 42ch; font-size: clamp(1rem, 1.3vw, 1.1rem); }
.hero-ctas{ display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.filter-panel{
  position: relative; z-index: 3; max-width: var(--container); margin: -70px auto 0; width: calc(100% - 2 * var(--gutter));
  background: var(--white); color: var(--ink); border-radius: 2px;
  box-shadow: 0 20px 50px rgba(27,26,23,0.14); padding: 26px clamp(20px, 3vw, 36px);
}
.filter-title{ font-size: 0.92rem; font-weight: 500; margin-bottom: 16px; }
.filter-row{ display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
.filter-field{ display: flex; flex-direction: column; gap: 6px; }
.filter-field label{ font-size: 0.78rem; color: var(--muted); }
.filter-field select{ border: 1px solid var(--line); padding: 12px 14px; border-radius: 2px; background: var(--white); }
.filter-submit{ background: var(--slate); color: var(--white); padding: 13px 30px; border-radius: 2px; white-space: nowrap; transition: background-color 0.25s var(--ease); }
.filter-submit:hover{ background: var(--slate-dark); }

@media (max-width: 720px){
  .filter-row{ grid-template-columns: 1fr; }
  .hero-content{ padding-bottom: 190px; }
}

/* ===================================================================
   SHARED SECTION RHYTHM
=================================================================== */
main > section{ padding: clamp(56px, 7vw, 110px) var(--gutter); }
.section-head{ max-width: var(--container); margin: 0 auto 40px; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head h2{ font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.section-head p{ color: var(--muted); max-width: 34ch; font-size: 0.95rem; }

/* ===================================================================
   SHOP BY CATEGORY
=================================================================== */
.category-section{ background: var(--paper); }
.category-track{
  max-width: var(--container); margin: 0 auto; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.category-card{ background: var(--white); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; display: block; transition: box-shadow 0.3s var(--ease); }
.category-card:hover{ box-shadow: 0 14px 34px rgba(27,26,23,0.1); }
.category-media{ aspect-ratio: 4/3; overflow: hidden; }
.category-media img{ width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.category-card:hover .category-media img{ transform: scale(1.06); }
.category-info{ display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.category-info h3{ font-size: 1.05rem; }
.category-count{ font-size: 0.82rem; color: var(--muted); }
.category-arrow{ font-size: 1.2rem; transition: transform 0.3s var(--ease); }
.category-card:hover .category-arrow{ transform: translateX(4px); }

@media (max-width: 900px){ .category-track{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .category-track{ grid-template-columns: 1fr; } }

/* ===================================================================
   SHOP BY ROOM
=================================================================== */
.room-grid{ max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 14px; }
.room-lg{ grid-column: span 2; grid-row: span 2; }
.room-card{ position: relative; overflow: hidden; border-radius: 2px; display: block; }
.room-card img{ width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.room-card::before{ content:''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27,26,23,0.05) 45%, rgba(27,26,23,0.78) 100%); }
.room-card:hover img{ transform: scale(1.06); }
.room-caption{ position: absolute; left: 18px; bottom: 16px; z-index: 1; color: var(--white); font-family: var(--serif); font-size: 1.1rem; }

@media (max-width: 900px){ .room-grid{ grid-template-columns: repeat(2, 1fr); } .room-lg{ grid-column: span 2; } }
@media (max-width: 560px){ .room-grid{ grid-template-columns: 1fr; grid-auto-rows: 200px; } .room-lg{ grid-column: span 1; grid-row: span 1; } }

/* ===================================================================
   PRODUCT GRID
=================================================================== */
.product-grid{ max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 20px; }
.product-card{ display: flex; flex-direction: column; }
.product-media{ position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; }
.product-media img{ width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.product-card:hover .product-media img{ transform: scale(1.05); }
.colour-dot{
  position: absolute; top: 12px; left: 12px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--dot); border: 1px solid rgba(255,255,255,0.7); box-shadow: 0 0 0 1px rgba(27,26,23,0.12);
}
.quick-view{
  position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 12px);
  background: var(--white); color: var(--ink); font-size: 0.78rem; padding: 9px 18px; border-radius: 2px;
  opacity: 0; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 6px 16px rgba(27,26,23,0.14);
}
.product-card:hover .quick-view{ opacity: 1; transform: translate(-50%, 0); }
.product-info{ padding-top: 14px; }
.product-info h3{ font-size: 1rem; font-family: var(--sans); font-weight: 500; }
.product-spec{ font-size: 0.84rem; color: var(--muted); margin-top: 4px; }
.product-price{ font-size: 0.98rem; margin-top: 8px; font-weight: 500; }
.product-price span{ font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.product-link{ display: inline-block; margin-top: 10px; font-size: 0.84rem; text-decoration: underline; text-underline-offset: 3px; }

.view-all-wrap{ max-width: var(--container); margin: 44px auto 0; display: flex; justify-content: center; }

@media (max-width: 980px){ .product-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px){ .product-grid{ grid-template-columns: repeat(2, 1fr); gap: 20px 14px; } }

/* ===================================================================
   QUICK VIEW MODAL
=================================================================== */
.quick-view-modal{ position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.quick-view-modal.is-open{ display: flex; }
.qv-backdrop{ position: absolute; inset: 0; background: rgba(27,26,23,0.5); }
.qv-panel{
  position: relative; z-index: 1; background: var(--white); max-width: 640px; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; border-radius: 2px; overflow: hidden;
}
.qv-media{ aspect-ratio: 1/1; }
.qv-media img{ width: 100%; height: 100%; object-fit: cover; }
.qv-info{ padding: 30px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.qv-info h3{ font-size: 1.3rem; }
.qv-close{ position: absolute; top: 10px; right: 14px; font-size: 1.6rem; line-height: 1; z-index: 2; color: var(--ink); }
.qv-info .btn{ margin-top: 10px; }

@media (max-width: 560px){ .qv-panel{ grid-template-columns: 1fr; } }

/* ===================================================================
   DESIGN YOUR SPACE
=================================================================== */
.design-space{ display: grid; grid-template-columns: 1.1fr 0.9fr; padding: 0 !important; }
.design-media{ min-height: 420px; overflow: hidden; }
.design-media img{ width: 100%; height: 100%; object-fit: cover; }
.design-content{ background: var(--paper); padding: clamp(44px, 6vw, 90px); display: flex; flex-direction: column; justify-content: center; }
.design-content h2{ font-size: clamp(1.8rem, 3vw, 2.6rem); }
.design-content p{ margin-top: 20px; color: var(--muted); max-width: 48ch; }
.design-content .hero-ctas{ margin-top: 30px; }

@media (max-width: 860px){ .design-space{ grid-template-columns: 1fr; } .design-media{ min-height: 300px; } }

/* ===================================================================
   TRADE
=================================================================== */
.trade-section{ background: var(--slate); color: var(--white); }
.trade-content{ max-width: var(--container); margin: 0 auto; text-align: left; }
.trade-content > h2{ font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 40px; }
.trade-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-bottom: 44px; }
.trade-item h3{ font-family: var(--sans); font-weight: 600; font-size: 1rem; margin-bottom: 10px; }
.trade-item p{ font-size: 0.9rem; color: rgba(247,245,241,0.78); }
.trade-content .btn-primary{ background: var(--white); color: var(--slate-dark); }
.trade-content .btn-primary:hover{ background: var(--paper); }

@media (max-width: 860px){ .trade-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px){ .trade-grid{ grid-template-columns: 1fr; } }

/* ===================================================================
   SHOWROOMS
=================================================================== */
.showroom-grid{ max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.showroom-card{ border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.showroom-media{ aspect-ratio: 16/9; overflow: hidden; }
.showroom-media img{ width: 100%; height: 100%; object-fit: cover; }
.showroom-body{ padding: 26px clamp(20px, 3vw, 32px); }
.showroom-body h3{ font-size: 1.4rem; }
.showroom-name{ font-size: 0.95rem; margin-top: 6px; color: var(--muted); }
.showroom-address, .showroom-hours{ font-size: 0.9rem; margin-top: 14px; color: var(--muted); line-height: 1.6; }
.showroom-phone{ margin-top: 10px; font-size: 0.95rem; }
.showroom-phone a{ text-decoration: underline; text-underline-offset: 3px; }
.showroom-ctas{ display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }

@media (max-width: 760px){ .showroom-grid{ grid-template-columns: 1fr; } }

/* ===================================================================
   TRUST
=================================================================== */
.trust-section{ background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-grid{ max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.trust-item{ display: flex; flex-direction: column; gap: 6px; }
.trust-number{ font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); color: var(--slate); }
.trust-static{ font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--slate); }
.trust-label{ font-size: 0.86rem; color: var(--muted); }

@media (max-width: 700px){ .trust-grid{ grid-template-columns: repeat(2, 1fr); gap: 32px 16px; } }

/* ===================================================================
   INSPIRATION
=================================================================== */
.inspiration-grid{ max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px; }
.inspiration-lead{ grid-row: span 2; }
.inspiration-card{ display: block; }
.inspiration-card img{ width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; transition: transform 0.5s var(--ease); }
.inspiration-lead img{ aspect-ratio: 4/5; }
.inspiration-card:hover img{ transform: scale(1.02); }
.inspiration-text{ padding-top: 16px; }
.tag{ font-size: 0.8rem; color: var(--brass); }
.inspiration-text h3{ font-size: 1.1rem; margin-top: 8px; line-height: 1.32; }

@media (max-width: 900px){ .inspiration-grid{ grid-template-columns: 1fr 1fr; } .inspiration-lead{ grid-column: span 2; grid-row: auto; } }
@media (max-width: 560px){ .inspiration-grid{ grid-template-columns: 1fr; } .inspiration-lead{ grid-column: span 1; } }

/* ===================================================================
   NEWSLETTER
=================================================================== */
.newsletter-section{ background: var(--ink); color: var(--white); text-align: center; }
.newsletter-inner{ max-width: 560px; margin: 0 auto; }
.newsletter-inner h2{ font-size: clamp(1.8rem, 3vw, 2.6rem); }
.newsletter-inner > p{ margin-top: 14px; color: rgba(247,245,241,0.78); }
.newsletter-form{ display: flex; gap: 10px; margin-top: 30px; }
.newsletter-form input{ flex: 1; padding: 13px 16px; border: 1px solid rgba(247,245,241,0.3); background: none; color: var(--white); border-radius: 2px; }
.newsletter-form input::placeholder{ color: rgba(247,245,241,0.55); }
.newsletter-form button{ background: var(--white); color: var(--ink); padding: 0 26px; border-radius: 2px; font-weight: 500; }
.newsletter-note{ margin-top: 14px; font-size: 0.85rem; color: var(--brass); min-height: 1em; }

@media (max-width: 480px){ .newsletter-form{ flex-direction: column; } }

/* ===================================================================
   FOOTER
=================================================================== */
.site-footer{ background: var(--paper); border-top: 1px solid var(--line); }
.footer-top{ max-width: var(--container); margin: 0 auto; padding: 60px var(--gutter) 40px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.footer-logo{ font-size: 1.4rem; margin-bottom: 14px; }
.footer-brand p{ font-size: 0.9rem; color: var(--muted); max-width: 32ch; }
.footer-social{ display: inline-block; margin-top: 14px; font-size: 0.86rem; text-decoration: underline; text-underline-offset: 3px; }
.footer-col h4{ font-family: var(--sans); font-weight: 600; font-size: 0.88rem; margin-bottom: 16px; }
.footer-col a, .footer-col p{ display: block; font-size: 0.88rem; margin-bottom: 12px; color: var(--muted); line-height: 1.6; }
.footer-col a:hover{ color: var(--ink); }
.footer-col p a{ display: inline; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom{ max-width: var(--container); margin: 0 auto; padding: 20px var(--gutter); border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }

@media (max-width: 900px){ .footer-top{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px){ .footer-top{ grid-template-columns: 1fr; } }

/* ===================================================================
   MOBILE STICKY NAV
=================================================================== */
.mobile-nav{ display: none; }

@media (max-width: 700px){
  .mobile-nav{
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: var(--white); border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav-item{
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 0.66rem; color: var(--ink); padding: 4px 0;
  }
  .mobile-nav-item svg{ width: 20px; height: 20px; }
}
