/*
Theme Name: Pouya Derakhshan
Theme URI: https://pouyaderakhsh.com
Author: داده پرداز زیتون
Author URI: https://taskline.ir
Description: قالب اختصاصی شرکت پویا درخش - پیشرو در صنعت توزیع و انتقال نیرو. راست‌چین، چندزبانه، مدیریت کامل از طریق وردپرس و ACF.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: pouya
*/

:root {
  --pd-navy-900: #061634;
  --pd-navy-800: #0a1f44;
  --pd-navy-700: #0e2a5e;
  --pd-navy-600: #14387a;
  --pd-gold: #e0b54a;
  --pd-gold-2: #d4a437;
  --pd-gold-soft: #f3d98a;
  --pd-white: #ffffff;
  --pd-light: #f4f6fb;
  --pd-light-2: #e9edf6;
  --pd-text: #1d2436;
  --pd-muted: #6b7585;
  --pd-muted-light: #b9c4dd;
  --pd-radius: 16px;
  --pd-radius-sm: 10px;
  --pd-shadow: 0 14px 40px rgba(6, 22, 52, 0.16);
  --pd-shadow-sm: 0 6px 18px rgba(6, 22, 52, 0.10);
  --pd-maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Vazirmatn", "IRANSans", Tahoma, sans-serif;
  color: var(--pd-text);
  background: var(--pd-white);
  line-height: 1.9;
  direction: rtl;
  font-size: 16px;
}

/* English = left-to-right */
html[dir="ltr"] body { direction: ltr; }
html[dir="ltr"] .pd-footer h4::after { right: auto; left: 0; }
html[dir="ltr"] .pd-logo-text small { text-align: left; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.pd-container { max-width: var(--pd-maxw); margin: 0 auto; padding: 0 20px; }

.pd-section { padding: 70px 0; }
.pd-section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 40px;
  position: relative;
}
.pd-section-title.is-light { color: var(--pd-white); }
.pd-section-title span { color: var(--pd-gold); }

/* Buttons */
.pd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.pd-btn-gold {
  background: linear-gradient(135deg, var(--pd-gold), var(--pd-gold-2));
  color: var(--pd-navy-900);
  box-shadow: 0 8px 22px rgba(224, 181, 74, 0.35);
}
.pd-btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(224, 181, 74, 0.45); }
.pd-btn-outline {
  background: transparent;
  color: var(--pd-gold);
  border: 1.5px solid var(--pd-gold);
}
.pd-btn-outline:hover { background: var(--pd-gold); color: var(--pd-navy-900); }
.pd-btn-sm { padding: 8px 18px; font-size: .82rem; }

/* ============ HEADER ============ */
.pd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 22, 52, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(224, 181, 74, 0.18);
}
.pd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}
.pd-logo { display: flex; align-items: center; gap: 10px; color: var(--pd-white); }
.pd-logo a, .pd-logo-link { display: flex; align-items: center; gap: 10px; }
.pd-logo img { height: 52px; width: auto; }
.pd-logo-text { font-weight: 800; font-size: 1.15rem; }
.pd-logo-text small { display: block; font-size: .62rem; color: var(--pd-gold-soft); font-weight: 500; }

.pd-nav { display: flex; align-items: center; gap: 6px; }
.pd-nav a {
  color: var(--pd-muted-light);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  transition: color .15s, background .15s;
}
.pd-nav a:hover, .pd-nav a.current-menu-item { color: var(--pd-white); background: rgba(255,255,255,.08); }

.pd-header-actions { display: flex; align-items: center; gap: 12px; }
.pd-lang-switch { display: flex; gap: 6px; align-items: center; }
.pd-lang-switch a { display: block; padding: 2px; border-radius: 4px; line-height: 0; }
.pd-lang-switch a img {
  width: 28px; height: 19px; border-radius: 3px; object-fit: cover; display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
  filter: saturate(.9);
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.pd-lang-switch a:hover img { transform: translateY(-1px); filter: saturate(1.1); }
.pd-lang-switch a.active img { box-shadow: 0 0 0 2px var(--pd-gold); filter: none; }

/* ============ MOBILE BOTTOM BAR ============ */
.pd-mobilebar { display: none; }

.pd-burger { display: none; background: none; border: 0; color: var(--pd-white); font-size: 1.6rem; cursor: pointer; }

/* ============ HERO ============ */
.pd-hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  color: var(--pd-white);
  background: var(--pd-navy-900);
  overflow: hidden;
}
.pd-hero-bg { position: absolute; inset: 0; z-index: 0; }
.pd-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.pd-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,22,52,.55) 0%, rgba(6,22,52,.35) 45%, rgba(6,22,52,.9) 100%);
}
.pd-hero-inner { position: relative; z-index: 2; text-align: center; max-width: 760px; margin: 0 auto; padding: 60px 20px; }
.pd-hero h1 {
  font-size: 2.7rem;
  font-weight: 800;
  margin: 0 0 18px;
  line-height: 1.4;
  text-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.pd-hero h1 span { color: var(--pd-gold); }
.pd-hero p { font-size: 1.08rem; color: #e6ecf7; margin: 0 0 30px; }

/* ============ SERVICES ============ */
.pd-services { background: var(--pd-navy-800); }
.pd-services .pd-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.pd-service-card {
  background: var(--pd-navy-700);
  border: 1px solid rgba(224,181,74,.14);
  border-radius: var(--pd-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.pd-service-card:hover { transform: translateY(-6px); border-color: rgba(224,181,74,.5); box-shadow: var(--pd-shadow); }
.pd-service-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.pd-service-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-service-icon {
  position: absolute; top: 10px; right: 10px;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pd-gold), var(--pd-gold-2));
  display: flex; align-items: center; justify-content: center;
  color: var(--pd-navy-900); font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.pd-service-body { padding: 16px 14px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pd-service-body h3 { color: var(--pd-gold); font-size: 1rem; margin: 0; font-weight: 700; }
.pd-service-body p { color: var(--pd-muted-light); font-size: .82rem; margin: 0; flex: 1; }
.pd-service-body .pd-btn { align-self: center; margin-top: 6px; }

/* ============ PRODUCTS ============ */
.pd-products { background: var(--pd-light); }
.pd-products .pd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pd-product-card {
  background: var(--pd-white);
  border-radius: var(--pd-radius);
  overflow: hidden;
  box-shadow: var(--pd-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pd-product-card:hover { transform: translateY(-5px); box-shadow: var(--pd-shadow); }
.pd-product-thumb { aspect-ratio: 16/10; background: #fff; padding: 18px; }
.pd-product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-product-body { padding: 6px 20px 22px; border-top: 1px solid var(--pd-light-2); }
.pd-product-body h3 { color: var(--pd-gold-2); font-size: 1.05rem; margin: 14px 0 8px; font-weight: 700; }
.pd-product-body p { color: var(--pd-muted); font-size: .85rem; margin: 0; }

/* ============ CALCULATOR ============ */
.pd-calc { background: var(--pd-navy-800); }
.pd-calc-panel {
  background: linear-gradient(135deg, var(--pd-navy-700), var(--pd-navy-600));
  border: 1px solid rgba(224,181,74,.2);
  border-radius: 20px;
  padding: 34px;
}
.pd-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.pd-field { display: flex; flex-direction: column; gap: 7px; }
.pd-field label { color: var(--pd-muted-light); font-size: .85rem; font-weight: 600; }
.pd-field select, .pd-field input[type="number"], .pd-field input[type="text"] {
  background: rgba(6,22,52,.55);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: var(--pd-white);
  padding: 11px 14px;
  font-family: inherit;
  font-size: .9rem;
}
.pd-field select option { color: #000; }
.pd-range-wrap { display: flex; flex-direction: column; gap: 8px; }
.pd-range-wrap input[type="range"] { width: 100%; accent-color: var(--pd-gold); }
.pd-range-val { color: var(--pd-gold); font-weight: 700; font-size: .9rem; }
.pd-calc-actions { grid-column: 1 / -1; margin-top: 10px; }
.pd-calc-actions .pd-btn { width: 100%; justify-content: center; font-size: 1.05rem; padding: 14px; }
.pd-calc-result {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(224,181,74,.1);
  border: 1px dashed rgba(224,181,74,.4);
  color: var(--pd-white);
  display: none;
}
.pd-calc-result.show { display: block; }
.pd-calc-result h4 { margin: 0 0 8px; color: var(--pd-gold); }
.pd-calc-result ul { margin: 0; padding-inline-start: 18px; color: var(--pd-muted-light); font-size: .9rem; }

/* ============ PARTNERS ============ */
.pd-partners { background: var(--pd-light); }
.pd-partners .pd-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.pd-partner {
  background: var(--pd-white);
  border: 1px solid var(--pd-light-2);
  border-radius: 12px;
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  transition: transform .15s, box-shadow .15s;
  filter: grayscale(100%);
  opacity: .8;
}
.pd-partner:hover { transform: translateY(-3px); box-shadow: var(--pd-shadow-sm); filter: none; opacity: 1; }
.pd-partner img { max-height: 100%; object-fit: contain; }

/* ============ FOOTER ============ */
.pd-footer { background: var(--pd-navy-900); color: var(--pd-muted-light); padding: 56px 0 24px; }
.pd-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.pd-footer h4 { color: var(--pd-white); font-size: 1.05rem; margin: 0 0 18px; position: relative; padding-bottom: 10px; }
.pd-footer h4::after { content: ""; position: absolute; bottom: 0; right: 0; width: 36px; height: 3px; background: var(--pd-gold); border-radius: 2px; }
.pd-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-footer ul a { font-size: .9rem; transition: color .15s; }
.pd-footer ul a:hover { color: var(--pd-gold); }
.pd-footer-about p { font-size: .9rem; line-height: 1.9; }
.pd-footer-contact li { display: flex; gap: 8px; font-size: .9rem; }
.pd-footer-contact .ic { color: var(--pd-gold); }
.pd-social { display: flex; gap: 10px; margin-top: 16px; }
.pd-social a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  color: var(--pd-white); transition: background .15s, transform .15s;
}
.pd-social a:hover { background: var(--pd-gold); color: var(--pd-navy-900); transform: translateY(-2px); }
.pd-footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }
.pd-footer-bottom a { color: var(--pd-gold); }

/* ============ SINGLE / PAGE ============ */
.pd-page { padding: 60px 0; min-height: 50vh; }
.pd-page h1 { font-size: 2rem; margin-bottom: 24px; }
.pd-page-hero { background: var(--pd-navy-800); color: #fff; padding: 60px 0; text-align: center; }
.pd-page-hero h1 { color: #fff; margin: 0; }
.pd-entry { line-height: 2; }
.pd-entry img { border-radius: 12px; margin: 16px 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .pd-services .pd-grid { grid-template-columns: repeat(3, 1fr); }
  .pd-partners .pd-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .pd-nav, .pd-header-actions .pd-btn { display: none; }
  .pd-burger { display: block; }
  .pd-header.menu-open .pd-nav {
    display: flex; flex-direction: column; position: absolute; top: 74px; right: 0; left: 0;
    background: var(--pd-navy-900); padding: 16px; gap: 4px; border-bottom: 1px solid rgba(224,181,74,.2);
  }

  /* (2) Hero banner keeps its real ratio — no crop, not square */
  .pd-hero { display: block; min-height: 0; align-items: stretch; }
  .pd-hero-bg { position: relative; inset: auto; }
  .pd-hero-bg img { height: auto; object-fit: contain; }
  .pd-hero-bg::after { display: none; }
  .pd-hero-inner { position: relative; padding: 26px 18px 34px; max-width: 100%; }
  .pd-hero h1 { font-size: 1.7rem; }
  .pd-hero p { font-size: 1rem; }

  /* Grids */
  /* (3) services: 2×2 visible (image+title only) + horizontal slide for extras */
  .pd-services .pd-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: calc(50% - 6px);
    gap: 12px;
    overflow-x: auto;
    justify-content: safe center;   /* leftover columns sit centered; slides when overflowing */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .pd-services .pd-grid::-webkit-scrollbar { display: none; }
  .pd-service-card { scroll-snap-align: start; }
  .pd-service-body p,
  .pd-service-body .pd-btn { display: none; }   /* mobile: image + title only */
  /* centre the icon + text */
  .pd-service-card { text-align: center; }
  .pd-service-icon { left: 50%; right: auto; transform: translateX(-50%); }
  .pd-service-body { padding: 12px 12px 14px; display: flex; flex-direction: column; align-items: center; }
  .pd-service-body h3 {
    margin: 0; font-size: .85rem; line-height: 1.6; min-height: 2.7em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  .pd-products .pd-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }    /* (4) products 3 in a row */
  .pd-partners .pd-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }    /* (5) partners 6 cols */
  .pd-calc-grid { grid-template-columns: 1fr; }

  /* (3) hide the main footer on mobile (links moved into the hamburger) */
  .pd-footer { display: none; }

  /* (1) sticky bottom bar — leave room */
  body { padding-bottom: 66px; }
  .pd-mobilebar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    height: 60px; align-items: center; justify-content: space-around;
    background: var(--pd-navy-900); border-top: 1px solid rgba(224,181,74,.25);
    box-shadow: 0 -6px 20px rgba(0,0,0,.35);
  }
  .pd-mobilebar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--pd-muted-light); font-size: .72rem; font-weight: 600; }
  .pd-mobilebar a:hover { color: var(--pd-gold); }
  .pd-mobilebar a .dashicons { font-size: 22px; width: 22px; height: 22px; }
  .pd-mobilebar a.center .ic {
    width: 54px; height: 54px; margin-top: -28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--pd-gold), var(--pd-gold-2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(224,181,74,.45); color: var(--pd-navy-900);
  }
  .pd-mobilebar a.center .dashicons { font-size: 26px; width: 26px; height: 26px; }
  .pd-mobilebar a.center .ic svg { display: block; }
  .pd-mobilebar a.center { color: var(--pd-gold); }
}

@media (max-width: 520px) {
  /* services keep the 2×2 carousel from the rule above */
  .pd-products .pd-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }    /* products stay 3 in a row */
  .pd-partners .pd-grid { grid-template-columns: repeat(6, 1fr); gap: 5px; }    /* partners stay 6 cols */
  .pd-footer-grid { grid-template-columns: 1fr; }
  .pd-hero h1 { font-size: 1.45rem; }

  /* keep tight 3-up / 2-up cards readable on small phones */
  .pd-product-thumb { padding: 6px; aspect-ratio: 1 / 1; }
  .pd-product-body { padding: 6px 8px 12px; border-top: 0; }
  .pd-product-body h3 { font-size: .72rem; margin: 6px 0 0; }
  .pd-product-body p { display: none; }
  .pd-service-body { padding: 10px 8px 14px; }
  .pd-service-body h3 { font-size: .82rem; }
  .pd-service-body p { font-size: .72rem; }
  .pd-service-body .pd-btn { padding: 6px 12px; font-size: .72rem; }
  .pd-partner { height: 52px; padding: 5px; }
  .pd-section { padding: 44px 0; }
  .pd-section-title { font-size: 1.5rem; margin-bottom: 26px; }
}
