/*
 * Ashrafi Gallery - Custom WooCommerce My Account Styles
 * Version: 1.0
 */

/* --- CSS Variables for Easy Theming --- */
:root {
    --ashrafi-primary-color: #bfa888;
    /* A sophisticated gold/bronze */
    --ashrafi-secondary-color: #2c2c2c;
    /* Dark charcoal for text and borders */
    --ashrafi-background-color: #f9f9f9;
    /* Light grey background */
    --ashrafi-card-background: #ffffff;
    /* White for cards */
    --ashrafi-text-color: #333333;
    --ashrafi-subtle-text-color: #777777;
    --ashrafi-border-color: #e0e0e0;
    --ashrafi-success-color: #28a745;
    --ashrafi-error-color: #dc3545;
    --ashrafi-border-radius: 8px;
    --ashrafi-box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* --- General Layout --- */
.woocommerce-account .woocommerce {
    padding: 20px;
}

.woocommerce-MyAccount-content {
    width: 100%;
}

.ashrafi-dashboard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* --- Navigation Menu --- */
.woocommerce-MyAccount-navigation {
    flex: 1;
    min-width: 220px;
    max-width: 100%;
    /* For mobile */
    background: var(--ashrafi-card-background);
    border-radius: var(--ashrafi-border-radius);
    box-shadow: var(--ashrafi-box-shadow);
    padding: 15px;
    height: fit-content;
}

.woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-MyAccount-navigation ul li {
    margin-bottom: 5px;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 12px 18px;
    color: var(--ashrafi-secondary-color);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: var(--ashrafi-background-color);
    color: var(--ashrafi-primary-color);
}

.woocommerce-MyAccount-navigation ul li.is-active>a {
    background-color: var(--ashrafi-background-color);
    color: var(--ashrafi-primary-color);
    border-left: 3px solid var(--ashrafi-primary-color);
    font-weight: 700;
}

/* --- Main Content Area & Cards --- */
.ashrafi-dashboard-content {
    flex: 3;
    min-width: 300px;
}

.ashrafi-card {
    background: var(--ashrafi-card-background);
    border-radius: var(--ashrafi-border-radius);
    box-shadow: var(--ashrafi-box-shadow);
    padding: 25px 30px;
    margin-bottom: 30px;
}

.ashrafi-card h2,
.ashrafi-card h3 {
    margin-top: 0;
    font-size: 19px;
    color: var(--ashrafi-secondary-color);
    border-bottom: 1px solid var(--ashrafi-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* --- Forms --- */
.ashrafi-card form .form-row,
.ashrafi-card form p {
    margin-bottom: 20px;
}

.ashrafi-card label {
    font-weight: 600;
    color: var(--ashrafi-text-color);
    display: block;
    margin-bottom: 8px;
}

.ashrafi-card .required {
    color: var(--ashrafi-primary-color);
}

.ashrafi-card input[type="text"],
.ashrafi-card input[type="email"],
.ashrafi-card input[type="password"],
.ashrafi-card input[type="tel"],
.ashrafi-card select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ashrafi-border-color);
    border-radius: 6px;
    transition: border-color 0.3s ease;
    background-color: #fdfdfd;
}

.ashrafi-card input:focus {
    border-color: var(--ashrafi-primary-color);
    box-shadow: 0 0 0 2px rgba(191, 168, 136, 0.2);
    outline: none;
}

.ashrafi-card .button {
    background-color: var(--ashrafi-secondary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ashrafi-card .button:hover {
    background-color: var(--ashrafi-primary-color);
    color: #fff;
}

/* --- Orders Table --- */
.ashrafi-card .shop_table_responsive {
    border: none;
    box-shadow: none;
    place-self: center;
    width: 100%;
}

.ashrafi-card .shop_table_responsive thead {
    display: none;
}

.ashrafi-card .shop_table_responsive tbody tr {
    display: block;
    margin-bottom: 25px;
    border: 1px solid var(--ashrafi-border-color);
    border-radius: var(--ashrafi-border-radius);
    padding: 15px;
}

.ashrafi-card .shop_table_responsive tbody td {
    display: flex;
    gap: 10px;
    white-space: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: none;
    text-align: right;
}

.ashrafi-card .shop_table_responsive tbody td::before {
    content: attr(data-title) ':';
    font-weight: 600;
    margin-right: 10px;
    text-align: left;
    /* Farsi Left Align for title */
}

.ashrafi-card .shop_table_responsive .order-actions .button {
    font-size: 12px;
    padding: 8px 12px;
}

/* Desktop view for tables */
@media (min-width: 768px) {
    .ashrafi-card .shop_table_responsive thead {
        display: table-header-group;
    }

    .ashrafi-card .shop_table_responsive tbody tr {
        display: table-row;
        border: none;
        padding: 0;
        margin-bottom: 0;
    }

    .ashrafi-card .shop_table_responsive tbody td {
        display: table-cell;
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid var(--ashrafi-border-color);
    }

    .ashrafi-card .shop_table_responsive tbody td::before {
        display: none;
    }

}


/* --- Address Section --- */
.woocommerce-Addresses {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.woocommerce-Address {
    flex: 1;
    min-width: 280px;
}

.woocommerce-Address-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ashrafi-border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.woocommerce-Address-title .edit {
    font-size: 14px;
    font-weight: normal;
    text-decoration: none;
    color: var(--ashrafi-primary-color);
}

.woocommerce-Address address {
    font-style: normal;
    line-height: 1.8;
    color: var(--ashrafi-subtle-text-color);
}

.woocommerce-Address address p {
    margin: 0;
}

/*
 * Ashrafi Gallery - Custom Dashboard V2 CSS
 * Elegant, Responsive, and Brand-Aligned
 */

:root {
    /* New Brand Color Palette */
    --ashrafi-dark-brown: #525252;
    /* A rich, deep brown for text/headers */
    --ashrafi-medium-brown: #4b4b4b;
    /* A softer brown for accents/links */
    --ashrafi-light-brown: #D7CCC8;
    /* A light, warm beige for borders */
    --ashrafi-background: #F8F6F5;
    /* A very light, elegant off-white/beige */
    --ashrafi-card-background: #FFFFFF;
    --ashrafi-font: 'IRANSansX', 'Vazirmatn', sans-serif;
    /* Your preferred font */
}


.dashboard-header {
    text-align: center;
    padding: 10px 10px 30px 10px;
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin: 0 0 10px 0;
}

.dashboard-header p {
    font-size: 16px;
    color: var(--ashrafi-medium-brown);
    margin: 0;
}

/* Stats Grid - Fully Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--ashrafi-card-background);
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.08);
    border-color: var(--ashrafi-medium-brown);
}

.card-icon {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.card-icon i {
    font-size: 19px;
}

.card-content p {
    margin: 0;
}

.card-content .value {
    font-size: 19px;
    font-weight: 700;
    color: var(--ashrafi-dark-brown);
}

.card-content .label {
    font-size: 14px;
    color: var(--ashrafi-medium-brown);
}

/* Panels for Quick Links & Recent Orders */
.dashboard-panel {
    background-color: var(--ashrafi-card-background);
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 30px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ashrafi-light-brown);
}

/* Quick Links - Responsive */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    background-color: var(--ashrafi-background);
    color: var(--ashrafi-medium-brown);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-link:hover {
    background-color: var(--ashrafi-dark-brown);
    color: white;
}

.quick-link i {
    font-size: 16px;
}

.quick-link.shop-link {
    background-color: var(--ashrafi-medium-brown);
    color: white;
}

.quick-link.shop-link:hover {
    background-color: var(--ashrafi-dark-brown);
}

/* Recent Orders Table - FULLY RESPONSIVE */
.recent-orders-wrapper {
    overflow-x: auto;
}

.shop_table.recent_orders {
    width: 100%;
    border-collapse: collapse;
}

.recent_orders .order-row {
    transition: background-color 0.2s ease;
}

.recent_orders .order-row:hover {
    background-color: var(--ashrafi-background);
}

.recent_orders td {
    padding: 18px 10px;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--ashrafi-light-brown);
}

.recent_orders .order-row:last-child td {
    border-bottom: none;
}

.recent_orders .order-number a {
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    text-decoration: none;
}

.recent_orders .order-status .status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background-color: #eee;
    color: #555;
}

.recent_orders .order-status .status-completed {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.recent_orders .order-status .status-processing {
    background-color: #bbdefb;
    color: #1565c0;
}

.recent_orders .order-status .status-on-hold {
    background-color: #fff9c4;
    color: #f57f17;
}

/* Mobile View for Table */
@media screen and (max-width: 768px) {
    .recent_orders thead {
        display: none;
    }

    .recent_orders tr.order-row {
        display: block;
        margin-bottom: 20px;
        border: 1px solid var(--ashrafi-light-brown);
        border-radius: 8px;
        padding: 10px;
    }

    .recent_orders td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 12px 5px;
        border-bottom: 1px dashed #eee;
    }

    .recent_orders td:last-child {
        border-bottom: none;
    }

    .recent_orders td::before {
        content: attr(data-title);
        font-weight: 600;
        color: var(--ashrafi-dark-brown);
    }

    .recent_orders .order-actions .button {
        width: 100%;
        text-align: center;
    }
}


/*
 * Ashrafi Gallery - Custom View Order Page V2 CSS
 */

.ashrafi-view-order .dashboard-panel {
    margin-bottom: 30px;
}

/* --- Order Header Panel --- */
.order-header-panel {
    background-color: var(--ashrafi-background);
    padding: 25px 30px;
}

.header-main-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.order-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin: 0;
}

.header-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    font-size: 14px;
    color: var(--ashrafi-medium-brown);
}

.header-meta-info strong {
    color: var(--ashrafi-dark-brown);
    font-weight: 600;
}


/* --- Order Items List (Table-less) --- */
.order-items-list {
    border-bottom: 1px solid var(--ashrafi-light-brown);
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid var(--ashrafi-background);
}

.order-item:last-child {
    border-bottom: none;
}

.item-image img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ashrafi-light-brown);
}

.item-details {
    flex-grow: 1;
}

.item-details .item-name {
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin: 0 0 5px 0;
    text-decoration: none;
}

.item-details .item-quantity {
    font-size: 14px;
    color: var(--ashrafi-medium-brown);
    margin: 5px 0 0 0;
}

.item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    min-width: 100px;
    text-align: left;
}

/* --- Order Totals --- */
.order-totals {
    max-width: 400px;
    margin-right: auto;
    width: 100%;
    margin-left: 0;
    /* RTL support */
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
}

.total-row .label {
    color: var(--ashrafi-medium-brown);
}

.total-row .value {
    color: var(--ashrafi-dark-brown);
    font-weight: 600;
}

.order-totals .total-row:last-child {
    font-size: 18px;
    border-top: 2px solid var(--ashrafi-dark-brown);
    margin-top: 10px;
}

/* --- Customer Details Panel (Responsive Grid) --- */
.customer-details-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.address-card {
    background-color: var(--ashrafi-card-background);
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 12px;
    padding: 25px;
}

.address-title {
    font-size: 18px;
    color: var(--ashrafi-dark-brown);
    margin: 0 0 15px 0;
    border-bottom: 1px solid var(--ashrafi-light-brown);
    padding-bottom: 10px;
}

.address-card address {
    line-height: 1.8;
    color: var(--ashrafi-medium-brown);
    font-style: normal;
}

/* --- Order Notes --- */
.order-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-note {
    padding: 15px;
    border: 1px solid var(--ashrafi-background);
    border-radius: 8px;
    margin-bottom: 15px;
}

.order-note:last-child {
    margin-bottom: 0;
}

.note-meta {
    font-size: 13px;
    color: var(--ashrafi-medium-brown);
    margin-bottom: 10px;
}

.note-content p:last-child {
    margin-bottom: 0;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation {
        display: none;
    }

    .order-header-panel,
    .header-meta-info {
        text-align: right;
    }

    .header-main-info,
    .header-meta-info {
        flex-direction: column;
        align-items: flex-start;
        /* RTL support */
        gap: 10px;
    }

    .order-item {
        flex-wrap: wrap;
    }

    .item-details {
        width: 100%;
        flex-grow: 0;
        order: 1;
        /* Puts details first */
        margin-left: 10px;
        /* Aligns with image */
    }

    .item-image {
        order: 0;
    }

    .item-price {
        order: 2;
        width: 100%;
        text-align: left;
        /* RTL support */
    }

    .customer-details-panel {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/*
 * Ashrafi Gallery - Custom Styles for Address Pages V2
 */

.panel-description {
    font-size: 15px;
    color: var(--ashrafi-medium-brown);
    margin-top: -10px;
    margin-bottom: 30px;
}

/* --- Styles for My Addresses List Page (my-address.php) --- */

.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.address-card {
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 12px;
    background-color: var(--ashrafi-card-background);
    transition: box-shadow 0.3s ease;
}

.address-card:hover {
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.08);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--ashrafi-light-brown);
}

.address-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--ashrafi-dark-brown);
}

.address-header .edit-button {
    font-size: 14px;
    font-weight: 500;
    color: var(--ashrafi-medium-brown);
    text-decoration: none;
    transition: color 0.2s ease;
}

.address-header .edit-button:hover {
    color: var(--ashrafi-dark-brown);
}

.address-content {
    padding: 20px;
}

.address-content address {
    font-style: normal;
    line-height: 2;
    color: var(--ashrafi-medium-brown);
}

/* --- Styles for Edit Address Form (form-edit-address.php) --- */
.dashboard-panel form .form-row {
    padding: 0 10px;
    margin-bottom: 20px;
}

.dashboard-panel form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin-bottom: 8px;
}

.dashboard-panel form input[type="text"],
.dashboard-panel form input[type="tel"],
.dashboard-panel form input[type="email"],
.dashboard-panel form .select2-container .select2-selection--single {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 8px;
    background-color: var(--ashrafi-background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    height: auto;
}

.dashboard-panel form input:focus,
.dashboard-panel form .select2-container--open .select2-selection--single {
    border-color: var(--ashrafi-medium-brown) !important;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1) !important;
    outline: none;
}

.dashboard-panel form .button {
    background-color: var(--ashrafi-dark-brown);
    color: white;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dashboard-panel form .button:hover {
    background-color: var(--ashrafi-medium-brown);
}

/*
 * Ashrafi Gallery - Custom Styles for Edit Address Form V2
 * This version uses CSS Grid for a robust responsive layout.
 */

/* --- ساختار کلی و چیدمان گرید --- */
.dashboard-panel .woocommerce-address-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* ایجاد ساختار دو ستونی */
    gap: 25px;
    /* فاصله بین فیلدها */
}

/* فیلدهایی که باید تمام عرض باشند (مانند آدرس کامل) */
.dashboard-panel .form-row-wide {
    grid-column: 1 / -1;
    /* این فیلد هر دو ستون را اشغال می‌کند */
}

/* --- استایل‌دهی به لیبل‌ها و فیلدهای ورودی --- */
.dashboard-panel form .form-row {
    padding: 0;
    margin: 0;
}

.dashboard-panel form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ashrafi-dark-brown);
    margin-bottom: 8px;
    display: block;
}

.dashboard-panel form label .required {
    color: #c0392b;
}

.dashboard-panel form .woocommerce-input-wrapper {
    display: block;
}

.dashboard-panel form input[type="text"],
.dashboard-panel form input[type="tel"],
.dashboard-panel form input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ashrafi-light-brown);
    border-radius: 8px;
    background-color: var(--ashrafi-background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    height: auto;
    font-size: 14px;
}

.dashboard-panel form input:focus {
    border-color: var(--ashrafi-medium-brown) !important;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1) !important;
    outline: none;
}

/* --- استایل اختصاصی برای دراپ‌داون استان (Select2) --- */
.dashboard-panel .select2-container .select2-selection--single {
    height: 48px !important;
    /* هماهنگی ارتفاع با سایر اینپوت‌ها */
    display: flex;
    align-items: center;
    padding: 0 15px;
    border: 1px solid var(--ashrafi-light-brown) !important;
    border-radius: 8px !important;
    background-color: var(--ashrafi-background) !important;
}

.dashboard-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ashrafi-dark-brown) !important;
    line-height: 48px !important;
    padding: 0 !important;
}

.dashboard-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    left: 10px !important;
    /* برای زبان فارسی */
    right: auto !important;
}

/* --- استایل دکمه ذخیره --- */
.dashboard-panel form p button.button {
    background-color: var(--ashrafi-dark-brown);
    color: white;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.dashboard-panel form p button.button:hover {
    background-color: var(--ashrafi-medium-brown);
}

/* --- رسپانسیوسازی برای موبایل --- */
@media (max-width: 768px) {
    .dashboard-panel .woocommerce-address-fields__field-wrapper {
        grid-template-columns: 1fr;
        /* تمام فیلدها تک ستونی می‌شوند */
        gap: 20px;
    }
}

/* --- استایل‌های جدید و واکنش‌گرای صفحه کیف پول --- */

/* کانتینر اصلی و کادر موجودی (با کمی بهبود) */
.wallet-history-container-responsive {
    max-width: 800px;
    margin: 0 auto;
}

.wallet-balance-card {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.wallet-balance-title {
    margin: 0 0 10px;
    font-size: 1.1em;
    color: #495057;
}

.wallet-balance-amount {
    font-size: 2.5em;
    /* کمی بزرگتر برای تاکید */
    font-weight: 700;
    color: #209a40;
    margin: 0 0 15px;
}

.wallet-balance-description {
    font-size: 0.9em;
    color: #6c757d;
    margin: 0;
}

.wallet-history-title {
    text-align: right;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* لیست تراکنش‌ها */
.wallet-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* هر آیتم تراکنش (کارت) */
.wallet-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-left-width: 5px;
    /* نوار رنگی کنار هر آیتم */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.wallet-history-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* رنگ‌بندی نوار کناری بر اساس نوع تراکنش */
.wallet-item--increase {
    border-left-color: #28a745;
    /* سبز */
}

.wallet-item--decrease {
    border-left-color: #dc3545;
    /* قرمز */
}

/* بخش اصلی (دلیل و تاریخ) */
.wallet-item__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.wallet-item__reason {
    font-weight: 600;
    color: #333;
    font-size: 1em;
    margin-bottom: 5px;
}

.wallet-item__date {
    font-size: 0.85em;
    color: #777;
}

/* بخش جزئیات (مبلغ و موجودی) */
.wallet-item__details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: left;
}

.wallet-item__amount {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 5px;
}

.wallet-increase {
    color: #28a745;
}

.wallet-decrease {
    color: #dc3545;
}

.wallet-item__balance {
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
    /* جلوگیری از شکستن خط */
}

/* --- بخش واکنش‌گرایی برای موبایل --- */
@media (max-width: 768px) {
    .wallet-balance-amount {
        font-size: 2em;
        /* کمی کوچکتر در موبایل */
    }

    .wallet-history-item {
        flex-direction: column;
        /* آیتم‌ها را عمودی کن */
        align-items: flex-start;
        /* همه چیز از راست شروع شود */
        padding: 15px;
    }

    .wallet-item__main {
        width: 100%;
        margin-bottom: 15px;
    }

    .wallet-item__details {
        width: 100%;
        flex-direction: row;
        /* در یک ردیف قرار بگیرند */
        justify-content: space-between;
        /* با فاصله از هم */
        align-items: center;
        padding-top: 10px;
        border-top: 1px dashed #eee;
        /* یک جداکننده خط‌چین */
    }

    .wallet-item__amount {
        margin-bottom: 0;
    }
}


/* --- Estilos del Sistema de Tickets de Soporte --- */

.support-ticket-system {
    max-width: 800px;
    margin: 0 auto;
}

.support-ticket-system h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Estilos del Formulario */
#new-ticket-form {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
}

#new-ticket-form .form-row {
    margin-bottom: 20px;
}

#new-ticket-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

#new-ticket-form input[type="text"],
#new-ticket-form select,
#new-ticket-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
    /* Asegura que el padding no afecte la anchura */
    transition: border-color 0.2s ease;
}

#new-ticket-form input[type="text"]:focus,
#new-ticket-form select:focus,
#new-ticket-form textarea:focus {
    border-color: #0073aa;
    /* Color de acento de WordPress */
    outline: none;
}

#new-ticket-form button {
    background-color: #2ea44f;
    /* Color verde, tipo GitHub */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#new-ticket-form button:hover {
    background-color: #2c974b;
}

/* Estilos de la Lista de Tickets */
.user-tickets-list h3 {
    margin-top: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tickets-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.ticket-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ticket-info .ticket-title {
    font-weight: 600;
    color: #005a87;
    text-decoration: none;
    font-size: 1.1em;
}

.ticket-info .ticket-title:hover {
    text-decoration: underline;
}

.ticket-info .ticket-meta {
    display: block;
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
}

.ticket-status {
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 700;
    color: #8f766f;
    text-transform: uppercase;
    min-width: 80px;
    text-align: center;
}

.shipping-cell {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: space-between;
    align-content: center;
    border-bottom: solid 1px #e3e3e3;
    padding: 5px;
    margin-bottom: 5px;
    gap: 3px;
}

.shipping-cell>span:first-child {
    color: #585858;
}

.shipping-cell>span:last-child {
    font-size: 13px;
}

/* Insignias de estado (puedes añadir más) */
.status-badge.status-abierto {
    background-color: #28a745;
}

/* Verde */
.status-badge.status-en-proceso {
    background-color: #ffc107;
    color: #333;
}

/* Amarillo */
.status-badge.status-cerrado {
    background-color: #6c757d;
}

/* Gris */
.status-badge.status-unknown {
    background-color: #dc3545;
}

/* Rojo */

.priority-label {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-top: 8px;
}

/* Estilos Responsivos */
@media (max-width: 600px) {
    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .ticket-status {
        margin-top: 15px;
        text-align: left;
    }
}

/* استایل مینیمال و زیبا برای صفحه‌بندی ووکامرس
  Minimal & Clean Style for WooCommerce Pagination
*/

/* تعریف متغیر برای رنگ اصلی جهت شخصی‌سازی آسان */
:root {
    --primary-color: #007BFF;
    /* می‌توانید این رنگ را با کد رنگ دلخواه خود جایگزین کنید */
    --light-gray: #f0f0f0;
    --dark-text: #333;
    --white-text: #ffffff;
}

/* استایل کلی کانتینر صفحه‌بندی */
.woocommerce-pagination {
    display: flex;
    justify-content: center;
    /* آیتم‌ها را در مرکز قرار می‌دهد */
    align-items: center;
    gap: 8px;
    /* فاصله بین آیتم‌ها */
    margin-top: 40px;
    /* فاصله از محتوای بالا */
    margin-bottom: 20px;
}

/* استایل پایه برای هر آیتم (عدد صفحه، بعدی/قبلی) */
.woocommerce-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    /* حداقل عرض */
    height: 42px;
    padding: 0 10px;
    border-radius: 8px;
    /* گوشه‌های گرد و نرم */
    background-color: var(--light-gray);
    color: var(--dark-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    /* انیمیشن نرم برای هاور */
}

/* استایل برای آیتم "فعلی" یا "current" */
.woocommerce-pagination .page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white-text);
    font-weight: 700;
    cursor: default;
}

/* افکت هاور برای لینک‌هایی که فعال نیستند */
.woocommerce-pagination a.page-numbers:hover {
    background-color: #e0e0e0;
    /* کمی تیره‌تر شدن پس‌زمینه در زمان هاور */
    color: var(--dark-text);
}

/* شخصی‌سازی لینک "بعدی" برای زیبایی بیشتر */
.woocommerce-pagination .next {
    padding: 0 16px;
    /* فضای بیشتر برای متن */
}


/* بخش ریسپانسیو برای صفحات نمایش کوچک (موبایل) */
@media (max-width: 600px) {
    .woocommerce-pagination {
        gap: 5px;
        /* کاهش فاصله بین آیتم‌ها */
    }

    .woocommerce-pagination .page-numbers {
        min-width: 38px;
        height: 38px;
        font-size: 14px;
        border-radius: 6px;
        /* گردی کمتر گوشه‌ها */
    }

    .woocommerce-pagination .next {
        padding: 0 12px;
    }
}

td.woocommerce-orders-table__cell.woocommerce-orders-table__cell-order-actions {
    white-space: nowrap;
}

td.woocommerce-orders-table__cell.woocommerce-orders-table__cell-order-actions a {
    padding: 5px 8px;
    margin: 5px 3px;
    font-size: 13px;
    display: inline-block;
}

/*
 * استایل کوپن با تم کافه‌ای طلایی
 * طراحی: مینیمال، شیک و واکنش‌گرا
*/

/* --- فونت پیشنهادی (اختیاری) --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');

/* --- لایه‌بندی اصلی گرید کوپن‌ها --- */
.coupons-grid {
    display: grid;
    /* این بخش اصلی واکنش‌گرایی است: */
    /* در صفحه‌های بزرگ چند ستون و در صفحه‌های کوچک تک ستون می‌شود */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    /* فاصله بین کارت‌ها */
    direction: rtl;
    /* راست‌چین کردن محتوا */
}

/* --- استایل هر کارت کوپن --- */
.coupon-card {
    background-color: #fdfaf3;
    /* رنگ کرم روشن شبیه فوم شیرقهوه */
    border: 1px solid #e0d9ce;
    /* حاشیه بسیار ملایم */
    border-radius: 12px;
    /* گوشه‌های گرد */
    padding: 25px;
    display: flex;
    flex-direction: column;
    /* چیدمان عمودی آیتم‌ها */
    justify-content: space-between;
    /* آیتم‌ها فضای موجود را پر می‌کنند */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* سایه بسیار نرم */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* انیمیشن نرم */
}

.coupon-card:hover {
    transform: translateY(-5px);
    /* افکت شناور شدن کارت */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* --- استایل کد تخفیف --- */
.coupon-code {
    font-size: 1.6rem;
    /* اندازه بزرگ و خوانا */
    font-weight: 700;
    color: #3d2c22;
    /* رنگ قهوه‌ای تیره (اسپرسو) */
    margin: 0 0 10px 0;
    text-align: center;
    letter-spacing: 2px;
    /* فاصله بین حروف برای استایل بهتر */
    padding: 12px;
    border: 2px dashed #c5a35a;
    /* حاشیه نقطه‌چین طلایی، نکته کلیدی تم */
    border-radius: 8px;
    background-color: #fff;
}

/* --- استایل توضیحات کوپن --- */
.coupon-description {
    color: #6b5a51;
    /* رنگ قهوه‌ای ملایم‌تر */
    font-size: 0.95rem;
    line-height: 1.7;
    /* فاصله خطوط برای خوانایی بهتر */
    text-align: center;
    margin-bottom: 25px;
    flex-grow: 1;
    /* این بخش باعث می‌شود توضیحات فضای خالی را پر کند */
}

/* --- استایل دکمه کپی --- */
.coupon-actions {
    text-align: center;
}

.copy-coupon-btn {
    background-color: #c5a35a;
    /* رنگ طلایی اصلی تم */
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    /* دکمه تمام عرض باشد */
}

.copy-coupon-btn:hover {
    background-color: #b38f45;
    /* رنگ طلایی کمی تیره‌تر در هاور */
}

.copy-coupon-btn:active {
    transform: scale(0.98);
    /* افکت فشرده شدن دکمه در زمان کلیک */
}