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

:root {
    --secondary-color: #757575;
    --success-color: #9E9E9E;
    --error-color: #f44336;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --header-height: 56px;
    --bottom-nav-height: 60px;
}
h1,h2,h3,h4,h5,h6{
    color:var(--text-color);
}
/* تم تاریک */
body.dark-theme {
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --bg-color: #121212;
    --white: #1e1e1e;
    --border-color: #333;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
    --secondary-color: #888;
    --success-color: #66bb6a;
}

body {
    font-family: 'Vazir', 'IRANSans', Tahoma, Arial, sans-serif;
    direction: rtl;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#wp-rahkar-spa-container {
    max-width: 100%;
    min-height: 100vh;
    position: relative;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
}

/* ===== Loading Spinner ===== */
.spa-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

body.dark-theme .spa-loader {
    background: rgba(30, 30, 30, 0.9);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ===== Header ===== */
.spa-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.spa-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between; /* این خط مهم است */
    height: 100%;
    padding: 0 16px;
    position: relative;
}

/* منوی سمت راست */
.spa-menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-shrink: 0; /* از فشرده شدن جلوگیری کند */
}

.spa-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: 0.3s;
}

/* لوگو در وسط */
.spa-logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

/* آیکون‌های سمت چپ */
.spa-header-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* از فشرده شدن جلوگیری کند */
}

.spa-search-toggle,
.spa-cart-toggle,
.spa-theme-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.spa-cart-toggle svg,
.spa-search-toggle svg,
.spa-theme-toggle svg {
    fill: var(--text-color);
}

.cart-count {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--error-color);
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* استایل جدید برای درگاه‌های پرداخت */
.spa-payment-method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.spa-payment-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.spa-payment-title {
    font-weight: bold;
    font-size: 14px;
}

.spa-wallet-balance {
    color: var(--primary-color);
    font-size: 12px;
    margin-right: auto;
}

.spa-payment-method {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.spa-payment-method:hover {
    border-color: var(--primary-color);
}

.spa-payment-method input:checked + .spa-payment-method-content {
    background-color: rgba(33, 150, 243, 0.1);
    border-color: var(--primary-color);
}

/* ===== Search Bar ===== */
.spa-search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 8px;
}

.spa-search-bar input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-color);
}

.spa-search-bar button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* ===== Sidebar ===== */
.spa-sidebar, .spa-filter-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    z-index: 2000;
    transition: right 0.3s;
}

.spa-sidebar.active, .spa-filter-sidebar.active {
    right: 0;
}

.spa-sidebar-overlay, .spa-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.spa-sidebar.active .spa-sidebar-overlay,
.spa-filter-sidebar.active .spa-filter-overlay {
    opacity: 1;
    visibility: visible;
}

.spa-sidebar-content, .spa-filter-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--white);
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    overflow-y: auto;
    padding: 20px;
}

.spa-sidebar-close, .spa-filter-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-color);
}

.spa-menu {
    list-style: none;
    margin-top: 40px;
}

.spa-menu li {
    margin-bottom: 8px;
}

.spa-menu a {
    display: block;
    padding: 12px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.spa-menu a:hover {
    background: var(--bg-color);
}

.spa-menu-categories > span {
    display: block;
    padding: 12px;
    font-weight: bold;
    color: var(--primary-color);
}

.spa-menu-categories ul {
    list-style: none;
    margin-right: 16px;
}

/* ===== Filter Sidebar ===== */
.spa-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.spa-filter-header h3 {
    font-size: 18px;
}

.spa-filter-group {
    margin-bottom: 20px;
}

.spa-filter-group h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--primary-color);
}

.spa-filter-group label {
    display: block;
    padding: 8px 0;
    cursor: pointer;
}

.spa-filter-group input[type="checkbox"] {
    margin-left: 8px;
}

/* ===== Main Content ===== */
.spa-content {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    padding: 16px;
    animation: fadeIn 0.3s;
}

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

.spa-content h2 {
    margin-bottom: 16px;
    color: var(--text-color);
}

/* ===== Products Grid ===== */
.spa-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.spa-product-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

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

.spa-product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.spa-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
    color: white;
    border-radius: 4px;
    font-weight: bold;
}

.spa-badge-sale {
    background: var(--error-color);
}

.spa-badge-featured {
    background: var(--secondary-color);
    top: 36px;
}

.spa-product-card-body {
    padding: 12px;
}

.spa-product-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color:var(--text-color);
}

.spa-product-price {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    font-size: 0.9rem;
}

.spa-product-price del {
    color: var(--text-light);
    font-size: 12px;
    margin-left: 8px;
}

.spa-no-products {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

/* ===== Product Single ===== */
.spa-product-single {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.spa-back-btn {
    padding: 12px 20px;
    background: var(--bg-color);
    border: none;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spa-back-btn svg {
    fill: var(--text-color);
}

.spa-product-images img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--bg-color);
}

.spa-product-info {
    padding: 20px;
}

.spa-product-info h1 {
    font-size: 22px;
    margin-bottom: 12px;
}

.spa-product-info .spa-product-price {
    font-size: 24px;
    margin-bottom: 16px;
}

.spa-product-short-desc {
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-light);
    padding: 12px;
    background: var(--bg-color);
    border-radius: 4px;
}

.spa-product-variations {
    margin-bottom: 20px;
}

.spa-variation-group {
    margin-bottom: 16px;
}

.spa-variation-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.spa-variation-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-color);
}

.spa-product-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.spa-product-description h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.spa-product-description p {
    line-height: 1.8;
    color: var(--text-light);
}

/* ===== Cart ===== */
.spa-empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.spa-empty-cart svg {
    margin-bottom: 20px;
}

.spa-empty-cart h3 {
    margin-bottom: 20px;
    color: var(--text-light);
}

.spa-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.spa-cart-item {
    display: flex;
    gap: 12px;
    background: var(--white);
    padding: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
}

.spa-cart-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.spa-cart-item-details {
    flex: 1;
}

.spa-cart-item-details h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.spa-cart-item-variation {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.spa-cart-item-variation span {
    display: inline-block;
    margin-left: 8px;
}

.spa-cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 8px;
}

.spa-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-color);
}

.spa-remove-item {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.spa-cart-totals {
    margin-top: 20px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.spa-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.spa-total-main {
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

/* ===== Checkout ===== */
.spa-checkout {
    max-width: 1200px;
    margin: 0 auto;
}

.spa-checkout-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.spa-checkout-fields {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.spa-checkout-fields h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.spa-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.spa-form-group {
    margin-bottom: 16px;
}

.spa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.spa-form-group input,
.spa-form-group textarea,
.spa-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-color);
}

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

.spa-checkout-review {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.spa-checkout-review h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.spa-order-items {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.spa-order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.spa-order-totals {
    margin-bottom: 20px;
}

.spa-order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.spa-order-total-main {
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

.spa-payment-methods {
    margin-bottom: 20px;
}

.spa-payment-methods h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.spa-payment-method {
    display: block;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}

.spa-payment-method input {
    margin-left: 8px;
}

.spa-payment-method:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(33, 150, 243, 0.05);
}

/* ===== Order Received ===== */
.spa-order-received {
    max-width: 600px;
    margin: 0 auto;
}

.spa-order-success,
.spa-order-failed {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.spa-order-success svg {
    margin-bottom: 20px;
}

.spa-order-success h2 {
    color: var(--success-color);
    margin-bottom: 12px;
}

.spa-order-failed h2 {
    color: var(--error-color);
    margin-bottom: 12px;
}

.spa-order-details {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.spa-order-info {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.spa-order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.spa-order-actions {
    display: flex;
    gap: 12px;
}

/* ===== Buttons ===== */
.spa-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.spa-btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.spa-btn-secondary {
    background: var(--secondary-color);
    color: white;
    width: 100%;
}

.spa-btn-secondary:hover {
    background: #9E9E9E;
}

.spa-btn-large {
    padding: 16px 24px;
    font-size: 16px;
}

.spa-btn-select,
.spa-btn-view {
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    width: 100%;
}

.spa-btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    width: 100%;
}

/* ===== Bottom Navigation ===== */
.spa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.spa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
    flex: 1;
}

.spa-nav-item svg {
    fill: #999;
    transition: fill 0.3s;
}

.spa-nav-item span {
    font-size: 11px;
}

.spa-nav-item.active,
.spa-nav-item:hover {
    color: var(--primary-color);
}

.spa-nav-item.active svg,
.spa-nav-item:hover svg {
    fill: var(--primary-color);
}

/* ===== Discount Code Section ===== */
.spa-discount-section {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.spa-discount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.spa-discount-header h3 {
    font-size: 16px;
    color: var(--text-color);
}

.spa-discount-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.spa-coupon-input {
    display: flex;
    gap: 8px;
    margin-bottom:10px;
}

.spa-discount-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-color);
}

.spa-discount-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.spa-discount-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.spa-discount-btn:hover {
    background: var(--primary-color-dark);
}

.spa-discount-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.spa-discount-message {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.spa-discount-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.spa-discount-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.spa-discount-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(33, 150, 243, 0.05);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    margin-top: 12px;
}

.spa-discount-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spa-discount-code {
    font-weight: bold;
    color: var(--primary-color);
}

.spa-discount-amount {
    color: var(--success-color);
    font-size: 14px;
}

.spa-remove-discount {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* استایل جدید برای دکمه‌های کیف پول */
.spa-wallet-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.spa-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.spa-wc-notice {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    border-right: 4px solid;
}
.spa-wc-notice-error {
    background: #ffeaea;
    border-color: #f44336;
    color: #d32f2f;
}
.spa-wc-notice-success {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}
.spa-wc-notice-info {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1565c0;
}
.spa-checkout-notices {
  margin-bottom: 20px;
}

.spa-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: #333;
  color: white;
  border-radius: 4px;
  z-index: 10000;
  animation: slideDown 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.spa-toast-success {
  background: #4caf50;
}
.spa-toast-error {
  background: #f44336;
}
.spa-toast a {
  color: #fff;
}
@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}
.bounce {
  animation: bounce 0.6s;
}
@keyframes bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* ===== Custom Confirm Modal ===== */
.spa-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.spa-confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.spa-confirm-content {
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.spa-confirm-modal.active .spa-confirm-content {
    transform: translateY(0);
}

.spa-confirm-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.spa-confirm-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spa-confirm-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--error-color);
}

.spa-confirm-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
}

.spa-confirm-message {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

.spa-confirm-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px 24px;
}

.spa-confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spa-confirm-cancel {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.spa-confirm-cancel:hover {
    background: #e0e0e0;
}

.spa-confirm-delete {
    background: var(--error-color);
    color: white;
}

.spa-confirm-delete:hover {
    background: #d32f2f;
}

/* Animation for modal */
@keyframes spaConfirmSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spa-confirm-content {
    animation: spaConfirmSlideIn 0.3s ease;
}

/* استایل‌های صفحه تایید سفارش */
.spa-order-received {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.spa-order-success,
.spa-order-failed {
    text-align: center;
    padding: 40px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.spa-order-success {
    background: rgba(76, 175, 80, 0.05);
    border: 1px solid #4CAF50;
}

.spa-order-failed {
    background: rgba(244, 67, 54, 0.05);
    border: 1px solid #f44336;
}

.success-message,
.error-message {
    color: var(--text-light);
    margin-top: 10px;
    font-size: 14px;
}

.order-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-processing {
    background: #2196F3;
    color: white;
}

.status-completed {
    background: #4CAF50;
    color: white;
}

.status-on-hold {
    background: #FF9800;
    color: white;
}

.status-failed,
.status-cancelled {
    background: #f44336;
    color: white;
}

.spa-order-details {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.spa-order-details h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.spa-order-info {
    margin-bottom: 24px;
}

.spa-order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.spa-order-info-row:last-child {
    border-bottom: none;
}

.spa-order-addresses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.spa-address-section h4 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.address-content {
    background: var(--bg-color);
    padding: 12px;
    border-radius: 4px;
    line-height: 1.6;
}

.order-items-list {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.spa-order-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.spa-order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 60px;
    height: 60px;
    margin-left: 16px;
    border-radius: 4px;
    overflow: hidden;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-details {
    flex: 1;
}

.order-item-details h5 {
    margin-bottom: 8px;
    color: var(--text-color);
}

.order-item-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.spa-order-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

#spaLoadMore {
    grid-column: 1 / -1;
    margin: 30px auto;
    padding: 15px 30px;
    font-size: 16px;
    max-width: 300px;
    display: block;
}

#spaLoadMore:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* استایل‌های مدال فیلتر - حالت پاپ‌اپ */
.spa-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.spa-filter-modal.active {
    opacity: 1;
    visibility: visible;
}

.spa-filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.spa-filter-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

.spa-filter-modal.active .spa-filter-modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.spa-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 16px 16px 0 0;
}

.spa-filter-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
}

.spa-filter-modal-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spa-filter-modal-close:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.spa-filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.spa-filter-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: var(--bg-color);
    border-radius: 0 0 16px 16px;
}

.spa-filter-modal-footer .spa-btn {
    flex: 1;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-weight: bold;
}

/* استایل‌های بخش‌های فیلتر */
.spa-filter-sections {
    padding: 0;
}

.spa-filter-section {
    border-bottom: 1px solid var(--border-color);
}

.spa-filter-section:last-child {
    border-bottom: none;
}

.spa-filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.spa-filter-section-header:hover {
    background: var(--bg-color);
}

.spa-filter-section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.spa-filter-toggle-icon {
    font-size: 18px;
    color: var(--text-light);
    transition: transform 0.3s ease;
    font-weight: bold;
}

.spa-filter-section.active .spa-filter-toggle-icon {
    transform: rotate(45deg);
    color: var(--primary-color);
}

.spa-filter-section-content {
    display: none;
    padding: 0 24px 20px;
    animation: fadeIn 0.3s ease;
}

.spa-filter-section.active .spa-filter-section-content {
    display: block;
}

/* استایل‌های بهبود یافته برای فیلترها */
.spa-price-range {
    padding: 16px 0;
}

.spa-price-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.spa-price-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spa-price-input-group label {
    font-size: 14px;
    color: var(--text-light);
    min-width: 80px;
}

.spa-price-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-color);
}

.spa-price-input-group span {
    font-size: 14px;
    color: var(--text-light);
    min-width: 50px;
}

.spa-range-slider {
    position: relative;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 30px 0;
}

.spa-range-track {
    position: absolute;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
}

.spa-range-min,
.spa-range-max {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 20px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
}

.spa-range-min::-webkit-slider-thumb,
.spa-range-max::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
}

.spa-range-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-light);
}

.spa-filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 4px;
}

.spa-filter-item:hover {
    background: var(--bg-color);
}

.spa-filter-item-name {
    font-size: 14px;
    color: var(--text-color);
}

/* استایل ویژگی‌ها با دو ستون */
.spa-attribute-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.spa-attribute-group {
    margin-bottom: 16px;
}

.spa-attribute-group h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.spa-attribute-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 4px;
}

.spa-attribute-item:hover {
    background: var(--bg-color);
}

.spa-attribute-name {
    font-size: 13px;
    color: var(--text-color);
}

/* استایل آیتم‌های فیلتر معمولی */
.spa-filter-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* استایل هدر فروشگاه */
.spa-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 16px;
}

.spa-shop-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 24px;
}

.spa-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.spa-filter-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.spa-filter-btn:active {
    transform: translateY(0);
}

/* انیمیشن fadeIn */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* اسکرول بار زیبا برای محتوای مدال */
.spa-filter-modal-body::-webkit-scrollbar {
    width: 6px;
}

.spa-filter-modal-body::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.spa-filter-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.spa-filter-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* استایل جدید برای درگاه‌های پرداخت */
.spa-payment-method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}

.spa-payment-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.spa-payment-title {
    font-weight: bold;
    font-size: 14px;
}

.spa-wallet-balance {
    color: var(--primary-color);
    font-size: 12px;
    margin-right: auto;
}

.spa-payment-method {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: var(--white);
}

.spa-payment-method:hover {
    border-color: var(--primary-color);
}

.spa-payment-method input:checked + .spa-payment-method-content {
    background-color: rgba(33, 150, 243, 0.1);
    border-color: var(--primary-color);
}

.spa-payment-method input {
    display: none;
}

.spa-wallet-deduction-row {
    color: var(--primary-color);
    font-weight: bold;
}

.spa-wallet-deduction-row span:last-child {
    color: #e53935;
}

.spa-order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.spa-order-total-main {
    font-weight: bold;
    font-size: 16px;
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

/* ===== Responsive ===== */

/* موبایل - هر ردیف 1 محصول */
@media (max-width: 767px) {
    .spa-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .spa-product-card img {
        height: 200px;
    }
    
    .spa-form-row {
        grid-template-columns: 1fr;
    }
    
    .spa-order-actions {
        flex-direction: column;
    }
}

/* تبلت - هر ردیف 2 محصول */
@media (min-width: 768px) and (max-width: 1023px) {
    .spa-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .spa-product-card img {
        height: 220px;
    }
    
    .spa-checkout-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .spa-checkout-fields {
        grid-column: 1 / 2;
    }
    
    .spa-checkout-review {
        grid-column: 2 / 3;
    }
    
    .spa-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* دسکتاپ - هر ردیف 3 محصول */
@media (min-width: 1024px) {
    .spa-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .spa-product-card img {
        height: 250px;
    }
    
    .spa-checkout-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .spa-checkout-fields {
        grid-column: 1 / 2;
    }
    
    .spa-checkout-review {
        grid-column: 2 / 3;
    }
    
    .spa-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* دسکتاپ بزرگ - هر ردیف 3 محصول با فاصله بیشتر */
@media (min-width: 1200px) {
    .spa-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
    
    .spa-product-card img {
        height: 280px;
    }
}


#themeIcon {
    transition: all 0.3s ease;
}

#themeIcon .bounce {
    animation: bounce 0.6s;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}
