/* ============================================
   عطاری سعادت - استایل فرانت‌اند
   ============================================ */

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

:root {
    --primary: #1a5632;
    --primary-light: #237a45;
    --primary-dark: #0f3a20;
    --primary-bg: #f0f7f2;
    --accent: #c8a03e;
    --accent-light: #e8d5a0;
    --danger: #c0392b;
    --success: #27ae60;
    --warning: #f39c12;
    --bg: #fafcfb;
    --bg-alt: #f4f7f5;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.7;
    overflow-x: hidden;
}

a { text-decoration:none; color:inherit; }
img { max-width:100%; height:auto; }

/* === هدر === */
.site-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo .logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26,86,50,0.2);
}

.header-logo .logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(26,86,50,0.2);
    flex-shrink: 0;
}

.header-logo .logo-icon svg { width: 24px; height: 24px; fill: #fff; }

.header-logo h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.header-logo span {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 24px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0 14px 0 40px;
    font-family: inherit;
    font-size: 13px;
    background: var(--bg);
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,50,0.1);
}

.header-search button {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions .cart-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.header-actions .cart-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cart-btn .cart-count {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-phone {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    direction: ltr;
}

/* ناوبری */
.header-nav {
    border-top: 1px solid var(--border);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
}

.header-nav a {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* === محتوا === */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === هیرو === */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    top: -200px;
    left: -200px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('../img/banner.jpg') center/cover no-repeat;
    opacity: 0.15;
}

.hero-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.2);
}

.hero h2 {
    font-size: 40px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    max-width: 520px;
    margin: 0 auto 28px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.hero-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* === دکمه‌ها === */
.btn-site {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-site-primary {
    background: var(--primary);
    color: #fff;
}

.btn-site-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(26,86,50,0.3);
}

.btn-site-white {
    background: #fff;
    color: var(--primary);
}

.btn-site-white:hover {
    background: var(--primary-bg);
}

.btn-site-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-site-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* === بخش‌ها === */
.section {
    padding: 48px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    position: relative;
    padding-right: 16px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.section-header a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* === کارت محصول === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card .card-image {
    height: 200px;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .card-image .placeholder-icon {
    color: var(--text-muted);
    opacity: 0.3;
}

.product-card .card-image .discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.product-card .card-body {
    padding: 16px;
}

.product-card .card-category {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.product-card .card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card .price-current {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}

.product-card .price-old {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card .card-footer {
    padding: 0 16px 16px;
}

.product-card .add-cart-btn {
    width: 100%;
    height: 38px;
    border: 1.5px solid var(--primary);
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.product-card .add-cart-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* === دسته‌بندی‌ها === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.category-card .cat-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.category-card .cat-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.category-card .cat-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.category-card .cat-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* === فوتر === */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255,255,255,0.6);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul a {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}

.footer-col ul a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

/* === وضعیت خالی === */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* === صفحه محصول === */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
}

.product-gallery {
    background: var(--bg-alt);
    border-radius: var(--radius);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.product-info .price {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.product-info .description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 24px;
}

/* === سبد خرید === */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background: var(--bg-alt);
    padding: 12px 16px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
}

.cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.cart-summary {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-top: 20px;
}

/* === فرم === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input {
    width: 100%;
    height: 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,50,0.1);
}

textarea.form-input {
    height: auto;
    min-height: 120px;
    padding: 10px 14px;
    resize: vertical;
}

/* === صفحه‌بندی === */
.site-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.site-pagination a, .site-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
}

.site-pagination a:hover, .site-pagination span.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === ریسپانسیو === */
@media (max-width: 768px) {
    .hero h2 { font-size: 24px; }
    .hero p { font-size: 14px; }
    .header-search { display: none; }
    .header-phone { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
}
