/* styles.css */
body {
    font-family: 'Yekan', 'Tahoma', sans-serif;
    direction: rtl;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    width: 1200px;
    margin: 0 auto;
}

.header {
    background-color: #424750;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #555;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.search-box {
    width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
}

.search-box button {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border: none;
    background: #ef394e;
    color: white;
    padding: 0 15px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
}

.user-menu a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
}

.navbar {
    display: flex;
    background-color: #ef394e;
    padding: 10px 0;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 0 15px;
}

.main {
    display: flex;
    margin-top: 20px;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-left: 20px;
}

.content {
    flex: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
}

.product-info {
    padding: 15px;
    border-top: 1px solid #eee;
}

.product-title {
    font-size: 14px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
}

.product-price {
    color: #ef394e;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-primary {
    background-color: #ef394e;
    color: white;
}

.btn-outline {
    background: none;
    border: 1px solid #ef394e;
    color: #ef394e;
}

.footer {
    background-color: #424750;
    color: white;
    padding: 30px 0;
    margin-top: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

.footer-section {
    width: 30%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-group textarea {
    height: 100px;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-left: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .header-top {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
        margin: 10px 0;
    }
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

/* استایل جدول پیام‌ها */
table.contact-messages {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table.contact-messages th, 
table.contact-messages td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: right;
}

table.contact-messages th {
    background-color: #f2f2f2;
}

table.contact-messages tr:nth-child(even) {
    background-color: #f9f9f9;
}

table.contact-messages tr:hover {
    background-color: #f1f1f1;
}
/* استایل‌های مدیریت سفارشات */
.order-list {
    margin-top: 20px;
}

.order-card {
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.order-id {
    font-weight: bold;
}

.order-date {
    color: #666;
}

.order-status {
    padding: 5px 10px;
    border-radius: 3px;
    color: white;
    font-weight: bold;
}

.status-0 { background-color: #ffc107; color: #000; } /* تحت بررسی */
.status-1 { background-color: #17a2b8; } /* آماده ارسال */
.status-2 { background-color: #28a745; } /* ارسال شده */
.status-3 { background-color: #dc3545; } /* لغو شده */

.order-details {
    display: flex;
    padding: 15px;
}

.customer-info, .product-info {
    flex: 1;
    padding: 0 10px;
}

.order-actions {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.status-select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-left: 10px;
}

.no-orders {
    text-align: center;
    padding: 20px;
    color: #666;
}
/* استایل‌های جستجو */
.search-box {
    width: 500px;
    position: relative;
}

.search-box form {
    display: flex;
}

.search-box input {
    width: 100%;
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: 'Yekan', 'Tahoma', sans-serif;
}

.search-box button {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border: none;
    background: #ef394e;
    color: white;
    padding: 0 15px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
}

.search-box button:hover {
    background: #d62b3e;
}

.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.no-results p {
    color: #666;
    font-size: 18px;
}

/* استایل‌های سبد خرید */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.cart-table th, .cart-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.cart-table th {
    background-color: #f5f5f5;
}

.product-info {
    display: flex;
    align-items: center;
    text-align: right;
}

.product-info img {
    margin-left: 15px;
}

.product-info div {
    flex: 1;
}

.cart-table input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: center;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.empty-cart {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-cart p {
    margin-bottom: 20px;
    font-size: 18px;
}

/* استایل‌های صفحه پرداخت */
.checkout-page {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.order-summary {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.checkout-form {
    flex: 2;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Yekan', 'Tahoma', sans-serif;
}

.form-group textarea {
    height: 100px;
}

/* استایل صفحه تکمیل سفارش */
.order-complete {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.success-icon {
    color: #28a745;
    font-size: 60px;
    margin-bottom: 20px;
}

.order-complete h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.order-complete .actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* استایل‌های جدید برای مدیریت سفارشات */
.admin-orders {
    margin-top: 20px;
}

.order-card {
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.order-body {
    display: flex;
    padding: 15px;
    flex-wrap: wrap;
}

.order-info, .payment-info, .shipping-info {
    flex: 1;
    min-width: 300px;
    padding: 10px;
}

.payment-info {
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
}

.payment-status-form {
    margin-top: 10px;
}

.payment-status-form select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.order-actions {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.status-select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-left: 10px;
}

/* استایل‌های وضعیت پرداخت */
.payment-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.payment-pending { background-color: #ffc107; color: #000; }
.payment-paid { background-color: #28a745; color: #fff; }
.payment-failed { background-color: #dc3545; color: #fff; }
.payment-refunded { background-color: #6c757d; color: #fff; }

/* اضافه کردن این استایل‌ها به فایل CSS */
.product-title {
    font-size: 14px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.product-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-price {
    margin: 8px 0;
}
/* استایل‌های جدید برای بخش امتیازات */
.product-rating-summary {
    margin: 15px 0;
}

.average-rating {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.rating-value {
    font-size: 24px;
    font-weight: bold;
    margin-left: 5px;
}

.stars {
    color: #ddd;
    font-size: 20px;
    position: relative;
    display: inline-block;
}

.star {
    position: relative;
    display: inline-block;
}

.star.full {
    color: #ffc107;
}

.star.half {
    color: #ffc107;
    position: relative;
}

.star.half:before {
    content: '★';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
}

.total-reviews {
    font-size: 14px;
    color: #666;
    margin-right: 10px;
}

.rating-summary {
    margin: 20px 0;
}

.rating-bars {
    width: 100%;
    max-width: 400px;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-bar .stars {
    width: 80px;
    color: #ffc107;
    font-size: 16px;
}

.bar-container {
    flex-grow: 1;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin: 0 10px;
    overflow: hidden;
}

.bar-container .bar {
    height: 100%;
    background: #ffc107;
    border-radius: 5px;
}

.rating-bar .count {
    width: 30px;
    text-align: left;
    font-size: 14px;
    color: #666;
}
.no-ratings {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}
/* استایل‌های بخش نظرات محصول */
.product-reviews {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.product-reviews h3 {
    color: #424750;
    border-bottom: 2px solid #ef394e;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* استایل فرم ثبت نظر */
.add-review {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.add-review h4 {
    color: #424750;
    margin-bottom: 15px;
}

/* استایل ستاره‌های امتیازدهی */
.rating-stars {
    direction: ltr;
    display: inline-block;
    margin-bottom: 15px;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    float: right;
    padding: 0 5px;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-stars input:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: #ffc107;
}

/* استایل لیست نظرات */
.reviews-list {
    margin-top: 20px;
}

.review-item {
    padding: 15px;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #ef394e;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.review-author {
    font-weight: bold;
    color: #424750;
}

.review-date {
    color: #666;
    font-size: 0.9em;
}

.review-rating {
    color: #ffc107;
    font-size: 16px;
    margin: 5px 0;
}

.review-content {
    line-height: 1.6;
    color: #333;
    padding: 10px 0;
}

.no-reviews {
    text-align: center;
    color: #666;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

/* استایل‌های واکنش‌گرا برای بخش نظرات */
@media (max-width: 768px) {
    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-date {
        margin-top: 5px;
    }
    
    .add-review {
        padding: 15px;
    }
}

/* استایل‌های پیشرفته برای نمایش امتیازات */
.rating-distribution {
    margin: 20px 0;
}

.rating-distribution h4 {
    margin-bottom: 15px;
    color: #424750;
}

.rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-stars-label {
    width: 80px;
    color: #ffc107;
}

.rating-bar-bg {
    flex-grow: 1;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin: 0 10px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: #ffc107;
    border-radius: 5px;
}

.rating-count {
    width: 40px;
    text-align: left;
    color: #666;
}

/* استایل‌های پیام‌ها و وضعیت‌ها */
.alert-message {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* استایل دکمه‌ها در بخش نظرات */
.btn-review {
    padding: 8px 20px;
    background: #ef394e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-review:hover {
    background: #d62b3e;
}

/* استایل textarea برای نظر */
.review-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Yekan', 'Tahoma', sans-serif;
    min-height: 100px;
    resize: vertical;
}

/* استایل گروه‌های فرم */
.form-group-review {
    margin-bottom: 15px;
}

.form-group-review label {
    display: block;
    margin-bottom: 5px;
    color: #424750;
    font-weight: bold;
}
/* استایل مخصوص ستاره‌های امتیازدهی در فرم */
.rating-stars {
    direction: ltr;
    display: inline-block;
    unicode-bidi: bidi-override;
    margin-bottom: 15px;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    float: right;
    padding: 0 5px;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-stars input:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: #ffc107;
}

.rating-stars input:checked + label {
    color: #ffc107;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: #ffc107;
}

/* استایل ستاره‌های نمایش امتیاز در نظرات */
.review-rating {
    direction: ltr;
    display: inline-block;
    unicode-bidi: bidi-override;
}

.review-rating .star {
    font-size: 16px;
    color: #ddd;
    display: inline-block;
    position: relative;
}

.review-rating .star.filled {
    color: #ffc107;
}

/* سیستم امتیازدهی نیم ستاره */
.rating-stars-half {
    direction: ltr;
    display: inline-block;
    unicode-bidi: bidi-override;
    position: relative;
    font-size: 24px;
}

.rating-stars-half input {
    display: none;
}

.rating-stars-half label {
    float: right;
    width: 0.5em;
    height: 1em;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.rating-stars-half label.half:before,
.rating-stars-half label.full:before {
    content: "★";
    position: absolute;
    color: #ddd;
}

.rating-stars-half label.full:before {
    right: 0;
}

.rating-stars-half label.half:before {
    width: 50%;
    right: 0;
    overflow: hidden;
}

.rating-stars-half input:checked ~ label.half:before,
.rating-stars-half input:checked ~ label.full:before,
.rating-stars-half label:hover ~ label.half:before,
.rating-stars-half label:hover ~ label.full:before,
.rating-stars-half input:checked + label.half:before,
.rating-stars-half input:checked + label.full:before,
.rating-stars-half label:hover:before {
    color: #ffc107;
}
