/*
Theme Name: Spare Time Collections
Theme URI: https://sparetimecollections.com
Author: Spare Time Collections
Author URI: https://sparetimecollections.com
Description: A warm, handcrafted theme for Spare Time Collections — custom wreaths, clocks, and boxes.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spare-time-collections
Tags: e-commerce, portfolio, custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg:        #f9f7f3;
  --color-bg-alt:    #efece4;
  --color-bg-dark:   #3a312a;
  --color-bg-darkest:#2d251f;
  --color-border:    #e5e0d8;
  --color-text:      #3a312a;
  --color-text-mid:  #5c5249;
  --color-text-muted:#736659;
  --color-text-light:#a8a198;
  --color-accent:    #8a6e55;
  --color-accent-mid:#a18a70;
  --color-cream:     #e8e4db;
  --color-cream-dark:#d8d3c8;
  --color-gold:      #d4af37;
  --font-serif:      'Playfair Display', Georgia, serif;
  --font-sans:       'Lato', Arial, sans-serif;
  --max-width:       1280px;
  --transition:      0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

::selection { background: var(--color-accent-mid); color: #fff; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.15;
  color: var(--color-bg-darkest);
}

/* ============================================================
   UTILITY
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.btn-outline-light {
  display: inline-block;
  border: 1px solid var(--color-cream);
  color: var(--color-cream);
  padding: 16px 32px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}
.btn-outline-light:hover {
  background: var(--color-cream);
  color: var(--color-bg-dark);
}

.btn-light {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg);
  color: var(--color-bg-darkest);
  padding: 16px 32px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background var(--transition);
}
.btn-light:hover { background: var(--color-border); }

/* Fade-up animation */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.65, 0.3, 0.9),
              transform 0.8s cubic-bezier(0.2, 0.65, 0.3, 0.9);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.65, 0.3, 0.9),
              transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 0.9);
}
.stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.15s; }
.stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.3s; }
.stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.45s; }

/* ============================================================
   ANNOUNCEMENT BAR
   ============================================================ */
.announcement-bar {
  background: #4a4238;
  color: var(--color-cream);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 16px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 247, 243, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 24px;
  transition: padding var(--transition), box-shadow var(--transition);
}
.site-header.scrolled { padding: 12px 24px; box-shadow: 0 2px 20px rgba(58,49,42,0.08); }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-bg-darkest);
  line-height: 1;
}
.site-logo span {
  display: block;
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  font-weight: 400;
  color: #6b5e52;
  margin-top: 4px;
  text-transform: uppercase;
}

.main-nav ul { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #5c5249;
  transition: color var(--transition);
}
.main-nav a:hover { color: var(--color-accent); }

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions button, .header-actions a {
  background: none;
  border: none;
  color: var(--color-text);
  transition: color var(--transition);
  padding: 0;
  position: relative;
}
.header-actions button:hover, .header-actions a:hover { color: var(--color-accent); }

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-accent);
  color: #fff;
  font-size: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}

.mobile-menu-toggle { display: none; background: none; border: none; }

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: block; }
  .site-logo { position: static; transform: none; }
  .header-inner { gap: 12px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
  position: relative;
  height: 85vh;
  min-height: 600px;
  background: var(--color-bg-dark);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.7;
  animation: heroScale 1.5s ease-out forwards;
}
@keyframes heroScale {
  from { transform: scale(1.05); }
  to   { transform: scale(1); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(45,37,31,0.80) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  display: inline-block;
  color: var(--color-cream);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 16px;
  position: relative;
  padding-left: 48px;
}
.hero-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 32px;
  height: 1px;
  background: var(--color-cream);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 7vw, 80px);
  color: #f9f7f3;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 560px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hero-subtitle {
  color: var(--color-cream-dark);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 40px;
  font-weight: 300;
  max-width: 420px;
}

.hero-butterflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ============================================================
   BUTTERFLIES (CSS + JS)
   ============================================================ */
.butterfly {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.butterfly-wings {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.butterfly-wing-left,
.butterfly-wing-right {
  transform-origin: center right;
  animation: wingFlap 0.55s ease-in-out infinite;
}
.butterfly-wing-right {
  transform-origin: center left;
  transform: scaleX(-1);
  animation-delay: 0.1s;
}

@keyframes wingFlap {
  0%, 100% { transform: scaleX(1); }
  50%       { transform: scaleX(0.15); }
}
.butterfly-wing-right {
  animation: wingFlapRight 0.55s ease-in-out infinite;
}
@keyframes wingFlapRight {
  0%, 100% { transform: scaleX(-1); }
  50%       { transform: scaleX(-0.15); }
}

.butterfly-body {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: linear-gradient(to bottom, #3a2a1a, #c9a87c);
  opacity: 0.9;
  z-index: 2;
}

/* Individual butterfly drift animations generated via JS */

/* ============================================================
   PHILOSOPHY SECTION
   ============================================================ */
.philosophy-section {
  padding: 96px 24px;
  background: var(--color-bg);
}
.philosophy-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.philosophy-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 32px;
  color: var(--color-accent-mid);
}
.philosophy-title {
  font-size: clamp(28px, 4vw, 46px);
  color: var(--color-bg-darkest);
  margin-bottom: 28px;
  line-height: 1.2;
}
.philosophy-body {
  color: var(--color-text-mid);
  font-size: 18px;
  line-height: 1.8;
  font-weight: 300;
}

/* ============================================================
   CATEGORY GRID
   ============================================================ */
.category-section {
  padding: 0 24px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .category-grid { grid-template-columns: 1fr; } }

.category-card {
  position: relative;
  display: block;
  overflow: hidden;
  height: 560px;
  background: var(--color-bg-alt);
}
.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s ease;
}
.category-card:hover img { transform: scale(1.05); }

.category-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  transition: background var(--transition);
}
.category-card:hover .category-overlay { background: rgba(0,0,0,0.1); }

.category-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.category-label h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #fff;
  margin-bottom: 8px;
}
.category-label span {
  color: var(--color-cream);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition);
}
.category-card:hover .category-label span { color: #fff; }

/* ============================================================
   FEATURED PRODUCTS
   ============================================================ */
.products-section {
  padding: 96px 24px;
  background: #fff;
  border-top: 1px solid var(--color-border);
}
.products-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 64px;
  gap: 24px;
  flex-wrap: wrap;
}
.products-header h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  margin-bottom: 12px;
}
.products-header p {
  color: var(--color-text-muted);
  font-size: 17px;
  font-weight: 300;
  max-width: 380px;
}
.view-all {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  border-bottom: 1px solid rgba(138,110,85,0.3);
  padding-bottom: 4px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.view-all:hover { color: #5c4a39; border-color: #5c4a39; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 32px;
  row-gap: 64px;
}
@media (max-width: 900px) { .products-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .products-grid { grid-template-columns: 1fr; } }

.product-card { cursor: pointer; }
.product-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
  background: #f4f0ea;
  margin-bottom: 24px;
}
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.product-card:hover .product-image-wrap img { transform: scale(1.05); }

.product-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255,255,255,0.9);
  padding: 4px 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-bg-darkest);
}
.product-quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  background: var(--color-bg-dark);
  color: #fff;
  width: 100%;
  border: none;
  padding: 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: transform 0.3s ease, background var(--transition);
}
.product-card:hover .product-quick-add { transform: translateY(0); }
.product-quick-add:hover { background: var(--color-bg-darkest); }

.product-info { text-align: center; }
.product-info h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--color-bg-darkest);
  margin-bottom: 8px;
}
.product-info .product-sub {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.product-info .product-price {
  color: var(--color-text-mid);
  letter-spacing: 0.06em;
}

/* ============================================================
   THE STORY
   ============================================================ */
.story-section { background: var(--color-bg-alt); overflow: hidden; }
.story-inner { display: flex; }
.story-image {
  flex: 0 0 50%;
  position: relative;
  min-height: 560px;
}
.story-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-content {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 96px;
}
.story-text { max-width: 440px; }
.story-text h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  margin-bottom: 32px;
}
.story-text p {
  color: var(--color-text-mid);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 24px;
}
.story-link {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(138,110,85,0.3);
  padding-bottom: 4px;
  transition: color var(--transition), border-color var(--transition);
}
.story-link:hover { color: #5c4a39; border-color: #5c4a39; }

@media (max-width: 900px) {
  .story-inner { flex-direction: column; }
  .story-image { flex: none; height: 400px; }
  .story-image img { position: static; width: 100%; height: 400px; }
  .story-content { flex: none; padding: 64px 24px; }
}

/* ============================================================
   CUSTOM WORK CTA
   ============================================================ */
.cta-section {
  padding: 96px 24px;
  background: var(--color-bg-dark);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.06), transparent 70%);
}
.cta-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.cta-inner h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  color: #f9f7f3;
  margin-bottom: 24px;
}
.cta-inner p {
  color: var(--color-cream-dark);
  font-size: 17px;
  font-weight: 300;
  margin-bottom: 40px;
  line-height: 1.8;
}

/* ============================================================
   TESTIMONIAL
   ============================================================ */
.testimonial-section {
  padding: 96px 24px;
  background: #fff;
}
.testimonial-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 32px; }
.star-icon { width: 20px; height: 20px; fill: var(--color-gold); }
.testimonial-quote {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 32px);
  color: var(--color-bg-darkest);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 32px;
}
.testimonial-author {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg-darkest);
  color: var(--color-text-light);
  padding: 80px 24px 40px;
  font-weight: 300;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid #3a312a;
  margin-bottom: 40px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand h4 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: #f9f7f3;
  margin-bottom: 16px;
}
.footer-brand p { font-size: 13px; line-height: 1.8; margin-bottom: 24px; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--color-text-light); transition: color var(--transition); }
.footer-social a:hover { color: #f9f7f3; }
.footer-social svg { width: 20px; height: 20px; }

.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f9f7f3;
  margin-bottom: 24px;
  font-weight: 400;
}
.footer-col ul { display: flex; flex-direction: column; gap: 14px; }
.footer-col a { font-size: 13px; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }

.footer-newsletter p { font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.newsletter-form {
  display: flex;
  border-bottom: 1px solid var(--color-text-light);
  transition: border-color var(--transition);
}
.newsletter-form:focus-within { border-color: #fff; }
.newsletter-form input {
  background: transparent;
  border: none;
  outline: none;
  color: #f9f7f3;
  font-size: 13px;
  padding: 8px 0;
  flex: 1;
  font-weight: 300;
}
.newsletter-form input::placeholder { color: #5c5249; }
.newsletter-form button {
  background: none;
  border: none;
  color: var(--color-text-light);
  padding: 8px;
  transition: color var(--transition);
}
.newsletter-form button:hover { color: #fff; }
.newsletter-form svg { width: 16px; height: 16px; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.06em;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom a { transition: color var(--transition); }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   RESPONSIVE EXTRAS
   ============================================================ */
@media (max-width: 768px) {
  .products-header { flex-direction: column; align-items: flex-start; }
  .hero-title { font-size: 42px; }
}
