/* ============ พงษ์พัฒน์เฟอร์นิเจอร์ไม้สัก - Stylesheet ============ */
:root {
  --wood-dark: #4a2c1a;
  --wood: #7a4a28;
  --wood-light: #a86f3d;
  --gold: #c8963e;
  --cream: #faf6f0;
  --cream-dark: #f0e6d8;
  --text: #2e2016;
  --text-light: #6b5a4a;
  --white: #ffffff;
  --success: #2e7d32;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(74,44,26,0.12);
  --shadow-lg: 0 8px 30px rgba(74,44,26,0.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Noto Sans Thai', 'Sarabun', -apple-system, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { color: var(--wood-dark); margin: 0 0 10px; font-weight: 700; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 32px; }
.logo-text { display: flex; flex-direction: column; }
.logo-text strong { color: var(--wood-dark); font-size: 18px; }
.logo-text small { color: var(--text-light); font-size: 11px; }

.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav > a { font-weight: 600; padding: 8px 0; }
.main-nav > a:hover { color: var(--gold); }
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 8px 0;
  z-index: 50;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 10px 18px; }
.dropdown-menu a:hover { background: var(--cream-dark); color: var(--wood); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.cart-link { position: relative; font-weight: 600; background: var(--cream-dark); padding: 8px 14px; border-radius: 30px; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.menu-toggle span { width: 24px; height: 2px; background: var(--wood-dark); display: block; }

/* ---------- Hero / Banner ---------- */
.hero {
  background: linear-gradient(135deg, var(--wood-dark), var(--wood));
  color: var(--white);
  padding: 60px 20px;
  text-align: center;
}
.hero h1 { color: var(--white); font-size: 32px; margin-bottom: 12px; }
.hero p { color: #f0e0c8; max-width: 640px; margin: 0 auto 20px; }
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 700;
  border: none;
  transition: 0.2s;
}
.btn:hover { background: var(--wood-light); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------- Section ---------- */
.section { padding: 50px 0; }
.section-title { text-align: center; margin-bottom: 30px; }
.section-title h2 { font-size: 26px; }
.section-title p { color: var(--text-light); }

/* ---------- Category Grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.2s;
  text-align: center;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-card .cat-img { height: 150px; background: var(--cream-dark) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.category-card .cat-body { padding: 14px; }
.category-card h3 { font-size: 16px; margin: 0; }

/* ---------- Product Grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .p-img { height: 190px; background: var(--cream-dark) center/cover no-repeat; position: relative; }
.product-card .p-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--gold); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 20px;
}
.product-card .p-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 15px; margin-bottom: 6px; min-height: 40px; }
.product-card .price { color: var(--wood); font-weight: 700; font-size: 17px; margin: 6px 0 12px; }
.product-card .p-actions { margin-top: auto; display: flex; gap: 8px; }

/* ---------- Product Detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0; }
.gallery-main { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 420px; background: var(--cream-dark) center/cover no-repeat; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--gold); }
.product-info h1 { font-size: 26px; }
.product-info .price { font-size: 28px; color: var(--wood); font-weight: 800; margin: 14px 0; }
.product-info .desc { color: var(--text-light); margin: 16px 0; white-space: pre-line; }
.qty-selector { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.qty-selector button { width: 36px; height: 36px; border: 1px solid var(--wood-light); background: var(--white); border-radius: 6px; font-size: 18px; }
.qty-selector input { width: 60px; text-align: center; padding: 8px; border: 1px solid var(--wood-light); border-radius: 6px; }
.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.breadcrumb { padding: 14px 0; color: var(--text-light); font-size: 14px; }
.breadcrumb a:hover { color: var(--wood); }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--cream-dark); }
.cart-table th { background: var(--cream-dark); }
.cart-item-img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }
.cart-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 20px; max-width: 380px; margin-left: auto; }
.cart-summary .row, .order-review .row { display: flex; justify-content: space-between; padding: 8px 0; }
.cart-summary .total, .order-review .total { font-size: 20px; font-weight: 800; color: var(--wood); border-top: 1px solid var(--cream-dark); margin-top: 8px; padding-top: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 15px;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--gold); }
.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; }
.order-review { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; height: fit-content; }
.order-review .item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--cream-dark); font-size: 14px; }

/* ---------- Floating contact ---------- */
.floating-contact {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  display: flex; flex-direction: column; gap: 12px;
}
.fab {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--shadow-lg);
  animation: pulse 2.4s infinite;
}
.fab-line { background: #06C755; }
.fab-messenger { background: #0084FF; }
.fab-phone { background: var(--wood); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200,150,62,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(200,150,62,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,150,62,0); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--wood-dark); color: #e8dcc8; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 40px 20px; }
.site-footer h3, .site-footer h4 { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { text-align: center; padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }

/* ---------- Alerts ---------- */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; }
.alert-success { background: #e6f4ea; color: var(--success); border: 1px solid #b7dfc0; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f4c7c1; }

/* ---------- Order success ---------- */
.success-box { text-align: center; padding: 60px 20px; max-width: 560px; margin: 0 auto; }
.success-box .icon { font-size: 60px; }
.order-code-box { background: var(--cream-dark); padding: 16px; border-radius: var(--radius); font-size: 20px; font-weight: 800; color: var(--wood); margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product-detail, .checkout-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); flex-direction: column; gap: 0;
    box-shadow: var(--shadow-lg); padding: 10px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav > a { padding: 12px 20px; width: 100%; }
  .dropdown-menu { position: static; box-shadow: none; display: none; padding-left: 20px; }
  .dropdown.open .dropdown-menu { display: block; }
  .hero h1 { font-size: 24px; }
  .gallery-main { height: 280px; }
  .cart-table { font-size: 13px; }
  .cart-table th, .cart-table td { padding: 8px; }
}
