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

:root {
    --pink: #e94f8a;
    --pink-light: #fdeaf1;
    --pink-soft: #f9d9e6;
    --text-dark: #33222a;
    --text-muted: #8a7a82;
    --border: #f0e0e8;
    --bg: #fffafc;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    direction: rtl;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Topbar ---- */
.topbar {
    background: #f7f2f4;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.topbar .phone { color: var(--pink); font-weight: 600; white-space: nowrap; }
.topbar-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; row-gap: 6px; }
.topbar-actions a { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.brand-svg { width: 18px; height: 18px; flex-shrink: 0; }
.cart-count {
    background: var(--pink);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    padding: 1px 6px;
}

@media (max-width: 640px) {
    .topbar { font-size: 12px; }
    .topbar .container { justify-content: center; }
    .topbar-actions { justify-content: center; width: 100%; }
    .topbar-actions:first-child { order: 2; }
    .topbar-actions:last-child { order: 1; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
}

/* ---- Header ---- */
.site-header { background: #fff; padding: 18px 0; text-align: center; }
.logo { font-size: 34px; font-weight: 700; color: var(--pink); margin: 0; }
.logo small { display: block; font-size: 13px; color: var(--text-muted); font-weight: 400; margin-top: 4px; }

.main-nav { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.main-nav ul { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.main-nav a { display: block; padding: 14px 4px; font-weight: 500; font-size: 14.5px; }
.main-nav a:hover { color: var(--pink); }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(120deg, #fbe4ee, #fdf3f7);
    padding: 50px 0;
}
.hero .container { display: flex; align-items: center; gap: 30px; flex-wrap: wrap-reverse; }
.hero-text { flex: 1 1 320px; }
.hero-text h1 { font-size: 30px; margin: 0 0 16px; color: var(--text-dark); }
.hero-text p { font-size: 16px; color: var(--pink); margin: 0 0 24px; }
.hero-image { flex: 1 1 380px; position: relative; }
.hero-image img { border-radius: 14px; }
.badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--pink);
    color: #fff;
    width: 78px; height: 78px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 6px 16px rgba(233,79,138,.35);
}
.badge-sale span { font-size: 10px; font-weight: 400; }
.btn {
    display: inline-block;
    background: var(--pink);
    color: #fff;
    padding: 11px 28px;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
}
.btn:hover { background: #d63d78; }
.btn-outline { background: transparent; border: 1.5px solid var(--pink); color: var(--pink); }

/* ---- Section titles ---- */
.section { padding: 40px 0; }
.section-title { text-align: center; font-size: 22px; margin-bottom: 30px; position: relative; }
.section-title::after {
    content: '';
    display: block;
    width: 50px; height: 3px;
    background: var(--pink);
    margin: 10px auto 0;
    border-radius: 3px;
}

/* ---- Category cards ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.cat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    padding: 30px 15px;
    transition: transform .15s, box-shadow .15s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(233,79,138,.12); }
.cat-icon { font-size: 40px; margin-bottom: 14px; }
.cat-svg { width: 40px; height: 40px; margin-bottom: 14px; color: var(--pink); }
.cat-card h3 { margin: 0; font-size: 15px; border-bottom: 2px solid var(--pink); display: inline-block; padding-bottom: 8px; }
.nav-svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--pink); margin-inline-end: 2px; }
.emoji-fallback { display: inline-block; line-height: 1; }
.cat-svg.emoji-fallback { width: auto; height: auto; font-size: 40px; }
.nav-svg.emoji-fallback { width: auto; height: auto; font-size: 14px; vertical-align: -2px; }

/* ---- Product grid ---- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px; }
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-thumb {
    height: 170px;
    background: var(--pink-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 46px;
}
.product-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h4 { margin: 0; font-size: 14.5px; font-weight: 500; }
.price-row { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 12.5px; }
.price-now { color: var(--pink); font-weight: 700; font-size: 15px; }
.product-card form { margin-top: 8px; }
.product-card .btn { width: 100%; padding: 9px; font-size: 13.5px; }

/* ---- Forms ---- */
.form-card {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
}
.form-card h2 { text-align: center; margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13.5px; color: var(--text-muted); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
.field textarea { resize: vertical; min-height: 90px; }
.form-note { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-muted); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-error { background: #fdeaea; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #eafaf0; color: #1e8449; border: 1px solid #c8f0d8; }

/* ---- Cart / checkout ---- */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; }
.cart-table th, .cart-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: right; }
.cart-table input[type=number] { width: 65px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
.cart-summary { max-width: 340px; margin-inline-start: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-top: 20px; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14.5px; }
.cart-summary .total { font-weight: 700; color: var(--pink); font-size: 17px; }
.link-btn { background: none; border: none; color: #c0392b; cursor: pointer; font-family: inherit; font-size: 13px; }

/* ---- Footer ---- */
.site-footer { background: #33222a; color: #eadfe4; padding: 30px 0; margin-top: 50px; text-align: center; font-size: 13.5px; }
.site-footer .pink { color: var(--pink); }

/* ---- Admin ---- */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #33222a; color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-sidebar h2 { text-align: center; color: var(--pink); font-size: 20px; margin: 0 0 20px; }
.admin-sidebar a { display: block; padding: 12px 24px; color: #eadfe4; font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-content { flex: 1; padding: 30px; background: #fdf5f8; }
.admin-content h1 { margin-top: 0; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; text-align: right; }
table.admin-table th { background: #f7eef2; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 20px; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #a33025; }
.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

@media (max-width: 640px) {
    .admin-wrap { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .hero-text h1 { font-size: 24px; }
}