/* هدر، سبد کوچک و فوتر مشترک سایت (استخراج‌شده از صفحهٔ سبد خرید) برای صفحه‌هایی مثل پروفایل. */

:root { --amber:#f59e0b; --success-bg:#f0fdf4; --success-border:#bbf7d0; --danger-bg:#fff5f5; --overlay:rgba(15,23,42,.45); }

/* ═══ HEADER ═══ */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 700;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 38px;
  height: 38px;
  background: var(--blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-mark i {
  color: #fff;
  font-size: 20px;
}
.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
}
.logo-text span {
  color: var(--blue);
}
.search-bar {
  flex: 1;
  max-width: 520px;
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  height: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}
.search-bar:focus-within {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: var(--text-1);
  background: transparent;
}
.search-bar input::placeholder {
  color: var(--text-4);
}
.search-btn {
  padding: 0 20px;
  background: var(--blue);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
  white-space: nowrap;
}
.search-btn:hover {
  background: var(--blue-dark);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto;
}
.h-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all var(--transition);
  border: none;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  position: relative;
}
.h-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
}
.h-btn i {
  font-size: 22px;
}
.theme-toggle {
  display: none !important;
  overflow: hidden;
}
.theme-toggle i {
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    color var(--transition);
}
.theme-toggle:hover i {
  transform: rotate(25deg) scale(1.08);
}
.theme-toggle .ti-sun {
  color: var(--amber);
}
.theme-toggle .ti-moon {
  color: var(--text-2);
}
.theme-toggle:hover .ti-moon {
  color: var(--blue);
}
.cart-wrap {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.btn-auth-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-auth-pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.btn-auth-pill i {
  font-size: 18px;
}
body.logged-in .btn-auth-pill {
  display: none;
}
.profile-wrapper {
  position: relative;
}
.profile-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-2);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}
body.logged-in .profile-trigger {
  display: flex;
}
.profile-trigger:hover,
.profile-trigger.open {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-trigger-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-chevron {
  font-size: 14px;
  color: var(--text-4);
  transition: transform var(--transition);
}
.profile-trigger.open .profile-chevron {
  transform: rotate(180deg);
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 260px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.profile-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.pdrop-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--blue-light), var(--white));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pdrop-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.pdrop-info-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.pdrop-info-mobile {
  font-size: 12px;
  color: var(--text-3);
  direction: ltr;
  margin-top: 2px;
}
.pdrop-menu {
  padding: 6px 0;
}
.pdrop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  font-family: inherit;
}
.pdrop-item:hover {
  background: var(--blue-light);
  color: var(--blue);
}
.pdrop-item:hover .pdrop-item-ico {
  color: var(--blue);
}
.pdrop-item-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: color var(--transition);
}
.pdrop-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.pdrop-item.logout {
  color: var(--red);
}
.pdrop-item.logout .pdrop-item-ico {
  color: var(--red);
  background: var(--danger-bg);
}
.pdrop-item.logout:hover {
  background: var(--danger-bg);
  color: var(--red);
}


.cart-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  padding: 16px;
}
.cart-wrap:hover .cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* آیتم‌های داخل سبد */
.mini-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.mini-cart-item:last-child {
  border-bottom: none;
}
.mini-cart-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}
.mini-cart-info {
  flex: 1;
  min-width: 0;
}
.mini-cart-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.mini-cart-price {
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
}

/* دکمه‌های تعداد و حذف */
.mini-cart-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mini-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border-radius: 6px;
  padding: 2px;
}
.mini-qty-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.mini-qty-val {
  font-size: 12px;
  font-weight: 700;
  min-width: 15px;
  text-align: center;
}
.mini-remove-btn {
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}
.mini-remove-btn:hover {
  color: var(--red);
}

/* بخش پایینی dropdown */
.mini-cart-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.mini-cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}
.mini-cart-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 42px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.mini-cart-btn-checkout:hover {
  opacity: 0.9;
}
.mini-cart-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 20px 0;
}

/* ═══ FOOTER ═══ */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 44px 32px 28px;
  margin-top: 16px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 36px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.9;
  margin: 12px 0 18px;
}
.footer-social {
  display: flex;
  gap: 8px;
}
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.social-btn:hover {
  background: var(--blue);
  color: #fff;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-1);
}
.footer-col ul li {
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s;
}
.footer-col ul li:hover {
  color: var(--blue);
}
.footer-bottom {
  max-width: 1200px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom p {
  font-size: 12px;
  color: var(--text-4);
}
.footer-trust {
  display: flex;
  gap: 8px;
}
.ftrust {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-4);
}

@media (max-width: 768px) {
  .header, .navbar { padding: 0 16px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer { padding: 32px 16px 20px; }
  .btn-auth-pill span.pill-text { display: none; }
  .btn-auth-pill { padding: 10px; border-radius: 50%; }
  .profile-trigger-name { display: none; }
  .nav-link { display: none; }
}
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
