/*
Theme Name: IOTCOM Theme
Theme URI: https://iotcom.ir
Author: IOTCOM
Description: قالب اختصاصی وردپرس برای IOTCOM. طراحی تیره با محوریت داده، سازگار با ووکامرس، بدون نیاز به سایدبار/ویجت.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: iotcom-theme
*/

:root{
  --bg:#0B1420;
  --bg-2:#0E1826;
  --panel:#101B2D;
  --panel-soft:#122036;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --text:#E8EEF5;
  --muted:#8CA0B8;
  --muted-2:#5E7290;
  --brand:#2F6FED;
  --brand-2:#5B8CFF;
  --data:#2ADFC8;
  --alert:#F5A742;
  --radius-panel:14px;
  --radius-card:18px;
  --radius-pill:999px;
  --maxw:1180px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *{animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important;}
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Vazirmatn', system-ui, -apple-system, sans-serif;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}

img,svg{display:block; max-width:100%;}
a{color:inherit; text-decoration:none;}
ul{margin:0; padding:0; list-style:none;}
h1,h2,h3,p{margin:0;}

:focus-visible{
  outline:2px solid var(--brand-2);
  outline-offset:3px;
  border-radius:4px;
}

.wrap{max-width:var(--maxw); margin:0 auto; padding:0 24px;}
@media (max-width:640px){ .wrap{padding:0 18px;} }

section{padding:96px 0;}
@media (max-width:760px){ section{padding:64px 0;} }

.section-head{max-width:640px; margin-bottom:48px;}
.section-head h2{font-size:clamp(1.6rem, 3vw, 2.1rem); font-weight:700; letter-spacing:-0.01em;}
.section-head p{color:var(--muted); margin-top:12px; font-size:1.02rem;}

/* ---------- Header ---------- */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(11,20,32,0.85);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.nav-row{
  display:flex; align-items:center; justify-content:space-between;
  height:76px;
}
.logo{display:flex; align-items:center; gap:10px;}
.logo img{max-height:38px; width:auto;}
.logo-mark{width:34px; height:34px; position:relative;}
.logo-word{font-weight:800; font-size:1.15rem; letter-spacing:0.02em; font-family:system-ui, sans-serif;}
.logo-word span{color:var(--brand-2);}

nav.primary ul{display:flex; align-items:center; gap:34px;}
nav.primary a{
  color:var(--muted); font-size:0.96rem; font-weight:500;
  transition:color .15s ease;
}
nav.primary a:hover{color:var(--text);}

.header-actions{display:flex; align-items:center; gap:14px;}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 24px; border-radius:var(--radius-pill);
  font-size:0.94rem; font-weight:600; cursor:pointer;
  border:1px solid transparent; white-space:nowrap;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary{background:var(--brand); color:#fff;}
.btn-primary:hover{background:var(--brand-2); box-shadow:0 8px 24px -8px rgba(47,111,237,0.6); transform:translateY(-1px);}
.btn-ghost{background:transparent; border-color:var(--border-strong); color:var(--text);}
.btn-ghost:hover{border-color:var(--brand-2); color:var(--brand-2);}
.btn-block{width:100%;}

.menu-toggle{
  display:none; width:40px; height:40px; border-radius:10px;
  border:1px solid var(--border-strong); background:transparent;
  color:var(--text); align-items:center; justify-content:center; cursor:pointer;
}

@media (max-width:900px){
  nav.primary{
    position:fixed; inset:76px 0 auto 0; background:var(--bg-2);
    border-bottom:1px solid var(--border);
    padding:20px 24px 28px; transform:translateY(-8px);
    opacity:0; pointer-events:none; transition:opacity .18s ease, transform .18s ease;
    max-height:80vh; overflow:auto;
  }
  nav.primary.open{opacity:1; pointer-events:auto; transform:translateY(0);}
  nav.primary ul{flex-direction:column; align-items:flex-start; gap:4px;}
  nav.primary a{display:block; padding:12px 4px; width:100%; border-bottom:1px solid var(--border);}
  .menu-toggle{display:flex;}
  .header-actions .btn-ghost{display:none;}
}

/* ---------- Hero ---------- */
.hero{padding:76px 0 100px; position:relative; overflow:hidden;}
.hero::before{
  content:''; position:absolute; inset:-20% -10% auto auto; width:640px; height:640px;
  background:radial-gradient(circle, rgba(47,111,237,0.20), transparent 70%);
  pointer-events:none;
}
.hero-grid{
  display:grid; grid-template-columns:1.05fr 0.95fr; gap:64px; align-items:center;
  position:relative;
}
@media (max-width:960px){ .hero-grid{grid-template-columns:1fr; gap:48px;} }

.hero-content{opacity:0; transform:translateY(14px); animation:heroIn .7s ease forwards .1s;}
@keyframes heroIn{ to{opacity:1; transform:translateY(0);} }

.hero h1{
  font-size:clamp(2rem, 4vw, 3rem); font-weight:800; line-height:1.35; letter-spacing:-0.01em;
}
.hero p.lead{color:var(--muted); font-size:1.08rem; margin-top:22px; max-width:52ch;}
.hero-cta{display:flex; gap:14px; margin-top:34px; flex-wrap:wrap;}

.hero-stats{display:flex; gap:36px; margin-top:48px; padding-top:32px; border-top:1px solid var(--border); flex-wrap:wrap;}
.stat b{display:block; font-size:1.5rem; font-weight:800;}
.stat span{color:var(--muted-2); font-size:0.88rem;}

/* ---------- Live widget ---------- */
.live-card{
  background:linear-gradient(180deg, var(--panel), var(--panel-soft));
  border:1px solid var(--border); border-radius:var(--radius-panel);
  padding:26px; opacity:0; transform:translateY(14px); animation:heroIn .7s ease forwards .25s;
}
.live-card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px;}
.live-card-head h3{font-size:0.98rem; font-weight:600;}
.live-pill{
  display:flex; align-items:center; gap:7px; font-size:0.8rem; color:var(--data);
  background:rgba(42,223,200,0.1); border:1px solid rgba(42,223,200,0.28);
  padding:5px 12px; border-radius:var(--radius-pill);
}
.live-dot{width:7px; height:7px; border-radius:50%; background:var(--data); animation:pulseDot 1.8s ease-in-out infinite;}
@keyframes pulseDot{ 0%,100%{opacity:1;} 50%{opacity:.35;} }

.metric-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0; border-bottom:1px solid var(--border);
}
.metric-row:last-of-type{border-bottom:none;}
.metric-label{display:flex; align-items:center; gap:12px; color:var(--muted); font-size:0.92rem;}
.metric-icon{width:34px; height:34px; border-radius:10px; background:var(--panel-soft); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.metric-icon svg{width:17px; height:17px;}
.metric-value{font-weight:700; font-size:1.05rem; font-variant-numeric:tabular-nums; transition:color .3s ease;}
.metric-value.alert{color:var(--alert);}

.live-status{
  margin-top:18px; padding:12px 14px; border-radius:10px;
  background:rgba(42,223,200,0.08); border:1px solid rgba(42,223,200,0.22);
  font-size:0.86rem; color:var(--data); text-align:center; transition:all .3s ease;
}
.live-status.alert{
  background:rgba(245,167,66,0.1); border-color:rgba(245,167,66,0.3); color:var(--alert);
}

/* ---------- Feature cards ---------- */
.grid-4{display:grid; grid-template-columns:repeat(4,1fr); gap:20px;}
@media (max-width:960px){ .grid-4{grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .grid-4{grid-template-columns:1fr;} }

.feature-card{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-card);
  padding:26px; transition:border-color .2s ease, transform .2s ease;
}
.feature-card:hover{border-color:var(--border-strong); transform:translateY(-3px);}
.feature-icon{
  width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:rgba(47,111,237,0.12); border:1px solid rgba(47,111,237,0.25); margin-bottom:18px;
}
.feature-icon svg{width:22px; height:22px; color:var(--brand-2);}
.feature-card h3{font-size:1.05rem; font-weight:700; margin-bottom:10px;}
.feature-card p{color:var(--muted); font-size:0.92rem;}

/* ---------- Solutions ---------- */
.grid-solutions{display:grid; grid-template-columns:repeat(4,1fr); gap:20px;}
@media (max-width:960px){ .grid-solutions{grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .grid-solutions{grid-template-columns:1fr;} }

.solution-card{
  position:relative; border-radius:var(--radius-card); overflow:hidden; height:280px;
  border:1px solid var(--border); display:flex; align-items:flex-end; padding:22px;
  background:linear-gradient(180deg, transparent 30%, rgba(6,10,16,0.92)), var(--sc-bg, var(--panel));
  background-size:cover; background-position:center;
}
.solution-card h3{font-size:1.05rem; font-weight:700; color:#fff;}
.solution-card p{color:rgba(232,238,245,0.75); font-size:0.86rem; margin-top:6px;}

/* ---------- How it works ---------- */
.steps{display:grid; grid-template-columns:repeat(4,1fr); gap:24px; counter-reset:step;}
@media (max-width:900px){ .steps{grid-template-columns:1fr 1fr;} }
@media (max-width:560px){ .steps{grid-template-columns:1fr;} }
.step{padding-top:20px; border-top:2px solid var(--border-strong); position:relative;}
.step-num{font-size:0.86rem; color:var(--brand-2); font-weight:700; font-variant-numeric:tabular-nums; margin-bottom:10px; display:block;}
.step h3{font-size:1rem; font-weight:700; margin-bottom:8px;}
.step p{color:var(--muted); font-size:0.9rem;}

/* ---------- Product ---------- */
.product-panel{
  display:grid; grid-template-columns:0.9fr 1.1fr; gap:0;
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-panel);
  overflow:hidden;
}
@media (max-width:860px){ .product-panel{grid-template-columns:1fr;} }
.product-visual{
  background:radial-gradient(circle at 30% 20%, rgba(47,111,237,0.25), var(--bg-2) 65%);
  display:flex; align-items:center; justify-content:center; padding:48px; min-height:280px;
}
.product-visual img{border-radius:12px; max-height:260px; width:auto; object-fit:contain;}
.product-body{padding:40px;}
@media (max-width:640px){ .product-body{padding:28px;} }
.badge-sale{
  display:inline-block; background:rgba(245,167,66,0.14); color:var(--alert);
  border:1px solid rgba(245,167,66,0.32); font-size:0.78rem; font-weight:600;
  padding:4px 12px; border-radius:var(--radius-pill); margin-bottom:16px;
}
.product-body h3{font-size:1.4rem; font-weight:700;}
.product-specs{margin:22px 0; display:flex; flex-direction:column; gap:10px;}
.product-specs li{display:flex; align-items:flex-start; gap:10px; color:var(--muted); font-size:0.92rem;}
.product-specs li svg{width:16px; height:16px; color:var(--data); margin-top:4px; flex-shrink:0;}
.price-row{display:flex; align-items:baseline; gap:12px; margin:22px 0; font-size:1.05rem;}
.price-row del{color:var(--muted-2); text-decoration:line-through; font-size:0.95rem; opacity:0.8;}
.price-row ins{text-decoration:none; font-size:1.5rem; font-weight:800;}
.price-row .woocommerce-Price-amount{font-family:inherit;}

/* ---------- Blog ---------- */
.grid-blog{display:grid; grid-template-columns:repeat(2,1fr); gap:24px;}
@media (max-width:760px){ .grid-blog{grid-template-columns:1fr;} }
.blog-card{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-card);
  padding:28px; transition:border-color .2s ease;
}
.blog-card:hover{border-color:var(--border-strong);}
.blog-tag{color:var(--brand-2); font-size:0.82rem; font-weight:600; margin-bottom:14px; display:block;}
.blog-card h3{font-size:1.15rem; font-weight:700; line-height:1.5; margin-bottom:12px;}
.blog-card h3 a:hover{color:var(--brand-2);}
.blog-card p{color:var(--muted); font-size:0.92rem;}
.blog-more{margin-top:18px; font-size:0.88rem; font-weight:600; color:var(--text); display:inline-block; border-bottom:1px solid var(--border-strong); padding-bottom:2px;}

/* ---------- Trust ---------- */
.trust-row{
  display:flex; flex-wrap:wrap; gap:16px; justify-content:space-between;
  padding:28px 32px; background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-panel);
}
.trust-item{display:flex; align-items:center; gap:12px; color:var(--muted); font-size:0.9rem;}
.trust-item svg{width:20px; height:20px; color:var(--data); flex-shrink:0;}

/* ---------- CTA ---------- */
.cta-panel{
  background:linear-gradient(135deg, rgba(47,111,237,0.16), rgba(42,223,200,0.08));
  border:1px solid var(--border-strong); border-radius:var(--radius-panel);
  padding:56px; text-align:center;
}
.cta-panel h2{font-size:clamp(1.5rem,3vw,2rem); font-weight:800; margin-bottom:14px;}
.cta-panel p{color:var(--muted); max-width:52ch; margin:0 auto 28px;}

/* ---------- Generic page/post content (About/Contact/Privacy/Blog single) ---------- */
.page-content{color:var(--muted); font-size:1rem;}
.page-content h1{color:var(--text); font-size:clamp(1.6rem,3vw,2.2rem); font-weight:800; margin-bottom:28px;}
.page-content h2{color:var(--text); font-size:1.4rem; font-weight:700; margin:32px 0 14px;}
.page-content h3{color:var(--text); font-size:1.15rem; font-weight:700; margin:26px 0 12px;}
.page-content p{margin-bottom:16px; line-height:1.9;}
.page-content ul, .page-content ol{margin:0 0 16px; padding-inline-start:22px;}
.page-content ul{list-style:disc;}
.page-content ol{list-style:decimal;}
.page-content li{margin-bottom:8px;}
.page-content a{color:var(--brand-2); text-decoration:underline;}
.page-content strong{color:var(--text);}
.page-content img{border-radius:12px; margin:20px 0;}
.post-meta{color:var(--muted-2); font-size:0.88rem; margin-bottom:18px;}

/* ---------- Comments ---------- */
#comments h2{color:var(--text); font-size:1.3rem; font-weight:700;}
.comment-form label{display:block; margin-bottom:6px; color:var(--muted); font-size:0.9rem;}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
  background:var(--bg-2); border:1px solid var(--border-strong); color:var(--text);
  border-radius:8px; padding:10px 12px; width:100%; margin-bottom:16px; font-family:inherit; font-size:0.95rem;
}
.comment-form p.form-submit input{width:auto; margin-bottom:0;}
.comment-form p.comment-form-cookies-consent{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:0.85rem;}
.comment-notes, .logged-in-as{color:var(--muted-2); font-size:0.85rem; margin-bottom:16px;}

/* ---------- Footer ---------- */
footer{border-top:1px solid var(--border); padding:64px 0 32px;}
.footer-grid{display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:40px; padding-bottom:48px;}
@media (max-width:760px){ .footer-grid{grid-template-columns:1fr 1fr; row-gap:32px;} }
@media (max-width:480px){ .footer-grid{grid-template-columns:1fr;} }
.footer-brand p{color:var(--muted); font-size:0.9rem; margin-top:14px; max-width:32ch;}
.footer-col h4{font-size:0.92rem; font-weight:700; margin-bottom:16px;}
.footer-col ul{display:flex; flex-direction:column; gap:10px;}
.footer-col a{color:var(--muted); font-size:0.9rem; transition:color .15s ease;}
.footer-col a:hover{color:var(--text);}
.social-row{display:flex; gap:10px; margin-top:18px;}
.social-row a{
  width:36px; height:36px; border-radius:10px; border:1px solid var(--border-strong);
  display:flex; align-items:center; justify-content:center; transition:border-color .15s ease, color .15s ease;
}
.social-row a:hover{border-color:var(--brand-2); color:var(--brand-2);}
.social-row svg{width:16px; height:16px;}
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px;
  padding-top:28px; border-top:1px solid var(--border); color:var(--muted-2); font-size:0.84rem;
}

/* ================================================================
   WooCommerce overrides — هماهنگ‌سازی صفحات فروشگاه/سبد/حساب کاربری
   با ظاهر تیره قالب (بدون تغییر در عملکرد ووکامرس)
   ================================================================ */
.woocommerce, .woocommerce-page{color:var(--text);}
.woocommerce .wrap, .woocommerce-page .wrap{padding-top:56px; padding-bottom:56px;}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-card);
  padding:18px; text-align:center;
}
.woocommerce ul.products li.product img{border-radius:10px; margin-bottom:14px;}
.woocommerce ul.products li.product .woocommerce-loop-product__title{color:var(--text); font-weight:700;}
.woocommerce ul.products li.product .price{color:var(--muted);}
.woocommerce ul.products li.product .price ins{color:var(--text); text-decoration:none; font-weight:700;}

.woocommerce span.price, .woocommerce-page span.price{color:var(--text); font-weight:700;}
.woocommerce del .amount{color:var(--muted-2) !important;}
.woocommerce ins{text-decoration:none;}

.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce-page a.button{
  background:var(--brand) !important; color:#fff !important; border-radius:var(--radius-pill) !important;
  border:none !important; padding:11px 24px !important; font-weight:600 !important;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover{
  background:var(--brand-2) !important;
}

.woocommerce table.cart, .woocommerce-cart table.cart, .woocommerce table.shop_table{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-panel);
  color:var(--text); border-collapse:separate; overflow:hidden;
}
.woocommerce table.shop_table th{background:var(--panel-soft); color:var(--text); border-bottom:1px solid var(--border);}
.woocommerce table.shop_table td{border-bottom:1px solid var(--border);}

.woocommerce-checkout #payment, .woocommerce-checkout .woocommerce-checkout-review-order-table,
.woocommerce-cart-form, .cart-collaterals .cart_totals{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-panel); padding:20px;
}

.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea,
.woocommerce-page form .form-row select,
.select2-container--default .select2-selection--single{
  background:var(--bg-2) !important; border:1px solid var(--border-strong) !important;
  color:var(--text) !important; border-radius:8px !important; padding:10px 12px !important;
}
.woocommerce form .form-row label{color:var(--muted);}

.woocommerce-MyAccount-navigation ul{border:1px solid var(--border); border-radius:var(--radius-panel); overflow:hidden;}
.woocommerce-MyAccount-navigation li{border-bottom:1px solid var(--border);}
.woocommerce-MyAccount-navigation li a{display:block; padding:12px 16px; color:var(--muted);}
.woocommerce-MyAccount-navigation li.is-active a{color:var(--text); background:var(--panel-soft);}
.woocommerce-MyAccount-content{margin-top:24px;}

.woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-noticeGroup{
  background:var(--panel) !important; border-inline-start:4px solid var(--brand) !important;
  color:var(--text) !important; border-radius:8px; padding:14px 18px !important;
}
.woocommerce-error{border-inline-start-color:var(--alert) !important;}
