* {
  box-sizing: border-box;
  }

html {
scroll-behavior: smooth;
}

body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background: #f6f7f8;
color: #111;
}

/* =========================
GENERAL
========================= */

.wrap {
width: 100%;
max-width: 1150px;
margin: 0 auto;
padding: 0 18px;
}

a {
text-decoration: none;
}

button,
select,
input,
textarea {
font-family: inherit;
}

/* =========================
HEADER
========================= */

.site-header {
background: #111;
color: #fff;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.nav {
height: 68px;
display: flex;
align-items: center;
justify-content: space-between;
}

.logo {
color: #fff;
font-size: 28px;
font-weight: 900;
letter-spacing: -1px;
}

.logo span {
font-weight: 400;
}

.cart-link {
color: #fff;
font-size: 15px;
font-weight: 700;
display: flex;
align-items: center;
gap: 7px;
}

.cart-link b {
min-width: 24px;
height: 24px;
display: inline-flex;
align-items: center;
justify-content: center;
background: #fff;
color: #111;
border-radius: 50%;
font-size: 12px;
}

/* =========================
HERO
========================= */

.hero {
padding: 55px 0 35px;
}

.hero h1 {
margin: 0 0 8px;
font-size: 42px;
line-height: 1.1;
font-weight: 900;
}

.hero p {
margin: 0;
color: #666;
font-size: 17px;
}

/* =========================
SECTION
========================= */

section {
margin-bottom: 35px;
}

section h2 {
margin: 0 0 15px;
font-size: 25px;
}

/* =========================
CATEGORIES
========================= */

.categories {
width: 100%;
display: flex;
gap: 12px;
overflow-x: auto;
padding: 8px 3px 20px;
scrollbar-width: thin;
}

.categories::-webkit-scrollbar {
height: 5px;
}

.categories::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 10px;
}

.cat {
flex: 0 0 auto;
min-width: 105px;
padding: 8px;
border: 0;
background: #fff;
border-radius: 14px;
cursor: pointer;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
transition: 0.2s ease;
}

.cat:hover {
transform: translateY(-2px);
}

.cat.active {
outline: 2px solid #111;
}

.cat img {
width: 82px;
height: 70px;
display: block;
margin: 0 auto;
object-fit: cover;
border-radius: 10px;
}

.cat span {
display: block;
margin-top: 8px;
color: #111;
font-size: 14px;
font-weight: 700;
text-align: center;
}

/* =========================
PRODUCTS HEADER
========================= */

.products-section {
padding-bottom: 50px;
}

.section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 15px;
margin-bottom: 5px;
}

.section-head h2 {
margin: 0;
}

#sort {
width: auto;
min-width: 170px;
padding: 10px 13px;
border: 1px solid #ddd;
border-radius: 10px;
background: #fff;
color: #111;
cursor: pointer;
}

/* =========================
PRODUCTS GRID
========================= */

.grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 18px;
padding-top: 15px;
}

/* =========================
CARD
========================= */

.card {
background: #fff;
border-radius: 16px;
box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}

/* =========================
PRODUCT
========================= */

.product {
overflow: hidden;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.09);
}

.product > img {
width: 100%;
aspect-ratio: 4 / 5;
display: block;
object-fit: cover;
background: #eee;
}

.product-body {
padding: 14px;
display: grid;
gap: 9px;
}

.product-body h3 {
margin: 0;
font-size: 16px;
line-height: 1.3;
}

.product-body strong {
font-size: 18px;
}

.product-body small {
color: #777;
font-size: 13px;
}

/* =========================
BUTTONS
========================= */

.btn {
border: 0;
border-radius: 10px;
padding: 11px 15px;
cursor: pointer;
background: #eee;
color: #111;
font-weight: 700;
transition: 0.2s ease;
}

.btn:hover {
transform: translateY(-1px);
}

.btn.primary {
background: #111;
color: #fff;
}

.btn.primary:hover {
background: #222;
}

.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
transform: none;
}

/* =========================
FORM ELEMENTS
========================= */

input,
textarea,
select {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 10px;
background: #fff;
color: #111;
font-size: 15px;
outline: none;
}

input:focus,
textarea:focus,
select:focus {
border-color: #111;
}

textarea {
min-height: 110px;
resize: vertical;
}

/* =========================
TOAST
========================= */

.toast {
position: fixed;
right: 20px;
bottom: 20px;
z-index: 9999;

background: #111;
color: #fff;

padding: 13px 18px;
border-radius: 10px;

transform: translateY(100px);
opacity: 0;

pointer-events: none;

transition: 0.25s ease;
}

.toast.show {
transform: translateY(0);
opacity: 1;
}

/* =========================
CART
========================= */

.checkout {
max-width: 600px;
padding: 20px;
margin: 25px 0 50px;
}

.checkout form {
display: grid;
gap: 12px;
}

.cart-row {
display: grid;
grid-template-columns: 90px 1fr auto;
gap: 18px;
align-items: center;

padding: 14px;
margin: 12px 0;
}

.cart-row img {
width: 90px;
height: 110px;
object-fit: cover;
border-radius: 10px;
background: #eee;
}

.cart-row h3 {
margin: 0 0 7px;
}

.cart-row p {
margin: 0 0 10px;
color: #666;
}

.qty {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}

.qty button {
border: 1px solid #ddd;
background: #fff;
color: #111;
border-radius: 7px;
padding: 7px 11px;
cursor: pointer;
}

.qty button:hover {
background: #f2f2f2;
}

.qty .remove {
color: #b00000;
}

.total {
display: flex;
justify-content: space-between;
align-items: center;

padding: 18px 0;

font-size: 22px;
font-weight: 700;
}

.empty {
padding: 35px;
text-align: center;
}

/* =========================
ADMIN
========================= */

.admin {
padding-top: 35px;
padding-bottom: 60px;
}

.login {
max-width: 430px;
margin: 50px auto;
padding: 25px;
}

.login h1 {
margin-top: 0;
}

.login form {
display: grid;
gap: 12px;
}

.admin-top {
display: flex;
justify-content: space-between;
align-items: center;
gap: 15px;
margin-bottom: 25px;
}

.admin-top h1 {
margin: 0 0 5px;
}

.admin-top p {
margin: 0;
color: #777;
}

.admin-label {
color: #aaa;
font-size: 14px;
}

/* =========================
DASHBOARD STATS
========================= */

.stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
margin: 25px 0;
}

.stat {
padding: 20px;
}

.stat small {
display: block;
color: #777;
font-size: 13px;
}

.stat strong {
display: block;
margin-top: 8px;
font-size: 28px;
}

/* =========================
ADMIN PANELS
========================= */

.panel {
padding: 20px;
margin: 20px 0;
}

.panel .section-head {
margin-bottom: 15px;
}

/* =========================
TABLE
========================= */

.table-wrap {
width: 100%;
overflow-x: auto;
}

table {
width: 100%;
border-collapse: collapse;
}

th,
td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #eee;
white-space: nowrap;
}

th {
font-size: 13px;
color: #666;
font-weight: 700;
}

td {
font-size: 14px;
}

.stock-input {
max-width: 100px;
}

.status {
min-width: 130px;
}

/* =========================
MOBILE
========================= */

@media (max-width: 900px) {

.grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats {
grid-template-columns: repeat(2, 1fr);
}

}

/* =========================
MOBILE PHONE
========================= */

@media (max-width: 650px) {

.wrap {
padding: 0 12px;
}

.nav {
height: 62px;
}

.logo {
font-size: 25px;
}

.hero {
padding: 38px 0 25px;
}

.hero h1 {
font-size: 34px;
}

.hero p {
font-size: 15px;
}

section h2 {
font-size: 22px;
}

.grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}

.product-body {
padding: 10px;
gap: 7px;
}

.product-body h3 {
font-size: 14px;
}

.product-body strong {
font-size: 16px;
}

.product-body small {
font-size: 12px;
}

.btn {
padding: 10px 11px;
font-size: 13px;
}

#sort {
min-width: 140px;
}

.section-head {
align-items: center;
}

.stats {
gap: 10px;
}

.stat {
padding: 15px;
}

.stat strong {
font-size: 22px;
}

.admin-top {
align-items: flex-start;
}

.admin-top h1 {
font-size: 27px;
}

.panel {
padding: 14px;
}

}

/* =========================
SMALL PHONE
========================= */

@media (max-width: 430px) {

.hero h1 {
font-size: 30px;
}

.cart-link {
font-size: 14px;
}

.categories {
gap: 8px;
}

.cat {
min-width: 90px;
}

.cat img {
width: 68px;
height: 60px;
}

.cat span {
font-size: 12px;
}

.section-head {
flex-direction: column;
align-items: stretch;
}

#sort {
width: 100%;
}

.cart-row {
grid-template-columns: 70px 1fr;
gap: 12px;
}

.cart-row img {
width: 70px;
height: 90px;
}

.cart-row > strong {
grid-column: 2;
}

.qty {
gap: 5px;
}

.qty button {
padding: 6px 9px;
}

}

/* =========================
ACCESSIBILITY
========================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
outline: 2px solid #111;
outline-offset: 2px;
}
