/* فروشگاه عقیق — RTL minimal (Digikala-inspired) */

:root {
    --primary: #ef394e;
    --primary-dark: #d32f42;
    --text: #3f4064;
    --text-muted: #81858b;
    --border: #e0e0e6;
    --bg: #f5f5f5;
    --white: #fff;
    --success: #00a049;
    --warning: #f9a825;
    --radius: 8px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

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

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo span { color: var(--text); font-weight: 400; }

.search-form {
    flex: 1;
    min-width: 200px;
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.search-form input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-form button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 18px;
    cursor: pointer;
    font-family: inherit;
}

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

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.header-link:hover { background: var(--bg); }

.cart-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Main */
.site-main { min-height: 60vh; padding: 24px 0; }

/* Footer */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 32px 0 16px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.footer-title {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1rem;
}

.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* Cards & Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-card-image {
    aspect-ratio: 1;
    background: var(--bg);
    overflow: hidden;
}

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

.product-card-image img.product-image-placeholder,
.product-gallery-main img.product-image-placeholder {
    object-fit: contain;
    padding: 16px;
    background: var(--bg);
}

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

.product-card-title {
    font-size: 0.9rem;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.product-price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-left: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sold { background: #eee; color: var(--text-muted); }
.badge-sale { background: var(--primary); color: var(--white); }

/* Section */
.section { margin-bottom: 32px; }

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #fff 0%, #fce4ec 100%);
    border-radius: var(--radius);
    padding: 40px 32px;
    margin-bottom: 32px;
    text-align: center;
}

.hero h1 { font-size: 1.8rem; margin: 0 0 12px; }
.hero p { color: var(--text-muted); margin: 0 0 20px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    text-align: center;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--white); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-success { background: var(--success); color: var(--white); }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.15);
}

.form-error { color: var(--primary); font-size: 0.85rem; margin-top: 4px; }

/* Panel / Card box */
.box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.box-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.product-gallery-main {
    aspect-ratio: 1;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.product-info h1 { font-size: 1.4rem; margin: 0 0 12px; }
.product-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.product-specs { margin: 20px 0; }
.product-specs dt { font-weight: 600; margin-top: 8px; }
.product-specs dd { margin: 4px 0 0; color: var(--text-muted); }

/* Table */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data-table th,
table.data-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    background: var(--bg);
    font-weight: 600;
}

table.data-table tr:hover td { background: #fafafa; }

/* Cart */
.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-summary {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-summary-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

/* Checkout steps */
.checkout-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.checkout-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px;
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.checkout-step.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Account layout */
.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.account-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.account-sidebar-nav a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.account-sidebar-nav a:hover,
.account-sidebar-nav a.active {
    background: #fce4ec;
    color: var(--primary);
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 16px; }

/* Blog */
.post-list-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.post-list-item h2 { margin: 0 0 8px; font-size: 1.1rem; }
.post-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Invoice */
.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .search-form { order: 3; width: 100%; }
    .header-actions { justify-content: center; }
    .product-detail { grid-template-columns: 1fr; }
    .account-layout { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

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