/* =================== */
/* استایل کلی صفحه */
/* =================== */
body {
    font-family: "iransans", Tahoma, sans-serif;
    background: #f5f7fa;
    color: #333;
}

h1, h2 {
    color: #222;
    margin-bottom: 15px;
}

hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 25px 0;
}

/* =================== */
/* فرم افزودن محصول */
/* =================== */
form {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

form input, form textarea, form button {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

form button {
    background: #0073aa;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

form button:hover {
    background: #005177;
}

/* =================== */
/* جدول خلاصه محصولات */
/* =================== */
table.widefat {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

table.widefat th, table.widefat td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

table.widefat th {
    background: #f0f4f8;
    color: #333;
}

table.widefat tr:hover {
    background: #f9f9f9;
}

table.widefat a {
    color: #d63626;
    text-decoration: none;
}

table.widefat a:hover {
    text-decoration: underline;
}

/* =================== */
/* کارت‌های محصولات */
/* =================== */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-card {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    width: calc(50% - 10px); /* دو کارت در هر سطر */
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.product-card-left {
    width: 150px;
    margin-right: 20px;
}

.product-card-left img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.product-card-right {
    flex: 1;
}

.product-card-right h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.product-card-right p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.product-details {
    margin-top: 12px;
    padding: 10px;
    background: #f0f4f8;
    border-radius: 8px;
}

.product-details p {
    margin: 4px 0;
}

/* =================== */
/* واکنش‌گرایی موبایل */
/* =================== */
@media (max-width: 900px) {
    .product-card {
        width: 100%;
        flex-direction: row;
    }
}

@media (max-width: 600px) {
    form input, form textarea, form button {
        font-size: 13px;
    }

    .product-card-left {
        width: 100px;
        margin-right: 12px;
    }

    .product-card-left img {
        width: 100px;
        height: 100px;
    }

    .product-card-right h3 {
        font-size: 16px;
    }

    .product-card-right p, .product-details p {
        font-size: 13px;
    }
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    width: calc(25% - 15px); /* 4 کارت در یک ردیف */
    padding: 12px;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-card h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #333;
}

.product-card p {
    margin: 4px 0;
    font-size: 13px;
    color: #555;
}

.product-details {
    margin-top: 8px;
    padding: 6px;
    background: #f0f4f8;
    border-radius: 6px;
}

/* واکنش‌گرایی */
@media (max-width: 1100px) {
    .product-card { width: calc(33.33% - 15px); } /* 3 کارت */
}

@media (max-width: 800px) {
    .product-card { width: calc(50% - 15px); } /* 2 کارت */
}

@media (max-width: 500px) {
    .product-card { width: 100%; } /* 1 کارت */
}



.modern-product-form {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* input و textarea */
.modern-product-form input,
.modern-product-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modern-product-form input:focus,
.modern-product-form textarea:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 6px rgba(0,115,230,0.3);
}

/* textarea بزرگتر */
.modern-product-form textarea {
    resize: vertical;
    min-height: 60px;
    grid-column: span 2; /* تمام عرض فرم */
}

/* دکمه */
.modern-product-form button {
    grid-column: span 2; /* تمام عرض فرم */
    padding: 12px;
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.modern-product-form button:hover {
    background: #005bb5;
    transform: translateY(-2px);
}

/* ریسپانسیو موبایل */
@media (max-width: 600px) {
    .modern-product-form {
        grid-template-columns: 1fr;
    }
}
