/*
Theme Name: توان پارت
Theme URI: https://tavanpart.webac.ir
Author: توان پارت
Description: قالب اختصاصی فروشگاه لوازم یدکی توان پارت — فارسی، RTL، موبایل‌محور
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
Text Domain: tavanpart
*/

:root {
  --tp-navy: #101D32;
  --tp-blue: #2563EB;
  --tp-bg: #F8FAFC;
  --tp-text: #475569;
  --tp-accent: #06B6D4;
  --tp-white: #ffffff;
  --tp-border: #E2E8F0;
  --tp-muted: #94A3B8;
  --tp-radius: 6px;
  --tp-shadow: 0 1px 2px rgba(16, 29, 50, 0.06);
  --tp-font: "Alibaba", Tahoma, sans-serif;
  --tp-header-h: 72px;
  --tp-mobile-bar-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--tp-font);
  background: var(--tp-bg);
  color: var(--tp-text);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--tp-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--tp-navy); font-weight: 700; line-height: 1.35; margin: 0 0 0.75rem; }
p { margin: 0 0 1rem; }

.tp-container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Header */
.tp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tp-border);
}
.tp-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--tp-header-h);
}
.tp-brand {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--tp-navy);
  white-space: nowrap;
}
.tp-brand:hover { text-decoration: none; color: var(--tp-blue); }
.tp-nav { display: none; gap: 1rem; margin-inline-start: auto; }
.tp-nav a { color: var(--tp-navy); font-weight: 500; }
.tp-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  gap: 0.35rem;
}
.tp-search input {
  flex: 1;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  background: #fff;
}
.tp-search button,
.tp-btn {
  border: 0;
  border-radius: var(--tp-radius);
  background: var(--tp-blue);
  color: #fff;
  padding: 0.65rem 1.1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tp-btn--ghost {
  background: transparent;
  color: var(--tp-navy);
  border: 1px solid var(--tp-border);
}
.tp-btn--accent { background: var(--tp-navy); }
.tp-btn:hover { filter: brightness(1.05); text-decoration: none; }
.tp-menu-toggle {
  display: inline-flex;
  margin-inline-start: auto;
  background: transparent;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  color: var(--tp-navy);
}
.tp-mobile-nav {
  display: none;
  border-top: 1px solid var(--tp-border);
  padding: 0.75rem 0 1rem;
}
.tp-mobile-nav.is-open { display: block; }
.tp-mobile-nav a {
  display: block;
  padding: 0.55rem 0;
  color: var(--tp-navy);
  border-bottom: 1px solid var(--tp-border);
}

/* Hero */
.tp-hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(16, 29, 50, 0.15), rgba(16, 29, 50, 0.78)),
    linear-gradient(135deg, #1e3a5f 0%, #0f172a 55%, #164e63 100%);
  color: #fff;
  overflow: hidden;
}
.tp-hero__content {
  padding: 4rem 0 3.5rem;
  animation: tp-fade-up 0.7s ease both;
}
.tp-hero__brand {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.tp-hero__lead {
  font-size: 1.1rem;
  max-width: 36rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}
.tp-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tp-hero__actions .tp-btn { min-width: 10rem; text-align: center; }
.tp-hero__actions .tp-btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

@keyframes tp-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.tp-section {
  padding: 3.25rem 0;
}
.tp-section__head {
  margin-bottom: 1.5rem;
  animation: tp-fade-up 0.55s ease both;
}
.tp-section__head p { color: var(--tp-muted); margin: 0; }

.tp-grid {
  display: grid;
  gap: 1.25rem;
}
.tp-grid--cats { grid-template-columns: repeat(2, 1fr); }
.tp-grid--products { grid-template-columns: repeat(2, 1fr); }
.tp-grid--posts { grid-template-columns: 1fr; }

.tp-cat-link,
.tp-product-card,
.tp-post-card,
.tp-video-card,
.tp-qa-item {
  background: var(--tp-white);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tp-cat-link:hover,
.tp-product-card:hover,
.tp-post-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  text-decoration: none;
}
.tp-cat-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: inherit;
  min-height: 110px;
}
.tp-cat-link strong { color: var(--tp-navy); font-size: 1.05rem; }

.tp-product-card__img {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  border-radius: var(--tp-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.tp-product-card__img img { width: 100%; height: 100%; object-fit: cover; }
.tp-product-card__title { color: var(--tp-navy); font-weight: 700; margin-bottom: 0.35rem; }
.tp-price { color: var(--tp-blue); font-weight: 700; }
.tp-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}

.tp-vehicle-bar {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.tp-vehicle-bar select,
.tp-form input,
.tp-form textarea,
.tp-form select {
  width: 100%;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  background: #fff;
}
.tp-vehicle-bar__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tp-shop-layout {
  display: grid;
  gap: 1.25rem;
}
.tp-filters {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 1rem;
}
.tp-filters-mobile-toggle { display: block; width: 100%; margin-bottom: 1rem; }
.tp-filters-drawer {
  position: fixed;
  inset: auto 0 0 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(16, 29, 50, 0.18);
  padding: 1rem 1rem calc(1rem + var(--tp-mobile-bar-h));
  z-index: 200;
  transform: translateY(110%);
  transition: transform 0.25s ease;
  max-height: 80vh;
  overflow: auto;
}
.tp-filters-drawer.is-open { transform: translateY(0); }
.tp-filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 29, 50, 0.35);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.tp-filters-backdrop.is-open { opacity: 1; pointer-events: auto; }

.tp-mobile-cart-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 150;
  background: #fff;
  border-top: 1px solid var(--tp-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--tp-mobile-bar-h);
}
body.has-mobile-bar { padding-bottom: calc(var(--tp-mobile-bar-h) + 0.5rem); }

.tp-footer {
  background: var(--tp-navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.5rem 0 5.5rem;
  margin-top: 2rem;
}
.tp-footer a { color: #fff; }
.tp-footer__grid {
  display: grid;
  gap: 1.5rem;
}
.tp-footer__brand { font-size: 1.35rem; font-weight: 900; color: #fff; }

.tp-breadcrumb { font-size: 0.9rem; color: var(--tp-muted); margin-bottom: 1rem; }
.tp-breadcrumb a { color: var(--tp-muted); }

.tp-product-layout {
  display: grid;
  gap: 1.5rem;
}
.tp-compat-list { list-style: none; padding: 0; margin: 0; }
.tp-compat-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--tp-border);
}
.tp-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 0.85rem 1rem;
  border-radius: var(--tp-radius);
  margin: 1rem 0;
}
.tp-expert-box {
  border-right: 3px solid var(--tp-accent);
  background: #fff;
  padding: 1rem 1.1rem;
  border-radius: var(--tp-radius);
  border: 1px solid var(--tp-border);
  border-right-width: 3px;
  border-right-color: var(--tp-accent);
}

.tp-form label { display: block; margin-bottom: 0.35rem; color: var(--tp-navy); font-weight: 600; }
.tp-form .tp-field { margin-bottom: 1rem; }
.tp-notice {
  padding: 0.85rem 1rem;
  border-radius: var(--tp-radius);
  margin-bottom: 1rem;
}
.tp-notice--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.tp-notice--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.tp-placeholder-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(6, 182, 212, 0.2)),
    repeating-linear-gradient(45deg, #e2e8f0 0 12px, #f1f5f9 12px 24px);
  border-radius: var(--tp-radius);
  display: grid;
  place-items: center;
  color: var(--tp-navy);
  font-weight: 700;
}

@media (min-width: 768px) {
  .tp-nav { display: flex; }
  .tp-menu-toggle { display: none; }
  .tp-grid--cats { grid-template-columns: repeat(4, 1fr); }
  .tp-grid--products { grid-template-columns: repeat(4, 1fr); }
  .tp-grid--posts { grid-template-columns: repeat(3, 1fr); }
  .tp-shop-layout { grid-template-columns: 260px 1fr; }
  .tp-filters-mobile-toggle,
  .tp-filters-drawer,
  .tp-filters-backdrop,
  .tp-mobile-cart-bar { display: none !important; }
  body.has-mobile-bar { padding-bottom: 0; }
  .tp-footer { padding-bottom: 2.5rem; }
  .tp-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  .tp-product-layout { grid-template-columns: 1.1fr 1fr; }
  .tp-vehicle-bar { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
}
