/* ============================================================
   EcoCraftFurnish – Shared Styles
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:   #1a3a0a;
  --green-900:    #14532d;
  --green-800:    #166534;
  --green-700:    #15803d;
  --green-600:    #16a34a;
  --green-500:    #22c55e;
  --green-400:    #4ade80;
  --green-200:    #bbf7d0;
  --green-100:    #dcfce7;
  --green-50:     #f0fdf4;
  --wood:         #8B4513;
  --wood-light:   #c8895a;
  --wood-pale:    #f5ede3;
  --cream:        #faf8f4;
  --gray-900:     #111827;
  --gray-700:     #374151;
  --gray-500:     #6b7280;
  --gray-300:     #d1d5db;
  --gray-100:     #f3f4f6;
  --white:        #ffffff;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Georgia, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5 { font-family: Georgia, 'Times New Roman', serif; line-height: 1.2; }
.serif { font-family: Georgia, 'Times New Roman', serif; }
.sans  { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* ---- HEADER / NAV ---- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 70px;
}

.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: Georgia, serif;
  font-size: 18px; font-weight: 700;
  color: var(--green-900);
}

.site-logo .logo-leaf {
  width: 36px; height: 36px;
  background: var(--green-700);
  border-radius: 50% 50% 50% 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800;
  transform: rotate(-45deg);
}

.site-logo .logo-leaf span { transform: rotate(45deg); display: block; }

.site-logo .logo-name { line-height: 1.15; }
.site-logo .logo-sub { font-size: 10px; font-family: sans-serif; color: var(--gray-500); font-weight: 400; letter-spacing: .04em; }

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a, .main-nav .nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--gray-700);
  transition: all .15s;
  border: none; background: none;
}

.main-nav a:hover, .main-nav .nav-btn:hover { background: var(--green-50); color: var(--green-800); }
.main-nav a.active { color: var(--green-700); font-weight: 600; }

.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--gray-300);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 8px;
  z-index: 300;
}

.dropdown-menu a {
  display: block; padding: 9px 14px;
  font-size: 14px; color: var(--gray-700);
  border-radius: 8px;
}
.dropdown-menu a:hover { background: var(--green-50); color: var(--green-800); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.cart-btn {
  position: relative;
  width: 38px; height: 38px;
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-800);
}
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--green-700); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 600; border: none; transition: all .2s; }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-outline { background: transparent; border: 2px solid var(--green-700); color: var(--green-700); }
.btn-outline:hover { background: var(--green-700); color: #fff; }
.btn-wood { background: var(--wood); color: #fff; }
.btn-wood:hover { background: #723a10; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ---- FOOTER ---- */
.site-footer { background: var(--green-dark); color: rgba(255,255,255,.85); }

.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding: 60px 24px 40px;
}

.footer-brand .logo-name { color: #fff; font-size: 20px; font-family: Georgia, serif; font-weight: 700; }
.footer-brand p { font-size: 14px; line-height: 1.7; opacity: .7; margin-top: 12px; max-width: 280px; }

.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; opacity: .5; font-family: sans-serif; }
.footer-col a { display: block; font-size: 14px; opacity: .75; margin-bottom: 10px; transition: opacity .15s; }
.footer-col a:hover { opacity: 1; }

.footer-eco { display: flex; align-items: center; gap: 8px; background: rgba(74,222,128,.15); border: 1px solid rgba(74,222,128,.3); color: var(--green-400); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600; margin-top: 20px; width: fit-content; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); max-width: 1280px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; font-size: 13px; opacity: .5; }

/* ---- SECTIONS ---- */
.section { padding: 80px 24px; }
.section-sm { padding: 48px 24px; }
.container { max-width: 1280px; margin: 0 auto; }
.container-narrow { max-width: 860px; margin: 0 auto; }

.section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-100); color: var(--green-800);
  padding: 5px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 16px;
}

.section-title { font-size: clamp(26px, 4vw, 40px); color: var(--gray-900); margin-bottom: 12px; }
.section-sub { font-size: 17px; color: var(--gray-500); max-width: 540px; line-height: 1.7; }
.text-center { text-align: center; }
.text-center .section-sub { margin: 0 auto; }

/* ---- CARDS ---- */
.card { background: #fff; border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 24px; }
.card:hover { box-shadow: var(--shadow); }

/* ---- PRODUCT CARD ---- */
.product-card {
  background: #fff; border: 1px solid var(--gray-300); border-radius: 14px;
  overflow: hidden; transition: all .2s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.product-img {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative; overflow: hidden;
}

.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--green-700); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}

.product-wishlist {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: all .2s;
}
.product-wishlist:hover { color: #ef4444; background: #fff; }
.product-wishlist.active { color: #ef4444; }

.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }

.product-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); font-weight: 600; margin-bottom: 6px; }

.product-name { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; line-height: 1.3; }

.product-wood { font-size: 12px; color: var(--wood); background: var(--wood-pale); display: inline-block; padding: 2px 9px; border-radius: 999px; margin-bottom: 10px; font-weight: 600; }

.star-row { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.stars { color: #f59e0b; font-size: 13px; }
.star-count { font-size: 12px; color: var(--gray-500); }

.product-price { font-size: 20px; font-weight: 800; color: var(--gray-900); margin-top: auto; }
.product-price .from { font-size: 12px; font-weight: 500; color: var(--gray-500); }

.product-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.product-actions .btn { flex: 1; justify-content: center; }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 14px; font-family: inherit;
  color: var(--gray-900); background: #fff;
  outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.form-textarea { resize: vertical; min-height: 100px; }

/* ---- STARS ---- */
.star-rating { display: flex; gap: 2px; }
.star-rating .star { font-size: 16px; color: #d1d5db; cursor: pointer; }
.star-rating .star.filled { color: #f59e0b; }

/* ---- TABLES ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); border-bottom: 1px solid var(--gray-300); }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tbody tr:hover td { background: var(--green-50); }
.data-table tr:last-child td { border-bottom: none; }

/* ---- UTILS ---- */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mono { font-family: 'Courier New', monospace; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- CART DRAWER ---- */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 400; opacity: 0; pointer-events: none; transition: opacity .3s; }
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; background: #fff;
  box-shadow: -4px 0 40px rgba(0,0,0,.15);
  z-index: 401; transform: translateX(100%);
  transition: transform .3s ease;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-300); display: flex; justify-content: space-between; align-items: center; }
.cart-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-footer { padding: 20px 24px; border-top: 1px solid var(--gray-300); }

.cart-item { display: flex; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-100); }
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; background: var(--green-50); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.cart-item-wood { font-size: 11px; color: var(--wood); }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--gray-900); margin-top: 6px; }
.qty-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--gray-300); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.qty-btn:hover { border-color: var(--green-500); color: var(--green-700); }

/* ---- TOAST ---- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-900); color: #fff; padding: 12px 24px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .3s ease; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- LIVE CHAT ---- */
.chat-bubble { position: fixed; bottom: 28px; right: 28px; z-index: 500; }
.chat-btn { width: 54px; height: 54px; border-radius: 50%; background: var(--green-700); color: #fff; border: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(21,128,61,.4); transition: all .2s; }
.chat-btn:hover { background: var(--green-800); transform: scale(1.05); }
.chat-window {
  position: absolute; bottom: 66px; right: 0;
  width: 320px; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-300);
  overflow: hidden; display: none;
  flex-direction: column;
}
.chat-window.open { display: flex; }
.chat-win-header { background: var(--green-700); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; max-height: 260px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 80%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.chat-msg.bot { background: var(--green-50); color: var(--gray-900); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--green-700); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-row { display: flex; border-top: 1px solid var(--gray-300); }
.chat-input-row input { flex: 1; padding: 12px 14px; border: none; outline: none; font-size: 13px; font-family: inherit; }
.chat-input-row button { padding: 12px 14px; background: var(--green-700); color: #fff; border: none; font-size: 13px; font-weight: 600; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 16px; }
  .cart-drawer { width: 100%; }
}
