/* ============================================
   TradePhoto - Frontend Stylesheet
   Western / Clean E-commerce Style
   ============================================ */

:root {
  --primary: #1a1a1a;
  --accent: #c8a45c;
  --bg: #ffffff;
  --bg-light: #f8f8f8;
  --text: #333333;
  --text-muted: #888888;
  --border: #e5e5e5;
  --radius: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== Top Bar ===== */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 6px 0;
  font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #ccc; }
.topbar a:hover { color: #fff; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.logo { font-size: 24px; font-weight: 700; letter-spacing: 1px; color: var(--primary); }
.logo span { color: var(--accent); }

/* Main Nav */
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a { font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--text); }
.main-nav a:hover, .main-nav a.active { color: var(--accent); }

/* Mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ===== Category Icons Row ===== */
.cat-icons {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.cat-icons-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  text-align: center;
}
.cat-icon-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px; border-radius: var(--radius); transition: background .2s;
}
.cat-icon-item:hover { background: #fff; box-shadow: var(--shadow); }
.cat-icon-img {
  width: 160px; height: 90px; border-radius: 8px; overflow: hidden;
  background: #eee; display: flex; align-items: center; justify-content: center;
}
.cat-icon-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-icon-name { font-size: 13px; font-weight: 500; }

/* ===== Banner / Slider ===== */
.hero-banner {
  width: 100%; overflow: hidden; position: relative;
}
.hero-banner .slide {
  width: 100%; height: 420px; background: #222;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.hero-banner .slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-banner .slide-text {
  position: absolute; bottom: 40px; left: 60px; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.hero-banner .slide-text h2 { font-size: 36px; margin-bottom: 8px; }
.hero-banner .slide-text p { font-size: 16px; opacity: .9; }

/* ===== Home Sections ===== */
.home-section { padding: 48px 0; }
.home-section:nth-child(even) { background: var(--bg-light); }
.section-title {
  font-size: 28px; font-weight: 600; text-align: center; margin-bottom: 32px;
  position: relative; padding-bottom: 12px;
}
.section-title::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 50px; height: 3px; background: var(--accent);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.product-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.product-card-img {
  width: 100%; aspect-ratio: 1; background: #f0f0f0; overflow: hidden;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-info { padding: 12px; text-align: center; }
.product-card-info h4 { font-size: 13px; font-weight: 500; color: var(--text); }

/* "More" button */
.more-btn-wrap { text-align: center; margin-top: 28px; }
.btn-more {
  display: inline-block; padding: 10px 32px; border: 1px solid var(--primary);
  color: var(--primary); border-radius: var(--radius); font-size: 13px;
  text-transform: uppercase; letter-spacing: 1px; transition: all .2s;
}
.btn-more:hover { background: var(--primary); color: #fff; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--text-muted); padding: 16px 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ===== Category Dropdown (mega menu) ===== */
.has-dropdown { position: relative; }
.has-dropdown > .dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; min-width: 600px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 24px; z-index: 200; border-radius: var(--radius);
  display: none; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.has-dropdown:hover > .dropdown { display: grid; }
.dropdown-col h5 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--primary); }
.dropdown-col a { display: block; font-size: 13px; color: var(--text-muted); padding: 3px 0; }
.dropdown-col a:hover { color: var(--accent); }

/* ===== Product Detail Page ===== */
.product-detail { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0; }

/* Sidebar category tree */
.cat-sidebar {
  background: var(--bg-light); padding: 20px; border-radius: var(--radius);
  align-self: start; position: sticky; top: 80px;
}
.cat-sidebar h4 { font-size: 14px; text-transform: uppercase; margin-bottom: 12px; }
.cat-sidebar ul { list-style: none; }
.cat-sidebar .l1 > a { font-weight: 600; padding: 8px 0; display: block; border-bottom: 1px solid var(--border); }
.cat-sidebar .l2 { padding-left: 12px; }
.cat-sidebar .l2 > a { font-size: 13px; padding: 4px 0; display: block; color: var(--text-muted); }
.cat-sidebar .l3 { padding-left: 24px; }
.cat-sidebar .l3 > a { font-size: 12px; padding: 3px 0; display: block; color: var(--text-muted); }
.cat-sidebar a:hover { color: var(--accent); }

/* Product main */
.product-main .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.product-main .gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); cursor: pointer; }
.product-main h1 { font-size: 24px; margin-bottom: 12px; }
.product-main .detail { font-size: 14px; color: var(--text); line-height: 1.8; }

/* Share buttons */
.share-bar { margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-bar span { font-size: 13px; margin-right: 12px; }
.share-bar a {
  display: inline-block; width: 36px; height: 36px; line-height: 36px; text-align: center;
  border-radius: 50%; color: #fff; margin-right: 6px; font-size: 14px;
}
.share-bar a.fb { background: #1877f2; }
.share-bar a.tw { background: #000; }
.share-bar a.wa { background: #25d366; }
.share-bar a.rd { background: #ff4500; }

/* ===== Message Board ===== */
.message-section { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 40px 0; }
.message-form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.message-form input, .message-form select, .message-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit;
}
.message-form textarea { min-height: 100px; resize: vertical; }
.btn-submit {
  background: var(--primary); color: #fff; border: none; padding: 12px 36px;
  font-size: 14px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
  border-radius: var(--radius); margin-top: 16px;
}
.btn-submit:hover { background: var(--accent); }
.form-success { background: #e6f9e6; color: #2d7a2d; padding: 12px; border-radius: var(--radius); margin-bottom: 16px; }

/* ===== Footer ===== */
.site-footer {
  background: var(--primary); color: #aaa; padding: 10px 0; margin-top: 40px;
  font-size: 13px;
}
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h5 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.site-footer a { color: #aaa; display: block; padding: 2px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 0; }

/* ===== Category Page (product listing by level-3) ===== */
.cat-product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 24px 0; }

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,.08); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .cat-icons-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-icon-img { width: 100%; height: 60px; }
  .cat-icon-name { text-align: center; font-size: 12px; }
  .cat-page-title { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero-banner .slide { height: 220px; }
  .hero-banner .slide-text { left: 20px; bottom: 20px; }
  .hero-banner .slide-text h2 { font-size: 20px; }
  .product-detail { grid-template-columns: 1fr; }
  .cat-sidebar { position: static; }
  .message-section { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .product-main .gallery { grid-template-columns: repeat(2, 1fr); }
  .has-dropdown > .dropdown { display: none !important; }
}
