:root {
    --primary-color: #1c2a3a;
    --secondary-color: #f9ab03;
    --primary-soft: #2d435c;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1c2a3a;
    --light-color: #f8fafc;
    --gray-color: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(28, 42, 58, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(28, 42, 58, 0.15);
}

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

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    font-size: 16.5px;
    line-height: 1.7;
    background-color: var(--light-color);
    color: var(--dark-color);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: linear-gradient(135deg, #ffffff, #eef3f8);
    border-bottom: 3px solid rgba(249, 171, 3, 0.5);
    padding: 0.85rem 2rem;
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-logo {
    height: 80px;
    width: auto;
    background: white;
    padding: 0.35rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(28, 42, 58, 0.12);
    box-shadow: 0 8px 20px -12px rgba(28, 42, 58, 0.45);
}

.navbar-nav .nav-link {
    color: var(--primary-color) !important;
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
    transform: translateY(-2px);
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-soft));
    color: white;
    padding: 3rem 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 4.4vw, 2.8rem);
    line-height: 1.35;
    margin-bottom: 1rem;
}

h1,
h2,
h3 {
    font-weight: 800;
    line-height: 1.4;
}

.search-box {
    max-width: 600px;
    margin: 2rem auto 0;
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-box button {
    padding: 0.75rem 1.5rem;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background-color: #334155;
    transform: translateY(-2px);
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-info .price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-info .category {
    font-size: 0.95rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.82rem 1.65rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-soft));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--primary-soft), var(--primary-color));
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.phone-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    padding: 1rem;
    background: var(--light-color);
    border-radius: 0.5rem;
    margin: 1rem 0;
    direction: ltr;
}

.copy-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: #16a34a;
}

.close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.page-title {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    margin-bottom: 2rem;
    color: var(--dark-color);
    text-align: center;
}

.item-detail {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.item-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    font-size: 5rem;
}

.item-info {
    padding: 2rem;
}

.item-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.item-info .price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.item-info .description {
    color: var(--gray-color);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.item-info .stock {
    margin-bottom: 1.5rem;
}

.item-info .stock.in-stock {
    color: var(--success-color);
}

.item-info .stock.out-of-stock {
    color: var(--danger-color);
}

.admin-table {
    width: 100%;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.admin-table th {
    background-color: var(--light-color);
    font-weight: bold;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.login-form {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.flash-messages {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-color);
}

.empty-state svg {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.7rem 1rem;
    }

    .navbar-brand {
        font-size: 1.05rem;
    }

    .brand-logo {
        height: 60px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .search-box {
        flex-direction: column;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}
