/*
Theme Name: CTM Living
Theme URI: https://ctmliving.com
Author: CTM Living Malta
Author URI: https://ctmliving.com
Description: A premium, editorial WooCommerce theme built for CTM Living Malta — beds, mattresses and sleep specialists since 1994. Combines a Sevyat-inspired dark-navy and gold aesthetic with a fully dynamic homepage (live product categories, best sellers, and a combined blog + shop "Sleep Journal" feed), full WooCommerce support and Yoast SEO compatibility.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: ctm-living
Tags: e-commerce, custom-logo, custom-menu, featured-images, footer-widgets, translation-ready
*/

/* =========================================================
   0. RESET / BASE
   ========================================================= */
:root{
  --navy:#10161f;
  --navy-2:#161e2a;
  --cream:#f6f2ea;
  --cream-2:#efe8db;
  --gold:#c9a15a;
  --gold-light:#e3c78c;
  --ink:#1b2029;
  --muted:#6b7280;
  --line:#e7e1d4;
  --radius:2px;
  --maxw:1240px;
}
*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; background:var(--cream); color:var(--ink);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased;
  font-size:16px; line-height:1.6;
}
h1,h2,h3,h4,.serif{ font-family:'Cormorant Garamond',Georgia,serif; font-weight:600; letter-spacing:.01em; margin:0; }
.em{ font-style:italic; color:var(--gold); font-weight:500; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; height:auto; }
ul{ margin:0; }
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 32px; }
.eyebrow{ text-transform:uppercase; letter-spacing:.18em; font-size:11.5px; color:var(--gold); font-weight:600; }
.screen-reader-text{ position:absolute !important; clip:rect(1px,1px,1px,1px); width:1px; height:1px; overflow:hidden; }

/* =========================================================
   1. TOP BAR + HEADER
   ========================================================= */
.topbar{ background:var(--navy); color:#c7cddb; font-size:12.5px; }
.topbar .wrap{ display:flex; justify-content:space-between; align-items:center; height:40px; flex-wrap:wrap; gap:8px; }
.topbar-left{ display:flex; gap:26px; flex-wrap:wrap; }
.topbar-left span{ display:flex; align-items:center; gap:7px; }
.topbar-left a{ color:inherit; }
.topbar-right{ display:flex; gap:16px; align-items:center; }
.topbar-right a{ opacity:.8; }
.topbar-right a:hover{ opacity:1; color:var(--gold-light); }

header.site{ background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50; }
.navrow{ display:flex; align-items:center; justify-content:space-between; height:86px; gap:24px; }
.site-logo img{ height:52px; width:auto; }
.site-logo{ font-family:'Cormorant Garamond',serif; font-size:26px; font-weight:600; }
nav.main-nav{ display:flex; gap:34px; flex:1; justify-content:center; }
nav.main-nav ul{ list-style:none; display:flex; gap:34px; padding:0; margin:0; }
nav.main-nav li{ position:relative; }
nav.main-nav a{ font-size:13px; letter-spacing:.05em; text-transform:uppercase; font-weight:600; color:var(--ink); padding:6px 0; display:inline-block; border-bottom:2px solid transparent; transition:.2s; }
nav.main-nav a:hover, nav.main-nav .current-menu-item > a{ border-color:var(--gold); }
nav.main-nav ul ul{ display:none; position:absolute; top:100%; left:0; background:#fff; border:1px solid var(--line); min-width:220px; padding:10px 0; box-shadow:0 18px 40px rgba(20,20,20,.09); z-index:10; }
nav.main-nav li:hover > ul{ display:block; }
nav.main-nav ul ul a{ display:block; padding:9px 18px; text-transform:none; letter-spacing:0; font-size:13.5px; font-weight:500; border:0; }
nav.main-nav ul ul a:hover{ background:var(--cream); color:var(--gold); }
.navactions{ display:flex; align-items:center; gap:20px; }
.navactions .icon-link{ font-size:18px; opacity:.75; line-height:1; }
.navactions .icon-link:hover{ opacity:1; }
.cart-count{ background:var(--gold); color:#1b1400; font-size:10px; font-weight:700; border-radius:50%; width:16px; height:16px; display:inline-flex; align-items:center; justify-content:center; position:relative; top:-8px; left:-6px; }
.menu-toggle{ display:none; background:none; border:0; font-size:24px; cursor:pointer; }

.btn{ display:inline-block; padding:13px 26px; font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:600; border-radius:var(--radius); transition:.2s; border:1px solid transparent; cursor:pointer; }
.btn-dark{ background:var(--navy); color:#fff; }
.btn-dark:hover{ background:#000; color:#fff; }
.btn-outline{ border:1px solid var(--navy); color:var(--navy); background:transparent; }
.btn-outline:hover{ background:var(--navy); color:#fff; }
.btn-outline.on-dark{ border-color:#fff; color:#fff; }
.btn-outline.on-dark:hover{ background:#fff; color:var(--navy); }
.btn-gold{ background:var(--gold); color:#1b1400; }
.btn-gold:hover{ background:var(--gold-light); }

/* =========================================================
   2. HERO
   ========================================================= */
.hero{ position:relative; min-height:620px; display:flex; align-items:center; color:#fff; background:#111 no-repeat center/cover; }
.hero::after{ content:""; position:absolute; inset:0; background:linear-gradient(90deg, rgba(10,14,20,.84) 0%, rgba(10,14,20,.58) 42%, rgba(10,14,20,.18) 75%); }
.hero .wrap{ position:relative; z-index:2; padding-top:60px; padding-bottom:60px; }
.hero-inner{ max-width:620px; }
.hero h1{ font-size:56px; line-height:1.1; margin:18px 0 20px; color:#fff; }
.hero p.lead{ font-size:17px; line-height:1.65; color:#dfe3ea; max-width:480px; margin:0 0 34px; }
.hero-cta{ display:flex; gap:14px; flex-wrap:wrap; }
.hero-badges{ display:flex; gap:28px; margin-top:56px; flex-wrap:wrap; }
.hero-badge b{ color:#fff; font-family:'Cormorant Garamond',serif; font-size:19px; display:block; font-weight:600; }
.hero-badge span{ font-size:12px; color:#c9cfdb; }

/* =========================================================
   3. GENERIC SECTION
   ========================================================= */
section.block{ padding:96px 0; }
.section-head{ text-align:center; max-width:640px; margin:0 auto 56px; }
.section-head h2{ font-size:38px; margin:14px 0 12px; }
.section-head p{ color:var(--muted); font-size:15.5px; line-height:1.65; }

/* Categories */
.cats{ display:grid; grid-template-columns:repeat(4,1fr); gap:22px; }
.cat-card{ position:relative; border-radius:var(--radius); overflow:hidden; aspect-ratio:3/4; background:#ddd; }
.cat-card img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.cat-card:hover img{ transform:scale(1.06); }
.cat-card::after{ content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(10,14,20,0) 40%, rgba(10,14,20,.82) 100%); }
.cat-label{ position:absolute; left:22px; right:22px; bottom:22px; z-index:2; color:#fff; }
.cat-label .name{ font-family:'Cormorant Garamond',serif; font-size:23px; font-weight:600; }
.cat-label .count{ font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--gold-light); margin-top:4px; }

/* Story / dark band */
.story{ background:var(--navy); color:#fff; }
.story .wrap{ display:grid; grid-template-columns:1fr 1fr; gap:64px; align-items:center; }
.story h2{ font-size:42px; margin:16px 0 22px; color:#fff; }
.story p{ color:#c7cdd9; line-height:1.75; font-size:15.5px; margin-bottom:16px; }
.story-stats{ display:flex; gap:44px; margin-top:34px; flex-wrap:wrap; }
.story-stats div b{ font-family:'Cormorant Garamond',serif; font-size:34px; color:var(--gold-light); display:block; font-weight:600; }
.story-stats div span{ font-size:12px; letter-spacing:.05em; color:#98a1b3; text-transform:uppercase; }
.story-img{ border-radius:var(--radius); overflow:hidden; aspect-ratio:4/5; }
.story-img img{ width:100%; height:100%; object-fit:cover; }

/* Products */
.prod-head{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:44px; flex-wrap:wrap; gap:16px; }
.prod-head h2{ font-size:34px; margin:14px 0 0; }
.prod-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:26px; }
.prod-card{ background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; transition:box-shadow .25s, transform .25s; }
.prod-card:hover{ box-shadow:0 18px 40px rgba(20,20,20,.09); transform:translateY(-3px); }
.prod-thumb{ position:relative; aspect-ratio:1/1; background:#f1ede3; overflow:hidden; }
.prod-thumb img{ width:100%; height:100%; object-fit:cover; }
.prod-tag{ position:absolute; top:12px; left:12px; background:var(--gold); color:#1b1400; font-size:10.5px; font-weight:700; letter-spacing:.06em; padding:5px 10px; border-radius:2px; text-transform:uppercase; }
.prod-body{ padding:20px; }
.prod-cat{ font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--gold); font-weight:700; }
.prod-name{ font-size:16.5px; font-weight:600; margin:8px 0 10px; line-height:1.3; }
.prod-price{ font-family:'Cormorant Garamond',serif; font-size:20px; font-weight:600; color:var(--navy); }
.prod-price del{ font-size:14px; color:#9aa1ad; font-weight:400; margin-right:8px; }
.prod-price ins{ text-decoration:none; }

/* Journal (blog + woo combined) */
.journal{ background:var(--cream-2); }
.journal-grid{ display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:26px; }
.journal-card{ background:#fff; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); display:block; }
.journal-thumb{ aspect-ratio:16/10; overflow:hidden; background:#eee; }
.journal-thumb img{ width:100%; height:100%; object-fit:cover; }
.journal-body{ padding:22px; }
.journal-kicker{ font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:8px; }
.journal-title{ font-size:19px; font-weight:600; line-height:1.35; margin-bottom:10px; }
.journal-excerpt{ font-size:13.5px; color:var(--muted); line-height:1.6; }
.journal-meta{ font-size:11.5px; color:#9aa1ad; margin-top:14px; letter-spacing:.03em; }

/* Testimonials */
.testi{ background:var(--navy); color:#fff; }
.testi-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:26px; }
.testi-card{ background:var(--navy-2); border:1px solid rgba(255,255,255,.08); padding:32px 28px; border-radius:var(--radius); }
.testi-quote{ font-family:'Cormorant Garamond',serif; font-style:italic; font-size:18px; line-height:1.55; color:#e7e9ef; }
.stars{ color:var(--gold); font-size:14px; letter-spacing:2px; margin-bottom:14px; }
.testi-name{ margin-top:20px; font-weight:600; font-size:13.5px; letter-spacing:.03em; }
.testi-loc{ font-size:11.5px; color:#8b93a4; margin-top:2px; }

/* CTA strip */
.cta-strip{ background:linear-gradient(120deg, var(--gold) 0%, var(--gold-light) 100%); text-align:center; padding:64px 0; }
.cta-strip h2{ font-size:32px; color:#1b1400; margin:0 0 14px; }
.cta-strip p{ color:#3a2f10; margin:0 0 26px; font-size:15px; }

/* =========================================================
   4. FOOTER
   ========================================================= */
footer.site-footer{ background:#0c1119; color:#c7cdd9; padding-top:76px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1.2fr; gap:44px; padding-bottom:56px; border-bottom:1px solid rgba(255,255,255,.08); }
.footer-logo{ height:38px; margin-bottom:18px; filter:brightness(0) invert(1); }
footer p{ font-size:13.5px; line-height:1.7; color:#8f97a8; }
footer h4{ font-family:'Inter',sans-serif; font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:#fff; margin-bottom:20px; font-weight:600; }
footer ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:12px; }
footer ul a{ font-size:13.5px; color:#a9b0c0; }
footer ul a:hover{ color:var(--gold-light); }
.foot-contact li{ display:flex; gap:10px; font-size:13.5px; color:#a9b0c0; align-items:flex-start; list-style:none; }
.foot-social{ display:flex; flex-direction:row !important; gap:14px !important; margin-top:18px; }
.foot-social a{ width:34px; height:34px; border:1px solid rgba(255,255,255,.18); border-radius:50%; display:flex; align-items:center; justify-content:center; }
.foot-social a:hover{ border-color:var(--gold-light); color:var(--gold-light); }
.bottom-bar{ display:flex; justify-content:space-between; align-items:center; padding:22px 0; font-size:12px; color:#6c7488; flex-wrap:wrap; gap:8px; }
.bottom-bar a{ color:#8f97a8; }
.bottom-bar a:hover{ color:var(--gold-light); }

/* =========================================================
   5. GENERIC PAGE / BLOG / WOOCOMMERCE CONTENT
   ========================================================= */
.page-header-band{ background:var(--navy); color:#fff; padding:64px 0; text-align:center; }
.page-header-band h1{ color:#fff; font-size:40px; }
.content-wrap{ max-width:var(--maxw); margin:0 auto; padding:72px 32px; }
.content-wrap.narrow{ max-width:820px; }
article.post-card{ border-bottom:1px solid var(--line); padding-bottom:40px; margin-bottom:40px; }
article.post-card .journal-thumb{ margin-bottom:20px; border-radius:var(--radius); }
.pagination{ display:flex; gap:10px; justify-content:center; margin-top:40px; }
.pagination a, .pagination span{ padding:10px 16px; border:1px solid var(--line); font-size:13px; border-radius:var(--radius); }
.pagination .current{ background:var(--navy); color:#fff; border-color:var(--navy); }

/* WooCommerce overrides so shop/product pages inherit the same look.
   NOTE: WooCommerce ships float-based grid rules (.columns-4, li.product
   { width:22.05%; float:left }) that fight CSS grid and collapse each card
   into a narrow column. The !important resets below are required to undo
   those core styles — without them the shop grid breaks. */
.woocommerce ul.products, .woocommerce-page ul.products{
  display:grid !important; grid-template-columns:repeat(4,1fr); gap:26px;
  list-style:none; padding:0; margin:0;
}
.woocommerce ul.products::before, .woocommerce ul.products::after,
.woocommerce-page ul.products::before, .woocommerce-page ul.products::after{ content:none !important; display:none !important; }

.woocommerce ul.products li.product, .woocommerce-page ul.products li.product{
  width:auto !important; float:none !important; clear:none !important; margin:0 !important;
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; text-align:left; display:flex; flex-direction:column;
}
.woocommerce ul.products li.product a img, .woocommerce-page ul.products li.product a img{
  width:100%; height:auto; aspect-ratio:1/1; object-fit:cover;
  border-radius:var(--radius); margin:0 0 14px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title{
  font-family:'Inter',sans-serif; font-size:15.5px; font-weight:600; line-height:1.35;
  color:var(--ink); padding:0; margin:0 0 8px;
}
.woocommerce ul.products li.product .price, .woocommerce-page ul.products li.product .price{
  font-family:'Cormorant Garamond',serif; font-size:19px; color:var(--navy); margin:0 0 14px; display:block;
}
.woocommerce ul.products li.product .button, .woocommerce-page ul.products li.product .button{
  margin-top:auto; align-self:flex-start;
}
.woocommerce span.onsale{ background:var(--gold); color:#1b1400; border-radius:2px; font-weight:700; }
.woocommerce a.button, .woocommerce button.button, .woocommerce #respond input#submit,
.woocommerce input.button, .woocommerce-page a.button{
  background:var(--navy); color:#fff; border-radius:2px; letter-spacing:.06em; text-transform:uppercase; font-size:12px; font-weight:600; padding:12px 20px; border:0;
}
.woocommerce a.button:hover, .woocommerce button.button:hover{ background:#000; color:#fff; }
.woocommerce div.product p.price, .woocommerce div.product span.price{ color:var(--navy); font-family:'Cormorant Garamond',serif; font-size:26px; }
.woocommerce nav.woocommerce-breadcrumb{ font-size:12.5px; color:var(--muted); margin-bottom:24px; }
.woocommerce .star-rating{ color:var(--gold); }

/* =========================================================
   5b. CONTACT PAGE
   ========================================================= */
.contact-page{ padding-top:80px; padding-bottom:110px; }
.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:80px; align-items:start; }
.contact-info h2, .contact-form-wrap h2{ font-size:30px; margin-bottom:32px; }
.contact-details{ list-style:none; padding:0; margin:0 0 36px; display:flex; flex-direction:column; gap:26px; }
.contact-details li{ display:flex; gap:16px; align-items:flex-start; }
.icon-circle{ width:44px; height:44px; border-radius:50%; background:var(--cream-2); display:flex; align-items:center; justify-content:center; font-size:17px; flex-shrink:0; }
.contact-details .label{ font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--gold); font-weight:700; display:block; margin-bottom:4px; }
.contact-details p{ margin:0; font-size:14.5px; color:var(--ink); line-height:1.6; }
.contact-details a{ color:var(--ink); }
.contact-details a:hover{ color:var(--gold); }
.contact-actions{ display:flex; gap:14px; flex-wrap:wrap; }
.contact-form .form-row{ margin-bottom:16px; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"],
.contact-form select, .contact-form textarea{
  width:100%; border:1px solid var(--line); border-radius:2px; padding:14px 16px;
  font-family:inherit; font-size:14px; color:var(--ink); background:#fff;
}
.contact-form select{
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; color:var(--ink);
}
.contact-form textarea{ min-height:130px; resize:vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus{ outline:none; border-color:var(--gold); }
.contact-form button[type="submit"]{ width:100%; padding:16px; border:0; }
.form-notice{ padding:14px 18px; border-radius:2px; font-size:13.5px; margin-bottom:24px; line-height:1.5; }
.form-notice.success{ background:#e7f5ec; color:#1f6b3d; border:1px solid #bfe3cd; }
.form-notice.error{ background:#fbeaea; color:#a13333; border:1px solid #f1c6c6; }
.ctm-hp-field{ position:absolute !important; left:-9999px !important; top:auto; width:1px; height:1px; opacity:0; }

/* =========================================================
   5c. ABOUT PAGE
   ========================================================= */
.about-hero{ background:var(--navy); color:#fff; padding:84px 0 72px; text-align:center; }
.about-hero h1{ color:#fff; font-size:46px; margin:14px 0 16px; }
.about-hero-sub{ color:#c7cdd9; font-size:16.5px; max-width:640px; margin:0 auto; line-height:1.65; }
.about-stats{ background:var(--navy-2); color:#fff; padding:0 0 8px; }
.about-stats-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:24px; padding:0 0 44px; }
.about-stats-grid div{ text-align:center; }
.about-stats-grid b{ font-family:'Cormorant Garamond',serif; font-size:36px; color:var(--gold-light); display:block; font-weight:600; }
.about-stats-grid span{ font-size:11.5px; letter-spacing:.09em; text-transform:uppercase; color:#98a1b3; }
.about-body{ padding-top:72px; padding-bottom:56px; }
.about-prose h2{ font-size:31px; margin:44px 0 16px; }
.about-prose h2:first-child{ margin-top:0; }
.about-prose h3{ font-size:21px; margin:32px 0 12px; }
.about-prose p{ font-size:16px; line-height:1.8; color:#3d434e; margin:0 0 18px; }
.about-prose ul, .about-prose ol{ margin:0 0 20px; padding-left:22px; }
.about-prose li{ font-size:16px; line-height:1.8; color:#3d434e; margin-bottom:8px; }
.about-prose strong{ color:var(--ink); }
.about-prose a{ color:var(--gold); text-decoration:underline; }
.about-prose blockquote{
  border-left:3px solid var(--gold); margin:28px 0; padding:6px 0 6px 22px;
  font-family:'Cormorant Garamond',serif; font-style:italic; font-size:20px; color:var(--navy);
}

/* =========================================================
   6. RESPONSIVE
   ========================================================= */
@media (max-width:1080px){
  .cats{ grid-template-columns:repeat(2,1fr); }
  .prod-grid{ grid-template-columns:repeat(2,1fr); }
  .woocommerce ul.products, .woocommerce-page ul.products{ grid-template-columns:repeat(2,1fr); }
  .journal-grid{ grid-template-columns:1fr; }
  .story .wrap{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .contact-grid{ grid-template-columns:1fr; gap:56px; }
  .about-stats-grid{ grid-template-columns:repeat(2,1fr); }
  .about-hero h1{ font-size:34px; }
  nav.main-nav{ display:none; }
  .menu-toggle{ display:block; }
  .hero h1{ font-size:40px; }
  section.block{ padding:64px 0; }
}
@media (max-width:600px){
  .prod-grid{ grid-template-columns:1fr; }
  .woocommerce ul.products, .woocommerce-page ul.products{ grid-template-columns:1fr; }
  .cats{ grid-template-columns:1fr; }
  .testi-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; }
  .hero h1{ font-size:32px; }
}

/* Mobile nav drawer */
nav.main-nav.is-open{
  display:flex; position:fixed; inset:86px 0 0 0; background:#fff; flex-direction:column;
  padding:24px 32px; gap:0; overflow-y:auto; z-index:60;
}
nav.main-nav.is-open ul{ flex-direction:column; gap:0; width:100%; }
nav.main-nav.is-open li{ border-bottom:1px solid var(--line); }
nav.main-nav.is-open a{ padding:16px 0; width:100%; }
nav.main-nav.is-open ul ul{ position:static; border:0; box-shadow:none; display:block; padding-left:16px; }
