:root {
  --bg: #fbf7f2; --ink: #2b1d14; --muted: #7a6a5d; --line: #e8dccd; --card: #fff;
  --accent: #b5562b; --accent-ink: #fff; --green: #2f7a4b; --amber: #b7791f; --red: #b23a3a;
  --radius: 10px; --serif: Georgia, "Times New Roman", serif; --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.promo { background: var(--ink); color: #f3e7d8; text-align: center; font-size: 14px; padding: 8px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.logo { font-family: var(--serif); font-size: 22px; text-decoration: none; font-weight: bold; }
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 22px; }
.main-nav a, .cart-link { text-decoration: none; font-weight: 500; }
.main-nav a:hover { color: var(--accent); }
.cart-link { background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; }

.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--serif); font-size: clamp(32px, 5vw, 54px); line-height: 1.1; margin: 0 0 12px; max-width: 14ch; }
.hero p { color: var(--muted); max-width: 52ch; margin: 0; font-size: 18px; }

section h2 { font-family: var(--serif); font-size: 26px; margin: 40px 0 16px; }
.featured .grid { grid-template-columns: repeat(3, 1fr); }

.category-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 28px 0 12px; }
.category-nav a { text-decoration: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; }
.category-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

#filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
#filters label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
#filters label.check { flex-direction: row; align-items: center; color: var(--ink); gap: 6px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.search-box { flex: 1; min-width: 200px; }
#result-count { color: var(--muted); font-size: 14px; margin: 14px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; transition: box-shadow .15s; }
.product-card:hover { box-shadow: 0 6px 20px rgba(43,29,20,.08); }
.product-card.out_of_stock { opacity: .65; }
.product-card__link { text-decoration: none; }
.product-card img { border-radius: 8px; aspect-ratio: 1; width: 100%; height: auto; }
.product-card__title { font-family: var(--serif); font-size: 18px; margin: 10px 0 0; }
.product-card__meta, .product-card__notes { margin: 0; font-size: 13px; color: var(--muted); }
.product-card__price { margin-top: auto; padding-top: 6px; }
.from { font-size: 12px; color: var(--muted); }
.roast { text-transform: capitalize; }
.stars { color: #c8902f; letter-spacing: 1px; }
.review-count { color: var(--muted); font-size: 13px; }
.price { font-weight: 700; font-size: 17px; }
.price--sale { color: var(--red); }
.price--was { color: var(--muted); font-weight: 400; font-size: 14px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 600; vertical-align: middle; }
.badge--sale { background: #fbe3e3; color: var(--red); }
.badge--verified { background: #e3f3e8; color: var(--green); }
.stock { font-size: 13px; margin: 2px 0 0; font-weight: 600; }
.stock--in_stock { color: var(--green); }
.stock--low_stock { color: var(--amber); }
.stock--out_of_stock { color: var(--red); }

.skeleton { background: linear-gradient(90deg, #efe6da 25%, #f7f0e7 50%, #efe6da 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); height: 380px; }
.skeleton--big { height: 520px; margin-top: 30px; }
@keyframes shimmer { to { background-position: -200% 0; } }

#pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.page-link { padding: 8px 13px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--card); }
.page-link.current { background: var(--ink); color: #fff; border-color: var(--ink); }

.breadcrumb ol { list-style: none; padding: 0; margin: 24px 0; display: flex; gap: 8px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product__media img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; height: auto; }
.product__brand { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin: 0; }
.product__title { font-family: var(--serif); font-size: 38px; margin: 4px 0 8px; line-height: 1.1; }
.product__price { margin: 14px 0 4px; }
.product__price .price { font-size: 26px; }
.notes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.note { background: #f3e7d8; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.buy { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 20px 0; }
.buy fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; width: 100%; }
.buy legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.buy label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.buy input[type=number] { width: 70px; }
.chip { flex-direction: row !important; align-items: center; gap: 6px !important; border: 1px solid var(--line); padding: 8px 12px; border-radius: 6px; color: var(--ink) !important; font-size: 15px !important; cursor: pointer; background: #fff; }
.chip:has(input:checked) { border-color: var(--ink); background: #f3e7d8; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; padding: 12px 22px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { background: #c9bfb4; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.specs { border-collapse: collapse; width: 100%; font-size: 14px; }
.specs th, .specs td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs th { color: var(--muted); font-weight: 500; width: 35%; }
.specs td { text-transform: capitalize; }
.reviews { max-width: 760px; }
.review { border-bottom: 1px solid var(--line); padding: 16px 0; }
.review footer { font-size: 13px; color: var(--muted); }
.review__body { margin: 6px 0; }
.loading { color: var(--muted); }

.cart-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cart-table th, .cart-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.cart-table input { width: 64px; }
.link { background: none; border: 0; color: var(--red); cursor: pointer; text-decoration: underline; font: inherit; }
.totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 6px 30px; margin: 20px 0; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 18px; }
.hint { text-align: right; color: var(--muted); font-size: 13px; }
#checkout { float: right; }
.empty, .not-found, .confirm { padding: 60px 0; text-align: center; }

.site-footer { margin-top: 80px; background: var(--ink); color: #e9dccb; padding: 40px 0; font-size: 14px; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer h4 { margin: 0 0 10px; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: #e9dccb; }
.disclaimer { grid-column: 1 / -1; border-top: 1px solid #4a3628; padding-top: 16px; color: #b7a593; }
#newsletter { display: flex; gap: 6px; margin-top: 10px; }
#newsletter .btn { padding: 8px 14px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 8px; transition: transform .25s; z-index: 50; }
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 800px) {
  .main-nav { display: none; }
  .product, .featured .grid { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .cart-table thead { display: none; }
}
