/*
Theme Name: Hearth & Hand
Theme URI: https://example.com/hearth-and-hand
Author: Hearth & Hand Studio
Author URI: https://example.com
Description: A warm, artisanal WooCommerce theme for homemade products. Features earthy tones, elegant typography, and a handcrafted aesthetic.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hearth-and-hand
Tags: e-commerce, woocommerce, custom-menu, featured-images, full-width-template

Hearth & Hand — Handcrafted with love.
*/

/* ===== DESIGN SYSTEM ===== */
:root {
  --hh-bg: #f7f4f0;
  --hh-fg: #2a2420;
  --hh-card: #f2eeea;
  --hh-primary: #7a4a32;
  --hh-primary-fg: #f7f4f0;
  --hh-secondary: #5e7a5e;
  --hh-secondary-fg: #f7f4f0;
  --hh-muted: #e8e2db;
  --hh-muted-fg: #7a7068;
  --hh-accent: #d4b896;
  --hh-border: #d9d1c8;
  --hh-radius: 0.75rem;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--hh-bg);
  color: var(--hh-fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* ===== NAVBAR ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247, 244, 240, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hh-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hh-fg);
  letter-spacing: -0.02em;
}

.main-nav {
  display: none;
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hh-muted-fg);
}

.main-nav a:hover {
  color: var(--hh-fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-link {
  position: relative;
  padding: 0.5rem;
  color: var(--hh-fg);
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hh-primary);
  color: var(--hh-primary-fg);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.mobile-toggle {
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hh-fg);
  font-size: 1.5rem;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--hh-bg);
  border-bottom: 1px solid var(--hh-border);
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hh-muted-fg);
}

@media (min-width: 768px) {
  .main-nav { display: block; }
  .mobile-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 36, 32, 0.4);
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 1rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(247, 244, 240, 0.8);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--hh-primary-fg);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-weight: 400;
  font-style: italic;
}

.hero-desc {
  font-family: var(--font-body);
  color: rgba(247, 244, 240, 0.8);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-title { font-size: 4.5rem; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-hero {
  background: var(--hh-primary-fg);
  color: var(--hh-fg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.btn-hero:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--hh-primary);
  color: var(--hh-primary-fg);
}

.btn-primary:hover {
  opacity: 0.9;
}

/* ===== CATEGORIES ===== */
.categories-section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hh-muted-fg);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--hh-fg);
}

@media (min-width: 768px) {
  .section-title { font-size: 2.25rem; }
  .categories-section { padding: 7rem 0; }
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

.category-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  aspect-ratio: 3/4;
  display: block;
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card .card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42,36,32,0.6), rgba(42,36,32,0.1), transparent);
}

.category-card .card-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
}

.category-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--hh-primary-fg);
  margin-bottom: 0.25rem;
}

.category-card p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(247, 244, 240, 0.7);
}

/* ===== PRODUCTS ===== */
.products-section {
  padding: 5rem 0;
  background: var(--hh-card);
}

@media (min-width: 768px) {
  .products-section { padding: 7rem 0; }
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
  cursor: pointer;
}

.product-card .product-image {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--hh-bg);
  aspect-ratio: 1;
  margin-bottom: 1rem;
}

.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-card .add-to-cart-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hh-primary);
  color: var(--hh-primary-fg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.product-card:hover .add-to-cart-btn {
  opacity: 1;
  transform: translateY(0);
}

.product-category {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hh-muted-fg);
  margin-bottom: 0.25rem;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--hh-fg);
  margin-bottom: 0.25rem;
}

.product-price {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--hh-primary);
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 4rem 0;
  border-top: 1px solid var(--hh-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--hh-fg);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--hh-muted-fg);
  line-height: 1.7;
}

.footer-links h4 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hh-fg);
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--hh-muted-fg);
}

.footer-links a:hover {
  color: var(--hh-fg);
}

.newsletter h4 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hh-fg);
  margin-bottom: 1rem;
}

.newsletter p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--hh-muted-fg);
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: var(--hh-muted);
  border: 1px solid var(--hh-border);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--hh-fg);
  outline: none;
}

.newsletter-form input:focus {
  box-shadow: 0 0 0 2px rgba(122, 74, 50, 0.3);
}

.newsletter-form button {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--hh-primary);
  color: var(--hh-primary-fg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s;
}

.newsletter-form button:hover {
  opacity: 0.9;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hh-border);
  text-align: center;
}

.footer-bottom p {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--hh-muted-fg);
}

/* ===== WOOCOMMERCE OVERRIDES ===== */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.woocommerce ul.products li.product a img {
  border-radius: 0.75rem;
  aspect-ratio: 1;
  object-fit: cover;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--hh-fg);
  padding: 0.5rem 0 0.25rem;
}

.woocommerce ul.products li.product .price {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--hh-primary) !important;
}

.woocommerce ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background: var(--hh-primary) !important;
  color: var(--hh-primary-fg) !important;
  border-radius: 9999px !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  padding: 0.625rem 1.5rem !important;
  border: none !important;
  transition: opacity 0.3s !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background: var(--hh-primary) !important;
  opacity: 0.9 !important;
}

.woocommerce .woocommerce-message {
  border-top-color: var(--hh-secondary);
}

.woocommerce .woocommerce-message::before {
  color: var(--hh-secondary);
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  border-color: var(--hh-border);
  color: var(--hh-fg);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
  background: var(--hh-primary);
  border-color: var(--hh-primary);
  color: var(--hh-primary-fg);
}

/* Single product */
.woocommerce div.product .product_title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--hh-fg);
}

.woocommerce div.product p.price {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hh-primary) !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--hh-primary);
}

/* Cart & Checkout */
.woocommerce table.shop_table {
  border-color: var(--hh-border);
}

.woocommerce table.shop_table th {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--hh-fg);
}

.woocommerce-checkout #payment {
  background: var(--hh-card);
  border-radius: var(--hh-radius);
}
