/*
Theme Name: Youtiyeh Art Shop
Theme URI: https://youtiyeh.ir
Author: Youtiyeh Dev Team
Description: قالب اختصاصی فروشگاه آثار هنری باغ هنر یوتیه
Version: 1.1.0
Text Domain: youtiyeh
*/

/* --- فونت پینار --- */
@font-face {
  font-family: 'Pinar';
  src: url('./assets/fonts/Pinar-DS2-FD-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pinar';
  src: url('./assets/fonts/Pinar-DS2-FD-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- متغیرهای طراحی --- */
:root {
  --green: #114931;
  --green-soft: #1c6a49;
  --blue: #2ca9e2;
  --ink: #163127;
  --paper: #f7f5ef;
  --paper-2: #fffefb;
  --line: rgba(17, 73, 49, 0.12);
  --shadow: 0 18px 40px -24px rgba(17, 73, 49, 0.45);
  --shadow-hover: 0 26px 55px -22px rgba(17, 73, 49, 0.55);
  --radius: 20px;
}

/* --- ریست و پایه --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Pinar', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(44, 169, 226, 0.10), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(17, 73, 49, 0.08), transparent 55%),
    var(--paper);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.85;
}

/* اعمال فونت پینار به همه عناصر */
button, input, select, textarea, .btn, .button {
  font-family: 'Pinar', 'Vazirmatn', sans-serif;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 22px 24px;
  flex: 1;
}

/* --- هدر سه‌ستونه --- */
.site-header {
  background: rgba(255, 254, 251, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px -10px rgba(17, 73, 49, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* لوگو - سمت راست */
.header-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.header-logo img {
  height: 52px;
  width: auto;
  transition: transform 0.3s ease;
}
.header-logo:hover img {
  transform: scale(1.05);
}

/* منوی دسته‌بندی - وسط */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 6px;
  padding: 0;
  margin: 0;
  align-items: center;
}

.nav-menu li {
  position: relative;
}

.nav-menu li a {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(.2,.7,.2,1);
  white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a,
.nav-menu li.current-menu-parent a {
  background: rgba(44, 169, 226, 0.12);
  color: var(--blue);
}

/* زیرمنو (dropdown) */
.nav-menu li .sub-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-width: 200px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  list-style: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu li .sub-menu li a {
  padding: 8px 14px;
  font-size: 0.88rem;
  border-radius: 10px;
}

/* آیکون‌ها - سمت چپ */
.header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green);
  text-decoration: none;
  transition: all 0.35s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 4px 12px -6px rgba(17, 73, 49, 0.2);
}

.action-icon:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -8px rgba(44, 169, 226, 0.4);
}

.action-icon svg {
  width: 22px;
  height: 22px;
}

.cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid var(--paper-2);
  transition: transform 0.3s ease;
}

.action-icon:hover .cart-count {
  background: #fff;
  color: var(--blue);
  transform: scale(1.1);
}

/* --- انیمیشن‌ها --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- فوتر --- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 36px 16px;
  color: var(--green);
  opacity: 0.75;
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.site-footer a { color: var(--blue); text-decoration: none; }

/* --- ریسپانسیو هدر --- */
@media (max-width: 968px) {
  .header-inner {
    gap: 16px;
  }
  .nav-menu {
    gap: 4px;
  }
  .nav-menu li a {
    padding: 8px 14px;
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none; /* در موبایل منو مخفی می‌شود - بعداً همبرگری اضافه می‌کنیم */
  }
  .header-inner {
    padding: 12px 16px;
  }
  .header-logo img {
    height: 44px;
  }
  .action-icon {
    width: 42px;
    height: 42px;
  }
  .action-icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 8px;
  }
}

/* --- دکمه همبرگری --- */
.hamburger-btn {
  display: none; /* فقط در موبایل نمایش داده می‌شود */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 4px 12px -6px rgba(17, 73, 49, 0.2);
}

.hamburger-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-3px);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn:hover .hamburger-line {
  background: #fff;
}

/* انیمیشن تبدیل به X وقتی منو باز است */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Overlay (پس‌زمینه تیره) --- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 49, 39, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Drawer (منوی کشویی) --- */
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  right: -100%; /* شروع از بیرون صفحه */
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--paper-2);
  z-index: 999;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(.2,.7,.2,1);
  box-shadow: -10px 0 40px -10px rgba(17, 73, 49, 0.3);
  display: flex;
  flex-direction: column;
}

.mobile-menu-drawer.active {
  right: 0;
}

/* هدر منوی موبایل */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.mobile-menu-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  margin: 0;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  transform: rotate(90deg);
}

.mobile-menu-close svg {
  width: 20px;
  height: 20px;
}

/* لیست منوی موبایل */
.mobile-menu-nav {
  flex: 1;
  padding: 20px;
}

.mobile-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-menu li a {
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.mobile-nav-menu li a:hover,
.mobile-nav-menu li.current-menu-item a,
.mobile-nav-menu li.current-menu-parent a {
  background: rgba(44, 169, 226, 0.12);
  color: var(--blue);
  border-color: rgba(44, 169, 226, 0.2);
  transform: translateX(-4px);
}

/* زیرمنوهای موبایل */
.mobile-nav-menu li .sub-menu {
  list-style: none;
  padding: 8px 0 0 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-menu li .sub-menu li a {
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 400;
}

/* قفل کردن اسکرول body وقتی منو باز است */
body.menu-open {
  overflow: hidden;
}

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
  /* نمایش دکمه همبرگری */
  .hamburger-btn {
    display: flex;
  }
  
  /* مخفی کردن منوی دسکتاپ */
  .header-nav {
    display: none;
  }
  
  /* تنظیمات هدر */
  .header-inner {
    padding: 12px 16px;
  }
  
  .header-logo img {
    height: 44px;
  }
  
  .action-icon {
    width: 42px;
    height: 42px;
  }
  
  .action-icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 8px;
  }
  
  .hamburger-btn {
    width: 42px;
    height: 42px;
  }
  
  .hamburger-line {
    width: 18px;
  }
}

.site-header.sticky {
  position: sticky;
  top: 0;
}

.site-header:not(.sticky) {
  position: relative;
}

/* --- شبکه‌های اجتماعی در هدر --- */
.social-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green);
  text-decoration: none;
  transition: all 0.35s cubic-bezier(.2,.7,.2,1);
}

.social-icon:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-3px) scale(1.1);
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

/* --- اطلاعات تماس در منوی موبایل --- */
.mobile-contact-info {
  padding: 16px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.mobile-contact-item:hover {
  background: rgba(44, 169, 226, 0.12);
  color: var(--blue);
  border-color: rgba(44, 169, 226, 0.3);
  transform: translateX(-4px);
}

.mobile-contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex-shrink: 0;
}

/* --- شبکه‌های اجتماعی در منوی موبایل --- */
.mobile-social-icons {
  padding: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green);
  text-decoration: none;
  transition: all 0.35s cubic-bezier(.2,.7,.2,1);
}

.mobile-social-icon:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-3px) scale(1.1);
}

.mobile-social-icon svg {
  width: 20px;
  height: 20px;
}

/* --- کلاس‌های کمکی --- */
.desktop-only {
  display: flex;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}