:root {
    --vip-primary: #4f46e5;
    --vip-primary-hover: #4338ca;
    --vip-secondary: #f59e0b;
    --vip-success: #10b981;
    --vip-danger: #ef4444;
    --vip-dark: #1e293b;
    --vip-gray: #64748b;
    --vip-light: #f1f5f9;
    --vip-white: #ffffff;
    --vip-border: #e2e8f0;
    --vip-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --vip-radius: 16px;
    --vip-font-family: inherit;
}

/* Hide VIP fee amount column completely (cart and checkout) */
.cart_totals .shop_table tr.fee td[data-title*="اعتبار VIP"],
.woocommerce-checkout-review-order-table tr.fee td {
    display: none !important;
}

/* Make VIP fee row in checkout full width since we hide the amount */
.woocommerce-checkout-review-order-table tr.fee th {
    text-align: right !important;
}

/* Alternative: Hide any fee row td that contains 0 amount for VIP */
.cart_totals .shop_table tr.fee td .woocommerce-Price-amount:contains("0"),
.woocommerce-checkout-review-order-table tr.fee td .woocommerce-Price-amount:contains("0") {
    display: none !important;
}

/* Base Styles */
.vip-products-page, .vip-login-container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px; 
    font-family: var(--vip-font-family); 
    direction: rtl; 
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.vip-fade-in { animation: fadeIn 0.5s ease-out forwards; }

/* Login Page Styles */
.vip-login-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #f8fafc, #e2e8f0);
}

.vip-login-box {
    background: var(--vip-white);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--vip-shadow);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

.vip-login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--vip-primary), var(--vip-secondary));
}

.vip-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.vip-login-icon {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--vip-primary);
}

.vip-login-header h2 {
    font-size: 24px;
    color: var(--vip-dark);
    margin: 0 0 8px;
    font-weight: 800;
}

.vip-login-header p {
    color: var(--vip-gray);
    font-size: 14px;
    margin: 0;
}

.vip-form-group {
    margin-bottom: 20px;
}

.vip-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--vip-dark);
    font-weight: 600;
    font-size: 14px;
}

.vip-form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--vip-light);
    border-radius: 12px;
    background: var(--vip-light);
    color: var(--vip-dark);
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.vip-form-group input:focus {
    border-color: var(--vip-primary);
    background: var(--vip-white);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.vip-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--vip-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.vip-submit-btn:hover {
    background: var(--vip-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.vip-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.vip-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.vip-message {
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}
.vip-message-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.vip-message-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Products Page Header */
.vip-page-header {
    background: var(--vip-white);
    padding: 30px;
    border-radius: var(--vip-radius);
    box-shadow: var(--vip-shadow);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--vip-border);
    position: relative;
    overflow: hidden;
}

.vip-page-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; width: 6px;
    background: linear-gradient(180deg, var(--vip-primary), var(--vip-secondary));
}

.vip-header-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vip-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--vip-light);
    overflow: hidden;
    border: 4px solid var(--vip-light);
}

.vip-avatar img { width: 100%; height: 100%; object-fit: cover; }

.vip-greeting { display: flex; flex-direction: column; gap: 4px; }
.vip-greeting h1 { font-size: 24px; margin: 0; color: var(--vip-dark); font-weight: 800; }
.vip-greeting p { margin: 0; color: var(--vip-gray); font-size: 15px; }

/* Stats Cards */
.vip-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.vip-stat-card {
    background: var(--vip-white);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--vip-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--vip-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vip-stat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.vip-stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-orange { background: #fff7ed; color: #f97316; }
.icon-purple { background: #faf5ff; color: #a855f7; }

.vip-stat-info { display: flex; flex-direction: column; }
.vip-stat-info h3 { font-size: 14px; color: var(--vip-gray); margin: 0 0 6px; font-weight: 600; }
.vip-stat-value { font-size: 28px; font-weight: 800; color: var(--vip-dark); margin: 0; line-height: 1; }
.vip-stat-unit { font-size: 12px; color: var(--vip-gray); margin-right: 4px; font-weight: 400; }

/* Products Grid */
.vip-products-section h2 {
    font-size: 24px;
    color: var(--vip-dark);
    margin-bottom: 30px;
    font-weight: 800;
    position: relative;
    padding-right: 16px;
}

.vip-products-section h2::before {
    content: '';
    position: absolute;
    right: 0; top: 6px; bottom: 6px; width: 4px;
    background: var(--vip-secondary);
    border-radius: 2px;
}

/* Products Grid - بهبود responsive و چیدمان */
.vip-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 24px;
    margin-bottom: 40px;
}

.vip-product-card {
    background: var(--vip-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--vip-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 420px;
}

.vip-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--vip-primary);
}

.vip-product-thumb {
    position: relative;
    padding-top: 60%;
    background: #f8fafc;
    overflow: hidden;
}

.vip-product-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.vip-product-card:hover .vip-product-thumb img { 
    transform: scale(1.05); 
}

.vip-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--vip-secondary);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vip-product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.vip-product-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.4;
    color: var(--vip-dark);
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vip-product-title a { 
    color: inherit; 
    text-decoration: none; 
    transition: color 0.2s; 
}

.vip-product-title a:hover { 
    color: var(--vip-primary); 
}

.vip-product-price {
    margin: auto 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    gap: 10px;
    margin-bottom: 24px;
}

.price-del { 
    color: #9ca3af; 
    text-decoration: line-through; 
    font-size: 14px; 
}

.price-ins { 
    color: var(--vip-primary); 
    font-weight: 800; 
    font-size: 18px; 
}

.vip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    gap: 8px;
}

.vip-btn-outline {
    background: transparent;
    border: 2px solid var(--vip-border);
    color: var(--vip-gray);
}
.vip-btn-outline:hover {
    border-color: var(--vip-dark);
    color: var(--vip-dark);
}

.vip-btn-cart {
    background: var(--vip-primary);
    color: white;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.vip-btn-cart:hover {
    background: var(--vip-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

@media (max-width: 768px) {
    .vip-page-header { flex-direction: column; text-align: center; gap: 20px; }
    .vip-header-profile { flex-direction: column; }
    .vip-stats-grid { grid-template-columns: 1fr; }
    .vip-products-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; }
}

@media (max-width: 480px) {
    .vip-products-grid { grid-template-columns: 1fr !important; }
    .vip-product-card { min-height: 380px; }
    .vip-product-content { padding: 16px; }
}

/* Header fixes for cart and user menu */
.header-cart,
.cart-contents,
.woocommerce-cart-link,
[href*="cart"],
.cart-icon,
.mini-cart-link,
.shopping-cart-link {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
}

/* User dropdown menu fixes */
.account-dropdown,
.user-menu,
.dropdown,
.my-account-dropdown {
    position: relative;
}

.dropdown-menu,
.account-menu,
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 8px 0;
}

.dropdown-menu.show,
.account-menu.show,
.user-dropdown-menu.show {
    display: block !important;
}

.dropdown-menu a,
.account-menu a,
.user-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover,
.account-menu a:hover,
.user-dropdown-menu a:hover {
    background: #f3f4f6;
    color: #1f2937;
}
/* Cart & Checkout VIP Price Styles */
.vip-price {
    color: var(--vip-success) !important;
    font-weight: 700;
}

.cart-table .product-price del,
.woocommerce-checkout .product-price del {
    color: var(--vip-gray);
    text-decoration: line-through;
}

.vip-discount-notice {
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f2ff 100%) !important;
    border: 1px solid #2196F3 !important;
    border-left: 4px solid #2196F3 !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    border-radius: 8px;
}

.vip-discount-notice strong {
    color: #1976D2;
    display: block;
    margin-bottom: 8px;
}