*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

:root{
  --bg:#EBEBEB;
  --surface:#FFFFFF;
  --ink:#333333;
  --ink-soft:#666666;
  --yellow:#FFE600;
  --blue:#3483FA;
  --blue-dark:#2968C8;
  --green:#00A650;
  --border:#E6E6E6;
  --radius:8px;
}

html{scroll-behavior:smooth;}

body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Roboto',-apple-system,BlinkMacSystemFont,sans-serif;
  font-size:16px;
  line-height:1.5;
}

a{color:inherit;text-decoration:none;}

h1,h2,h3{font-weight:700;color:var(--ink);}

.btn{
  font-family:'Roboto',sans-serif;
  font-size:14px;
  font-weight:700;
  padding:12px 22px;
  border-radius:6px;
  border:1px solid transparent;
  cursor:pointer;
  transition:background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary{background:var(--yellow);color:#1a1a1a;}
.btn-primary:hover{background:#f2d900;}
.btn-ghost{background:var(--surface);color:var(--blue);border-color:var(--blue);}
.btn-ghost:hover{background:#EBF3FF;}
.btn:focus-visible{outline:2px solid var(--blue);outline-offset:2px;}

/* HEADER */
.site-header{
  position:sticky;top:0;z-index:40;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  box-shadow:0 1px 3px rgba(0,0,0,0.06);
}
.header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:0 24px;
  height:74px;
  display:flex;
  align-items:center;
  gap:36px;
}
.brand{
  font-size:22px;
  font-weight:900;
  color:var(--blue);
  flex-shrink:0;
}
.categories{
  display:flex;
  gap:26px;
  flex:1;
}
.categories a{
  font-size:14px;
  font-weight:500;
  color:var(--ink-soft);
  padding:6px 0;
  border-bottom:2px solid transparent;
  transition:color 0.15s ease,border-color 0.15s ease;
}
.categories a:hover{color:var(--blue);border-color:var(--blue);}
.header-actions{flex-shrink:0;}

.menu-toggle{
  display:none;
  background:none;border:1px solid var(--border);
  width:40px;height:40px;
  border-radius:6px;
  cursor:pointer;
  flex-direction:column;align-items:center;justify-content:center;gap:5px;
  flex-shrink:0;
}
.menu-toggle span{width:18px;height:2px;background:var(--ink);display:block;}

@media (max-width:820px){
  .header-inner .categories{display:none;}
  .header-actions .btn{padding:10px 16px;font-size:13px;}
}

/* MAIN */
main{
  max-width:1200px;
  margin:0 auto;
  padding:0 24px 100px;
}

.page-head{
  padding:32px 0 24px;
}
.page-head h1{font-size:26px;margin-bottom:6px;}
.page-head p{color:var(--ink-soft);font-size:14.5px;}

.category-block{padding:8px 0 32px;}
.category-block h2{
  font-size:19px;
  margin-bottom:18px;
  padding-bottom:10px;
  border-bottom:3px solid var(--yellow);
  display:inline-block;
}

.product-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}
@media(max-width:1000px){.product-grid{grid-template-columns:repeat(3,1fr);}}
@media(max-width:760px){.product-grid{grid-template-columns:repeat(2,1fr);}}
@media(max-width:480px){.product-grid{grid-template-columns:1fr;}}

.product-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transition:box-shadow 0.2s ease, transform 0.2s ease;
}
.product-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.12);transform:translateY(-2px);}

.product-thumb{
  aspect-ratio:1/1;
  background:linear-gradient(135deg,#FFF2A8,var(--yellow));
  display:flex;align-items:center;justify-content:center;
  font-size:34px;
  font-weight:900;
  color:#7a6600;
}

.product-body{padding:14px 16px 18px;display:flex;flex-direction:column;gap:6px;flex:1;}
.product-card h3{font-size:15px;font-weight:500;color:var(--ink);line-height:1.3;}
.product-card p{font-size:12.5px;color:var(--ink-soft);flex:1;}
.product-card .price{
  font-size:21px;
  font-weight:400;
  color:var(--ink);
  margin-top:4px;
}
.product-card .unit{
  font-size:12px;
  color:var(--ink-soft);
  font-weight:400;
}
.product-card .shipping{
  font-size:12px;
  font-weight:700;
  color:var(--green);
  margin-top:2px;
}

.product-card .price-row{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-top:4px;}
.product-card .original-price{
  font-size:13px;
  color:var(--ink-soft);
  text-decoration:line-through;
}
.product-card .discount-badge{
  background:var(--green);
  color:#fff;
  font-size:11px;
  font-weight:700;
  padding:2px 6px;
  border-radius:4px;
}

.product-card .btn-buy{
  display:inline-block;
  margin-top:8px;
  padding:9px 16px;
  background:var(--blue);
  color:#fff;
  font-size:13.5px;
  font-weight:700;
  text-align:center;
  border-radius:6px;
  transition:background 0.15s ease;
}
.product-card .btn-buy:hover{background:var(--blue-dark);}

.empty-state{
  text-align:center;
  padding:100px 20px;
  color:var(--ink-soft);
}
.empty-state p{margin-bottom:20px;font-size:15px;}

/* MODAL */
.modal-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,0.5);
  display:none;
  align-items:center;justify-content:center;
  padding:20px;
  z-index:100;
}
.modal-overlay.open{display:flex;}
.modal{
  background:var(--surface);
  border-radius:var(--radius);
  width:100%;max-width:460px;
  padding:28px;
  max-height:90vh;
  overflow-y:auto;
  box-shadow:0 8px 30px rgba(0,0,0,0.25);
}
.modal-head{
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:20px;
}
.modal-head h2{font-size:19px;}
.modal-close{
  background:none;border:none;
  font-size:24px;line-height:1;
  color:var(--ink-soft);
  cursor:pointer;
}
.modal-close:hover{color:var(--ink);}

#productForm{display:flex;flex-direction:column;gap:14px;}
#productForm label{
  display:flex;flex-direction:column;gap:6px;
  font-size:13px;font-weight:500;color:var(--ink-soft);
}
.field-row{display:flex;gap:14px;}
.field-row label{flex:1;}

#productForm input,#productForm select,#productForm textarea{
  font-family:'Roboto',sans-serif;
  font-size:15px;
  color:var(--ink);
  border:1px solid #C4C4C4;
  border-radius:6px;
  padding:10px 12px;
  background:var(--surface);
  font-weight:400;
}
#productForm input:focus,#productForm select:focus,#productForm textarea:focus{
  outline:2px solid var(--blue);
  outline-offset:1px;
  border-color:var(--blue);
}
#productForm textarea{resize:vertical;}

.checkbox-label{
  flex-direction:row !important;
  align-items:center;
  gap:8px !important;
  font-size:14px !important;
  text-transform:none !important;
  color:var(--ink) !important;
  font-weight:400 !important;
}
.checkbox-label input{width:auto;}

.modal-actions{
  display:flex;justify-content:flex-end;gap:12px;
  margin-top:4px;
}