:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --border: #e4dfd9;
  --ink: #1a1714;
  --ink-2: #8a8078;
  --accent: #3d6b5e;
  --accent-light: #e8f0ee;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(26, 23, 20, 0.08);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; }
button { cursor: pointer; border: none; font-family: inherit; transition: var(--transition); }
input { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* Header */
header { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: rgba(247, 245, 242, 0.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); }
.logo { font-weight: 700; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.5px; }
#cart-btn { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 30px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
#cart-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Hero */
.hero { text-align: center; padding: 80px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 2.8rem; margin-bottom: 12px; letter-spacing: -1px; }
.hero p { color: var(--ink-2); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }

/* Main Layout */
main { display: flex; gap: 40px; padding: 50px 30px; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; align-items: flex-start; }

/* Filters Sidebar */
.filters { flex: 1; min-width: 250px; background: var(--surface); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); position: sticky; top: 100px; }
.filters h3 { margin-bottom: 15px; font-size: 1rem; }
.filters input[type="text"] { width: 100%; padding: 12px; margin-bottom: 25px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); transition: var(--transition); }
.filters input[type="text"]:focus { border-color: var(--accent); background: var(--surface); }
.categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.categories button { padding: 8px 14px; border-radius: 20px; background: transparent; border: 1px solid var(--border); color: var(--ink-2); text-transform: capitalize; font-weight: 500; font-size: 0.9rem; }
.categories button:hover { border-color: var(--accent); color: var(--accent); }
.categories button.active { background: var(--accent); color: white; border-color: var(--accent); }
.price-filter label { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.price-filter input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* Products Grid */
.products-area { flex: 3; min-width: 300px; }
.products-area h2 { margin-bottom: 20px; font-size: 1.2rem; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: transparent; }
.card .img-box { padding: 30px; background: var(--bg); display: flex; justify-content: center; align-items: center; height: 220px; }
.card img { max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card h3 { font-size: 1rem; font-weight: 500; margin-bottom: 8px; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.card p { font-weight: 700; font-size: 1.1rem; }
.card button { background: var(--accent-light); color: var(--accent); padding: 8px 16px; border-radius: 20px; font-weight: 600; }
.card button:hover { background: var(--accent); color: #fff; }

/* Modal Cart */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; justify-content: flex-end; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.modal.visible { opacity: 1; pointer-events: auto; }
.modal-content { width: 400px; max-width: 100%; background: var(--surface); height: 100%; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; }
.modal.visible .modal-content { transform: translateX(0); }
.modal-header, .modal-footer { padding: 25px; display: flex; justify-content: space-between; align-items: center; background: var(--surface); z-index: 2; }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.2rem; }
.close-cart { font-size: 1.5rem; background: none; color: var(--ink-2); }
.close-cart:hover { color: var(--ink); }
.modal-footer { border-top: 1px solid var(--border); flex-direction: column; gap: 15px; }
.modal-footer .total-row { display: flex; justify-content: space-between; width: 100%; font-weight: 700; font-size: 1.1rem; }
#checkout { background: var(--accent); color: white; padding: 15px; width: 100%; border-radius: var(--radius); font-weight: 600; font-size: 1rem; }
#checkout:hover { opacity: 0.9; }

/* Cart Items */
.cart-items { flex: 1; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 20px; }
.cart-empty { text-align: center; color: var(--ink-2); margin: auto; }
.cart-item { display: flex; gap: 15px; align-items: center; }
.cart-item img { width: 70px; height: 70px; object-fit: contain; background: var(--bg); padding: 10px; border-radius: 8px; }
.cart-item-details { flex: 1; }
.cart-item h4 { font-size: 0.9rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.cart-item p { font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.qty-controls { display: flex; gap: 15px; align-items: center; margin-top: 8px; }
.qty-controls button { width: 26px; height: 26px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-weight: 600; }
.qty-controls button:hover { border-color: var(--accent); color: var(--accent); }

/* Toast */
.toast { position: fixed; bottom: 30px; right: 30px; background: #1a1714; color: white; padding: 12px 24px; border-radius: 30px; font-weight: 500; font-size: 0.9rem; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; z-index: 2000; box-shadow: var(--shadow); }
.toast.visible { transform: translateY(0); opacity: 1; }
