@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #eaeded;
  --white: #fff;
  --ink: #0f1111;
  --muted: #565959;
  --link: #007185;
  --orange: #ff9900;
  --orange-dark: #e88b00;
  --green: #067d62;
  --border: #d5d9d9;
  --font: 'IBM Plex Sans', system-ui, sans-serif;
  --max: 1280px;
  --drawer-w: 400px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
body.drawer-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #c7511f; text-decoration: underline; }
.container { width: min(var(--max), calc(100% - 24px)); margin: 0 auto; }

.top-strip { background: #232f3e; color: #fff; font-size: 13px; padding: 8px 16px; text-align: center; }
.top-strip em { color: var(--orange); font-style: normal; font-weight: 700; }

.market-header { background: #131921; color: #fff; }
.header-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.35rem; color: #fff; white-space: nowrap; }
.logo span { color: var(--orange); }
.logo:hover { color: #fff; text-decoration: none; }
.search-wrap { flex: 1; display: flex; min-width: 200px; max-width: 720px; }
.search-wrap select { padding: 10px 12px; border: none; background: #f3f3f3; border-radius: 8px 0 0 8px; font-size: 12px; color: var(--muted); }
.search-wrap input { flex: 1; padding: 10px 14px; border: none; font-size: 14px; }
.search-wrap button { padding: 0 18px; background: var(--orange); border: none; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 18px; }
.header-links { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.header-links a, .header-links button { color: #fff; background: none; border: none; cursor: pointer; font-family: var(--font); font-size: 12px; text-align: left; }
.header-links a:hover { color: var(--orange); text-decoration: none; }
.header-links .cart-btn { background: transparent; display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.cart-badge { background: var(--orange); color: #131921; min-width: 18px; height: 18px; border-radius: 999px; font-size: 11px; display: none; align-items: center; justify-content: center; font-weight: 800; }
.cart-badge.show { display: inline-flex; }

.cat-bar { background: #232f3e; padding: 8px 0; overflow-x: auto; }
.cat-bar-inner { display: flex; gap: 18px; white-space: nowrap; font-size: 13px; }
.cat-bar a { color: #fff; font-weight: 500; }
.cat-bar a:hover { color: var(--orange); text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 8px; border: none; cursor: pointer; font-family: var(--font); }
.btn-orange { background: linear-gradient(180deg, #f7dfa5 0%, var(--orange) 100%); color: var(--ink); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-orange:hover { background: var(--orange-dark); }
.btn-dark { background: #ffd814; color: var(--ink); }
.btn-outline { background: var(--white); border: 1px solid var(--border); color: var(--ink); }

/* Catalog layout */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px 0 48px; }
.sidebar { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 16px; height: fit-content; position: sticky; top: 12px; }
.sidebar h3 { font-size: 14px; margin: 0 0 12px; }
.sidebar label { display: block; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.sidebar input { margin-right: 8px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.product-tile {
  background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; height: 100%; transition: box-shadow 0.2s;
}
.product-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.product-tile img { width: 100%; height: 160px; object-fit: contain; margin-bottom: 10px; background: #fafafa; border-radius: 4px; }
.product-tile h3 { font-size: 13px; font-weight: 400; margin: 0 0 6px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile h3 a { color: var(--ink); }
.product-tile h3 a:hover { color: var(--link); }
.stars { color: #ffa41c; font-size: 12px; letter-spacing: 1px; }
.stars span { color: var(--link); font-size: 12px; margin-left: 4px; }
.price { font-size: 18px; font-weight: 700; color: var(--ink); margin: 6px 0; }
.price .was { font-size: 13px; color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.delivery-badge { font-size: 12px; color: var(--green); font-weight: 600; margin-bottom: 8px; }
.product-tile .btn { width: 100%; margin-top: auto; padding: 7px; font-size: 12px; }
.product-tile.hidden { display: none; }

.toolbar { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-family: var(--font); }

/* Product detail — Amazon-like */
.breadcrumb { font-size: 12px; padding: 14px 0; color: var(--muted); }
.breadcrumb a { color: var(--link); }
.pdp-grid { display: grid; grid-template-columns: 1fr 320px 300px; gap: 24px; padding-bottom: 48px; align-items: start; }
.pdp-image img { width: 100%; max-height: 420px; object-fit: contain; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.pdp-main h1 { font-size: 22px; font-weight: 400; margin: 0 0 8px; line-height: 1.3; }
.pdp-main .brand { font-size: 13px; color: var(--link); margin-bottom: 8px; }
.pdp-main ul.bullets { margin: 16px 0; padding-left: 20px; }
.pdp-main ul.bullets li { margin-bottom: 6px; color: var(--ink); }
.pdp-main .desc-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pdp-main .desc-block h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.pdp-main .desc-block p { color: var(--muted); line-height: 1.65; }

.buy-box {
  background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 16px;
  position: sticky; top: 12px;
}
.buy-box .price-lg { font-size: 26px; font-weight: 400; margin: 0 0 4px; }
.buy-box .stock { color: var(--green); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.buy-box .ship { font-size: 13px; margin-bottom: 12px; }
.qty-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.qty-row select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.buy-box .btn { width: 100%; margin-bottom: 8px; padding: 10px; }
.wish-link { font-size: 12px; background: none; border: none; color: var(--link); cursor: pointer; font-family: var(--font); padding: 0; }

.related-row { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 48px; }
.related-row h2 { font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.related-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.related-item { flex: 0 0 140px; text-align: center; font-size: 12px; }
.related-item img { height: 100px; object-fit: contain; margin: 0 auto 8px; background: #fafafa; border-radius: 4px; }

/* Home */
.hero-market { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 32px 28px; margin: 16px 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
.hero-market h1 { font-size: 28px; font-weight: 700; margin: 0 0 12px; }
.hero-market p { color: var(--muted); margin: 0 0 20px; }
.dept-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 24px; }
.dept-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.dept-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); text-decoration: none; color: var(--link); }

/* Guides */
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px 0 48px; }
.guide-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.guide-card img { height: 160px; object-fit: cover; width: 100%; }
.guide-card-body { padding: 16px; }
.guide-card h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.guide-card p { font-size: 13px; color: var(--muted); margin: 0; }

.article-page { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 32px 36px; margin: 16px 0 48px; max-width: 820px; }
.article-page h1 { font-size: 26px; margin: 0 0 16px; }
.article-page h2 { font-size: 18px; margin: 24px 0 10px; }
.article-page p { color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.article-page .lead-img { width: 100%; height: 320px; object-fit: cover; border-radius: 8px; margin-bottom: 24px; }

/* Cart */
.cart-page { padding: 16px 0 48px; }
.cart-box { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.cart-item { display: grid; grid-template-columns: 100px 1fr 120px 100px 80px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 100px; height: 100px; object-fit: contain; background: #fafafa; border-radius: 4px; }
.cart-summary { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; max-width: 360px; margin-left: auto; }
.cart-summary .line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.cart-summary .total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.empty-cart { text-align: center; padding: 64px 24px; background: var(--white); border-radius: 8px; }

.cart-drawer { position: fixed; top: 0; right: 0; width: var(--drawer-w); max-width: 100%; height: 100%; background: var(--white); z-index: 500; transform: translateX(100%); transition: transform 0.3s; box-shadow: -4px 0 24px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.cart-drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 499; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--border); }

#toastContainer { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 600; }
.toast { background: #131921; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 13px; margin-top: 8px; }

.site-footer { background: #131921; color: #ddd; padding: 40px 0 24px; margin-top: 32px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.footer-grid h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.footer-grid a { color: #ddd; display: block; margin-bottom: 6px; }
.footer-bottom { text-align: center; font-size: 12px; color: #999; border-top: 1px solid #3a4553; padding-top: 16px; }

@media (max-width: 992px) {
  .pdp-grid { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .product-grid, .dept-grid, .guide-grid { grid-template-columns: 1fr 1fr; }
  .hero-market { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 80px 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .product-grid, .dept-grid, .guide-grid { grid-template-columns: 1fr; }
  .search-wrap select { display: none; }
}
