/*
Theme Name: Purple Atelier
Theme URI: https://example.com
Author: Purple Atelier Team
Description: قالب اختصاصی، مدرن و شیک فروشگاه لباس با تم صورتی و بنفش مدرن، گلاس‌مورفیسم و دارک مود.
Version: 1.0.5
*/

/* ==========================================================
   ۰. تعریف فونت اختصاصی (Iranian Sans)
   ========================================================== */
@font-face {
  font-family: 'IranianSans';
  src: url('fonts/IranianSans.woff2') format('woff2'),
       url('fonts/IranianSans.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================
   ۱. متغیرهای اصلی تم (Light & Dark)
   ========================================================== */
:root {
  --font-family-base: 'IranianSans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-primary: #fdf2f8;
  --bg-secondary: rgba(255, 255, 255, 0.75);
  --bg-input: #f9fafb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --pink-primary: #ec4899;
  --pink-hover: #db2777;
  --border-color: rgba(244, 114, 182, 0.2);
  --card-shadow: 0 20px 40px -15px rgba(236, 72, 153, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"],
.dark {
  --bg-primary: #0f0f11;
  --bg-secondary: rgba(24, 24, 27, 0.75);
  --bg-input: #18181b;
  --text-main: #f4f4f5;
  --text-muted: #9ca3af;
  --pink-primary: #ec4899;
  --pink-hover: #f472b6;
  --border-color: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(24, 24, 27, 0.65);
  --glass-border: rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   ۲. استایل عمومی، پایه و اعمال فونت به کل سایت
   ========================================================== */
html, body,
h1, h2, h3, h4, h5, h6,
p, span, a, input, button, select, textarea,
.font-sans {
  font-family: var(--font-family-base) !important;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.8;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================
   ۳. چیدمان اصلی حساب کاربری ووکامرس (My Account Layout)
   ========================================================== */
.woocommerce-account .woocommerce {
  display: grid !important;
  grid-template-columns: 280px 1fr !important;
  gap: 2rem !important;
  align-items: start !important;
  max-width: 1200px;
  margin: 2rem auto !important;
  padding: 0 1rem;
}

@media (max-width: 900px) {
  .woocommerce-account .woocommerce {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* ==========================================================
   ۴. منوی سمت راست (Sidebar Navigation)
   ========================================================== */
.woocommerce-MyAccount-navigation,
.myaccount-navigation-wrapper {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 2rem !important;
  padding: 1.25rem !important;
  box-shadow: var(--card-shadow) !important;
}

.woocommerce-MyAccount-navigation ul,
.myaccount-nav-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.6rem !important;
}

.woocommerce-MyAccount-navigation ul li {
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce-MyAccount-navigation ul li a,
.myaccount-nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
  padding: 1rem 1.25rem !important;
  border-radius: 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.woocommerce-MyAccount-navigation ul li a:hover,
.myaccount-nav-item:hover {
  background: rgba(236, 72, 153, 0.08) !important;
  color: var(--pink-primary) !important;
  transform: translateX(-4px);
}

/* حالت انتخاب‌شده (Active) */
.woocommerce-MyAccount-navigation ul li.is-active a,
.myaccount-nav-item.is-active {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.4) !important;
}

/* ==========================================================
   ۵. باکس محتوای سمت چپ (Content Box)
   ========================================================== */
.woocommerce-MyAccount-content {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 2rem !important;
  padding: 2.5rem !important;
  box-shadow: var(--card-shadow) !important;
  min-height: 450px;
}

.woocommerce-MyAccount-content p {
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  font-size: 0.95rem !important;
  color: var(--text-main) !important;
  line-height: 2 !important;
}

.woocommerce-MyAccount-content p strong {
  color: var(--pink-primary) !important;
  font-weight: 900 !important;
}

.woocommerce-MyAccount-content a {
  color: var(--pink-primary) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  transition: opacity 0.2s;
}

.woocommerce-MyAccount-content a:hover {
  opacity: 0.8;
}

/* ==========================================================
   ۶. جداول سفارشات و آدرس‌ها
   ========================================================== */
.woocommerce-MyAccount-content table.shop_table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 12px !important;
  border: none !important;
  background: transparent !important;
  margin-top: 1rem !important;
}

.woocommerce-MyAccount-content table.shop_table thead th {
  padding: 12px 18px !important;
  font-size: 0.8rem !important;
  font-weight: 900 !important;
  color: var(--text-muted) !important;
  text-align: right !important;
  border: none !important;
}

.woocommerce-MyAccount-content table.shop_table tbody tr {
  background-color: var(--bg-secondary) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.woocommerce-MyAccount-content table.shop_table tbody tr:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.1) !important;
}

.woocommerce-MyAccount-content table.shop_table td {
  padding: 1.25rem 1.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  border: none !important;
}

.woocommerce-MyAccount-content table.shop_table tr td:first-child {
  border-top-right-radius: 1.25rem !important;
  border-bottom-right-radius: 1.25rem !important;
}

.woocommerce-MyAccount-content table.shop_table tr td:last-child {
  border-top-left-radius: 1.25rem !important;
  border-bottom-left-radius: 1.25rem !important;
}

/* ==========================================================
   ۷. فرم‌ها، فیلدها و دکمه‌ها
   ========================================================== */
.woocommerce-MyAccount-content form,
.custom-checkout-wrapper form {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.woocommerce-MyAccount-content label,
.custom-checkout-wrapper label {
  display: block !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  margin-bottom: 0.5rem !important;
  color: var(--text-main) !important;
}

.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content input[type="tel"],
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content textarea,
.custom-checkout-wrapper input[type="text"],
.custom-checkout-wrapper input[type="email"],
.custom-checkout-wrapper input[type="password"],
.custom-checkout-wrapper input[type="tel"],
.custom-checkout-wrapper select,
.custom-checkout-wrapper textarea {
  width: 100% !important;
  padding: 0.95rem 1.25rem !important;
  border-radius: 1.25rem !important;
  border: 1px solid var(--border-color) !important;
  background-color: var(--bg-input) !important;
  color: var(--text-main) !important;
  font-size: 0.875rem !important;
  outline: none !important;
  transition: all 0.25s ease !important;
  box-sizing: border-box !important;
}

.woocommerce-MyAccount-content input:focus,
.woocommerce-MyAccount-content select:focus,
.woocommerce-MyAccount-content textarea:focus,
.custom-checkout-wrapper input:focus,
.custom-checkout-wrapper select:focus,
.custom-checkout-wrapper textarea:focus {
  border-color: var(--pink-primary) !important;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15) !important;
  background-color: #ffffff !important;
}

.dark .woocommerce-MyAccount-content input:focus,
.dark .woocommerce-MyAccount-content select:focus,
.dark .woocommerce-MyAccount-content textarea:focus,
.dark .custom-checkout-wrapper input:focus,
.dark .custom-checkout-wrapper select:focus,
.dark .custom-checkout-wrapper textarea:focus {
  background-color: #1f1f23 !important;
}

/* دکمه‌های عمومی */
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content a.button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
  color: #ffffff !important;
  padding: 1rem 2rem !important;
  border-radius: 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 900 !important;
  border: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.3) !important;
  margin-top: 1rem !important;
  width: fit-content !important;
}

.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content a.button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 15px 25px -5px rgba(236, 72, 153, 0.4) !important;
}

/* ==========================================================
   ۸. اعلان‌ها و پیام‌های سیستم
   ========================================================== */
.woocommerce-error, 
.woocommerce-info, 
.woocommerce-message {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-right: 5px solid var(--pink-primary) !important;
  border-radius: 1.5rem !important;
  padding: 1.25rem 1.75rem !important;
  font-weight: 800 !important;
  font-size: 0.875rem !important;
  color: var(--text-main) !important;
  margin-bottom: 2rem !important;
  box-shadow: var(--card-shadow) !important;
  list-style: none !important;
}

/* ==========================================================
   ۹. استایل مدرن صفحه پرداخت (Checkout Page)
   ========================================================== */
.custom-checkout-wrapper form.checkout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
}

@media (min-width: 1024px) {
  .custom-checkout-wrapper form.checkout {
    grid-template-columns: 7fr 5fr !important;
  }
}

.custom-checkout-wrapper #customer_details,
.custom-checkout-wrapper #order_review_heading,
.custom-checkout-wrapper #order_review {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 1.5rem !important;
  padding: 1.5rem !important;
  box-shadow: var(--card-shadow) !important;
}

.custom-checkout-wrapper #place_order {
  width: 100% !important;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
  color: #ffffff !important;
  padding: 1rem !important;
  border-radius: 1.25rem !important;
  font-weight: 900 !important;
  font-size: 0.9rem !important;
  border: none !important;
  box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.4) !important;
  cursor: pointer !important;
  margin-top: 1rem !important;
  transition: all 0.25s ease !important;
}

.custom-checkout-wrapper #place_order:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 15px 25px -5px rgba(236, 72, 153, 0.5) !important;
}

/* ==========================================================
   ۱۰. حالت ریسپانسیو (موبایل)
   ========================================================== */
@media (max-width: 640px) {
  .woocommerce-MyAccount-content {
    padding: 1.5rem !important;
  }

  .woocommerce-MyAccount-content table.shop_table, 
  .woocommerce-MyAccount-content table.shop_table thead, 
  .woocommerce-MyAccount-content table.shop_table tbody, 
  .woocommerce-MyAccount-content table.shop_table th, 
  .woocommerce-MyAccount-content table.shop_table td, 
  .woocommerce-MyAccount-content table.shop_table tr { 
    display: block !important; 
  }

  .woocommerce-MyAccount-content table.shop_table thead {
    display: none !important;
  }

  .woocommerce-MyAccount-content table.shop_table tbody tr {
    margin-bottom: 1rem !important;
    padding: 0.75rem !important;
    border-radius: 1.25rem !important;
  }

  .woocommerce-MyAccount-content table.shop_table tbody td {
    text-align: right !important;
    padding: 0.6rem 0.75rem !important;
    padding-right: 45% !important;
    position: relative !important;
  }

  .woocommerce-MyAccount-content table.shop_table tbody td::before {
    content: attr(data-title);
    position: absolute !important;
    right: 0.75rem !important;
    font-weight: 800 !important;
    color: var(--pink-primary) !important;
  }
}