/*
Theme Name: My Gallery Theme
Author: Your Name
Version: 1.4
*/

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #F6E9D2; /* کرم گرم طبیعی */
    color: #2E221C; /* قهوه‌ای چوبی تیره */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   تصویر بالای هدر
========================= */

.top-banner {
    width: 100%;
    height: 80vh; /* 60 درصد ارتفاع صفحه */
    min-height: 250px; /* حداقل ارتفاع */
    max-height: 500px; /* حداکثر ارتفاع */
    overflow: hidden;
}

.top-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (max-width: 768px) {
    .top-banner {
        height: 35vh;
    }
}

/* ========================= */
/* هدر و لوگو */
/* ========================= */
header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* آیتم‌های منو در دو طرف */
    position: relative;             /* برای موقعیت‌دهی absolute لوگو */
    background: url("images/header-bg.jpg") center center / cover no-repeat;
    padding: 10px 20px;
    border-bottom: 4px solid #C9A227;
}

/* لوگو */
.logo {
    flex: 0 0 auto;               /* اندازه ثابت */
    margin: 0 auto;               /* وسط افقی */
}

.logo a {
    color: #C9A227;               /* طلایی لوکس */
    font-size: 24px;
    font-weight: bold;
}

.logo img {
    height: 80px;
    width: auto;
    max-width: 100%;
}

@media (max-width: 768px) {
    .logo img {
        height: 45px;
    }
}

/* ========================= */
/* منوی اصلی */
/* ========================= */
header .main-menu .menu {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    direction: rtl;               
    justify-content: flex-end;    
    text-align: right;
    flex-wrap: wrap; /* آیتم‌ها می‌توانند به خط بعد بروند اگر لازم باشد */
}

.menu li {
    position: relative;
}

.menu a {
    color: #C9A227;               
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
    transition: 0.3s;
    background-color: rgba(46,34,28,1); /* مستطیل نیمه‌شفاف */
}

/* زیرمنو */
.menu li.menu-item-has-children > .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;                     
    background-color: rgba(90,64,50,1); /* کمی تیره‌تر برای زیرمنو */
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 180px;
    z-index: 1000;
    border-radius: 6px;
}

.menu li.menu-item-has-children:hover > .sub-menu {
    display: block;
}

.menu .sub-menu li a {
    padding: 10px 15px;
    font-size: 16px;
    color: #E0B84F;
    background-color: rgba(46,34,28,1);
}

.menu a:hover {
    background-color: rgba(201,162,39,0.8); /* پس‌زمینه کمی روشن‌تر */
    color: #E0B84F; /* متن طلایی روی هاور */               
}

/* ========================= */
/* ریسپانسیو موبایل بدون دکمه همبرگری */
/* ========================= */
@media (max-width: 768px) {

    header {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .main-menu {
        position: relative;
        display: flex;
        flex-wrap: wrap;         
        gap: 10px;
        justify-content: flex-end;
        padding: 10px 0;
        z-index: 999;
    }

    .main-menu .menu {
        display: flex;
        flex-wrap: wrap;         
        gap: 10px;
        justify-content: flex-end;
        padding: 0 10px;
    }

    .main-menu .menu li {
        width: auto;
    }

    .main-menu .menu a {
        border-radius: 5px;
        border-bottom: none;
        padding: 8px 12px;
        font-size: 16px;
        background-color: rgba(46,34,28,1); /* مستطیل نیمه‌شفاف */
    }
}

/* ========================= */
/* نوار کاربر */
/* ========================= */
.user-menu {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.user-menu li a {
    color: #C9A227;
    font-weight: bold;
    text-decoration: none;
    padding: 8px 12px;
    background-color: #2E221C;
    border-radius: 5px;
    transition: 0.3s;
}

.user-menu li a:hover {
    background-color: #C9A227;
    color: #2E221C;
}


/* ========================= */
/* گرید محصولات و دسته‌ها */
/* ========================= */
.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
    gap: 20px;
    justify-content: center; /* وسط چین وقتی محصول کم است */
    margin: 20px 0;
    padding: 0;
}

.product-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 0;
}


/* ========================= */
/* کارت محصول و دسته‌ها */
/* ========================= */
.product-item, .category-item {
    background-color: #5A4032; /* چوب متوسط گرم */
    border: 1px solid #2E221C; /* چوب تیره */
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    color: #E0B84F; /* متن طلایی ملایم */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

/* لینک داخل کارت */
.product-item a, .category-item a {
    color: #E0B84F; /* طلایی */
    font-weight: bold;
    font-size: 16px;
}

/* تصویر داخل کارت */
.product-item img, .category-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* عنوان محصول */
.product-item h3 {
    font-size: 18px;
    margin: 10px 0 5px;
}

/* توضیحات کوتاه و وزن */
.product-item .product-description,
.product-item p {
    font-size: 14px;
    color: #E0B84F; /* طلایی */
    margin: 5px 0;
}

/* افکت هاور کارت */
.product-item:hover, .category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    background-color: #2E221C; /* چوب تیره‌تر */
}

/* ========================= */
/* ریسپانسیو موبایل */
/* ========================= */
@media (max-width: 768px) {
    .products-list {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .product-categories {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .menu > ul {
        flex-direction: column;
        gap: 0;
    }

    .menu a {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .products-list, .product-categories {
        grid-template-columns: 1fr;
    }
}


/* ========================= */
/* صفحه لاگ این */
/* ========================= */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #5A4032; /* چوب متوسط */
    border-radius: 10px;
    text-align: center;
    color: #E0B84F; /* طلایی */
}

.login-container h2 {
    margin-bottom: 20px;
    color: #E0B84F;
}

.login-container .login input[type="text"],
.login-container .login input[type="password"] {
    padding: 10px;
    border: 1px solid #2E221C;
    border-radius: 5px;
    width: 100%;
}

.login-container .login input[type="submit"] {
    padding: 10px;
    background-color: #C9A227; /* طلایی لوکس */
    color: #2E221C;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.login-container .login input[type="submit"]:hover {
    background-color: #E0B84F; /* طلایی روشن‌تر */
}


/* =====================
   صفحه مشتریان
===================== */

.users-page {
    text-align: center;
}

.users-table-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.users-table {
    width: 60%;
    max-width: 600px;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.users-table thead {
    background: #3B2F2F;
    color: #fff;
}

.users-table th,
.users-table td {
    padding: 15px;
}

.users-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: 0.3s;
}

.users-table tbody tr:hover {
    background: #FFF5E1;
}

.main-menu a[href$="/customer/"] {
    display: none !important;
}

/* =====================
   صفحه پروفایل مشتری
===================== */

.users-profile-page {
    text-align: center;
}

.payments-wrapper {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center; /* وسط چین */
}

/* کارت پرداخت */
.payment-card {
    width: 50%;
    max-width: 700px;
    background-color: #4E3A33;
    border: 1px solid #3B2F2F;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    color: #F1CE36;
    text-align: right;
    transition: 0.3s;
}

.payment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    background-color: #3B2F2F;
}

/* خط اول */
.payment-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
}

.payment-amount {
    font-size: 18px;
}

.payment-date {
    font-size: 13px;
    opacity: 0.8;
}

/* توضیحات */
.payment-description {
    line-height: 1.9;
    margin-bottom: 10px;
    word-break: break-word;
}

/* عملیات */
.payment-actions a {
    font-size: 14px;
    color: #F1CE36;
}

.payment-actions a:hover {
    text-decoration: underline;
}

.delete-link {
    color: #ff6b6b !important;
}

/* فرم پرداخت */
.payment-form {
    width: 50%;
    max-width: 700px;
    margin: 0 auto;
}

.payment-form input,
.payment-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #3B2F2F;
}

.no-payment {
    margin-top: 20px;
    color: #3B2F2F;
    font-weight: bold;
}

/* ریسپانسیو */
@media (max-width: 768px) {

    .payment-card,
    .payment-form {
        width: 90%;
    }

}

/* =========================
   دکمه باز کردن فرم
========================= */

.toggle-btn {
    background-color: #F1CE36;
    color: #3B2F2F;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin: 20px auto;
    display: block;
    transition: 0.3s;
}

.toggle-btn:hover {
    background-color: #D4AF37;
}

/* مخفی بودن فرم */
.hidden-form {
    display: none;
}

/* =========================
   جدول دارایی
========================= */

.purchases-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
}

.purchase-card {
    width: 50%;
    max-width: 700px;
    background-color: #4E3A33;
    border: 1px solid #3B2F2F;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    color: #F1CE36;
    text-align: right;
    transition: 0.3s;
}

.purchase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    background-color: #3B2F2F;
}

.purchase-top {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 8px;
}

.purchase-actions a {
    font-size: 14px;
    margin-left: 10px;
}

.delete-link {
    color: #ff6b6b !important;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .purchase-card,
    .payment-card,
    .payment-form {
        width: 90%;
    }
}

/* =========================
   دکمه‌ها و select فرم‌ها
========================= */

/* دکمه ثبت خرید / ثبت پرداخت */
.payment-form button,
.toggle-btn {
    background: linear-gradient(145deg, #F1CE36, #D4AF37);
    color: #2E221C;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* هاور دکمه‌ها */
.payment-form button:hover,
.toggle-btn:hover {
    background: linear-gradient(145deg, #D4AF37, #F1CE36);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* select دسته‌بندی و محصول */
.payment-form select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #3B2F2F;
    background-color: #4E3A33;
    color: #F1CE36;
    font-size: 15px;
    font-weight: bold;
    appearance: none; /* حذف فلش پیشفرض مرورگر */
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-bottom: 12px;
}

/* هاور روی select */
.payment-form select:hover {
    background-color: #5A4032;
    transform: translateY(-1px);
}

/* فلش سفارشی select */
.payment-form select::-ms-expand {
    display: none; /* حذف فلش در IE/Edge */
}

/* فرم‌ها و input ها */
.payment-form input,
.payment-form textarea {
    background-color: #4E3A33;
    border: 1px solid #3B2F2F;
    color: #F1CE36;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    margin-bottom: 12px;
    transition: box-shadow 0.3s, transform 0.2s;
}

/* focus روی input و textarea */
.payment-form input:focus,
.payment-form textarea:focus,
.payment-form select:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(241,206,54,0.7);
    transform: translateY(-1px);
}


/* ******************************************* */
/* =========================
           footer
========================= */
.site-footer {
    background-color: #3B2F2F; /* رنگ پس‌زمینه فوتر */
    color: #F1CE36;            /* رنگ متن */
    padding: 20px;
    text-align: center;         /* وسط چین متن */
    font-family: sans-serif;
    width: 100%;
    justify-content: center;   /* وسط افقی */
    align-items: center;       /* وسط عمودی */
    display: flex;

}

.footer-contact {
    padding-left: 15%;
}

.site-footer .footer-contact p {
    margin: 5px 0;             /* فاصله بین خطوط */
    font-size: 16px;
}

.site-footer .footer-contact a {
    color: #F1CE36;            /* رنگ لینک تماس */
    text-decoration: none;
}

.site-footer .footer-contact a:hover {
    text-decoration: underline; /* هاور روی شماره تماس */
}

/* ریسپانسیو موبایل */
@media (max-width: 600px) {
    .site-footer .footer-contact p {
        font-size: 14px;
    }
}
/* ******************************************* */

/* =========================
    جدول قیمت طلا در صفحه خانه
========================= */
.gold-prices-table-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.gold-prices-table {
    width: 80%;
    max-width: 700px;
    border-collapse: collapse;
    background-color: #5A4032; /* چوب متوسط */
    color: #F1CE36;             /* طلایی */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gold-prices-table thead {
    background-color: #3B2F2F; /* چوب تیره */
    font-weight: bold;
    text-align: right;
}

.gold-prices-table th,
.gold-prices-table td {
    padding: 15px 20px;
    text-align: center;      /* وسط‌چین افقی */
    vertical-align: middle;  /* وسط‌چین عمودی */
}

.gold-prices-table tbody tr {
    border-bottom: 1px solid rgba(241,206,54,0.3);
    transition: 0.3s;
}

.gold-prices-table tbody tr:hover {
    background-color: #2E221C; /* چوب تیره‌تر هنگام هاور */
    color: #C9A227;
}

.gold-prices-table td:first-child {
    font-weight: bold;
}

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .gold-prices-table {
        width: 95%;
    }
}

.date-input-wrapper {
    position: relative;
    display: inline-block;
}

.calendar-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
}

.content {
    flex: 1;
}