/*
Theme Name: TopUp Click Pro
Theme URI: https://topupclick.dz
Author: TopUp Click
Description: قالب متجر IPTV والمنصات الرقمية — ووكمرس مع واتساب
Version: 2.0
Requires at least: 6.0
Requires PHP: 7.4
WC requires at least: 7.0
License: GPL v2
Text Domain: topupclick
Tags: rtl-language, woocommerce, e-commerce
*/

/* ══════════════════════════════════════
   VARIABLES & RESET
══════════════════════════════════════ */
:root {
  --primary:  #0a8f5b;
  --primary2: #05553a;
  --dark:     #06251a;
  --light:    #f1fdf6;
  --amber:    #ffb020;
  --text:     #1f2e28;
  --muted:    #5e7a6c;
  --border:   rgba(10,143,91,.14);
  --shadow-sm:0 8px 24px rgba(6,40,24,.08);
  --shadow:   0 18px 50px rgba(6,40,24,.14);
  --shadow-lg:0 28px 70px rgba(6,40,24,.18);
  --radius:   24px;
  --radius-sm:14px;
  --radius-lg:36px;
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family:'Cairo',sans-serif;
  background: #f4fef8;
  color: var(--text);
  overflow-x: hidden;
  direction: rtl;
}

body::before {
  content:'';
  position:fixed;
  inset:0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(10,143,91,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(5,85,58,.05) 0%, transparent 60%);
  pointer-events:none;
  z-index:0;
}

a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
ul { list-style:none; }

.container {
  width: min(1200px, calc(100% - 32px));
  margin: auto;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 14px 0;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.9);
}

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

.logo {
  width:64px; height:64px;
  border-radius:18px;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  box-shadow: 0 8px 24px rgba(6,40,24,.14);
  flex-shrink:0;
}
.logo img { width:100%; height:100%; object-fit:contain; }

.brand-text h2 { font-size:18px; font-weight:900; color:var(--dark); line-height:1.2; }
.brand-text p  { font-size:12px; color:var(--muted); font-weight:700; }

.nav-actions { display:flex; align-items:center; gap:10px; }

.nav-link {
  padding:10px 18px; border-radius:14px; font-weight:800; font-size:14px;
  background:#fff; color:var(--primary);
  border:1.5px solid var(--border);
  transition:.25s;
}
.nav-link:hover { background:var(--light); }

.nav-cta {
  padding:10px 20px; border-radius:14px; font-weight:900; font-size:14px;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff;
  box-shadow: 0 10px 28px rgba(10,143,91,.28);
  transition:.25s;
}
.nav-cta:hover { transform:translateY(-2px); box-shadow:0 14px 32px rgba(10,143,91,.36); color:#fff; }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  padding: 64px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display:inline-flex; align-items:center; gap:10px;
  background:#fff; padding:8px 16px; border-radius:999px;
  box-shadow:var(--shadow-sm); color:var(--primary); font-weight:800; font-size:13px;
  margin-bottom:22px; border:1.5px solid var(--border);
}
.hero-badge .dot {
  width:8px; height:8px; border-radius:50%;
  background:var(--amber);
  box-shadow:0 0 0 3px rgba(255,176,32,.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { box-shadow:0 0 0 3px rgba(255,176,32,.25); }
  50%      { box-shadow:0 0 0 6px rgba(255,176,32,.1);  }
}

.hero-title {
  font-size: clamp(36px,5vw,60px);
  line-height: 1.18;
  color: var(--dark);
  font-weight: 900;
  margin-bottom: 16px;
}

.hero-title .gradient {
  display:block;
  background:linear-gradient(90deg,var(--primary2),var(--primary),#34d399);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

.hero-desc {
  font-size:17px; line-height:1.9; font-weight:700; color:#48655a;
  max-width:480px;
}

.hero-btns { display:flex; gap:12px; margin-top:28px; flex-wrap:wrap; }

.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:14px 22px; border-radius:var(--radius-sm); font-weight:900; font-size:15px;
  transition:.3s; border:none; cursor:pointer; font-family:'Cairo',sans-serif;
}
.btn-primary {
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff; box-shadow:0 14px 36px rgba(10,143,91,.3);
}
.btn-primary:hover { transform:translateY(-3px); box-shadow:0 18px 40px rgba(10,143,91,.38); color:#fff; }

.btn-ghost {
  background:#fff; color:var(--dark);
  border:1.5px solid var(--border);
  box-shadow:var(--shadow-sm);
}
.btn-ghost:hover { transform:translateY(-3px); color:var(--dark); }

/* Hero Stats */
.hero-stats {
  display:flex; gap:20px; margin-top:32px; flex-wrap:wrap;
}
.stat-item {
  background:#fff; border-radius:16px; padding:14px 20px;
  box-shadow:var(--shadow-sm); border:1.5px solid var(--border);
  text-align:center; min-width:100px;
}
.stat-num { font-size:22px; font-weight:900; color:var(--primary); }
.stat-lbl { font-size:11px; font-weight:700; color:var(--muted); margin-top:2px; }

/* Hero Image */
.hero-visual { position:relative; }

.hero-card {
  border-radius:var(--radius-lg);
  background:#fff;
  padding:24px;
  box-shadow:var(--shadow-lg);
  position:relative;
  overflow:hidden;
}

.hero-card::before {
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(135deg,rgba(10,143,91,.03),rgba(5,85,58,.06));
  pointer-events:none;
}

.hero-card-img {
  width:100%; border-radius:20px;
  min-height:340px;
  background:linear-gradient(135deg,#eafff3 0%,#c8f7de 50%,#a8f0c8 100%);
  display:flex; align-items:center; justify-content:center;
  font-size:90px; overflow:hidden;
}
.hero-card-img img { width:100%; height:100%; object-fit:cover; border-radius:20px; }

.floating-badge {
  position:absolute; bottom:28px; left:28px;
  background:#fff; border-radius:20px; padding:16px 20px;
  box-shadow:0 12px 36px rgba(6,40,24,.2);
  min-width:200px;
}
.floating-badge .fb-label { font-size:12px; color:var(--muted); font-weight:700; }
.floating-badge .fb-price { font-size:26px; font-weight:900; color:var(--primary); }
.floating-badge .fb-note  { font-size:11px; color:var(--muted); font-weight:700; }

/* ══════════════════════════════════════
   SECTION BASE
══════════════════════════════════════ */
.section { padding:64px 0; }

.section-head { text-align:center; margin-bottom:40px; }
.section-head h2 {
  font-size:clamp(28px,4vw,40px); color:var(--dark); font-weight:900; margin-bottom:10px;
}
.section-head p {
  font-size:16px; color:var(--muted); font-weight:700;
  max-width:600px; margin:auto; line-height:1.85;
}

/* ══════════════════════════════════════
   SEARCH + FILTER
══════════════════════════════════════ */
.filter-bar {
  background:#fff; border-radius:var(--radius); padding:24px 28px;
  box-shadow:var(--shadow-sm); border:1.5px solid var(--border);
  margin-bottom:32px;
  display:flex; flex-direction:column; gap:18px;
}

.search-wrap {
  display:flex; gap:10px; max-width:560px; margin:auto; width:100%;
}

.search-wrap input {
  flex:1; padding:13px 18px; border-radius:14px;
  border:1.5px solid var(--border);
  font-family:'Cairo',sans-serif; font-weight:700; font-size:14px;
  outline:none; transition:.25s; background:#fafffe;
}
.search-wrap input:focus { border-color:var(--primary); background:#fff; box-shadow:0 0 0 3px rgba(10,143,91,.1); }

.search-wrap button {
  padding:13px 22px; border-radius:14px; border:none;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff; font-weight:900; font-family:'Cairo',sans-serif;
  font-size:14px; cursor:pointer; transition:.25s;
  white-space:nowrap;
}
.search-wrap button:hover { opacity:.9; }

.cat-pills {
  display:flex; justify-content:center; gap:8px; flex-wrap:wrap;
}

.cat-pill {
  padding:8px 18px; border-radius:999px;
  background:#f4fef8; font-weight:800; font-size:13px;
  color:var(--muted); border:1.5px solid transparent;
  cursor:pointer; transition:.25s; font-family:'Cairo',sans-serif;
}
.cat-pill:hover  { border-color:var(--primary); color:var(--primary); background:#fff; }
.cat-pill.active { border-color:var(--primary); color:var(--primary); background:#fff; box-shadow:var(--shadow-sm); }

/* ══════════════════════════════════════
   PRODUCTS GRID
══════════════════════════════════════ */
.products-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
}

.product-card {
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  display:flex; flex-direction:column;
  transition:.3s;
  border:1.5px solid var(--border);
  position:relative;
}

.product-card:hover {
  transform:translateY(-6px);
  box-shadow:var(--shadow-lg);
  border-color:rgba(10,143,91,.2);
}

/* Thumbnail */
.product-thumb {
  width:100%; aspect-ratio:1/1;
  background:linear-gradient(135deg,#eafff3,#d4f4e4);
  display:flex; align-items:center; justify-content:center;
  position:relative; overflow:hidden;
}
.product-thumb img {
  width:100%; height:100%; object-fit:cover;
  transition:.4s;
}
.product-card:hover .product-thumb img { transform:scale(1.05); }

.product-thumb .icon-fallback {
  font-size:50px; line-height:1;
  filter:drop-shadow(0 4px 8px rgba(10,143,91,.2));
}

.badge-sale {
  position:absolute; top:10px; right:10px;
  background:linear-gradient(135deg,#ff4d4d,#e03030);
  color:#fff; font-size:10.5px; font-weight:900;
  padding:4px 10px; border-radius:999px;
  box-shadow:0 4px 12px rgba(255,77,77,.3);
}

.badge-free {
  position:absolute; top:10px; right:10px;
  background:linear-gradient(135deg,var(--amber),#e09010);
  color:#fff; font-size:10.5px; font-weight:900;
  padding:4px 10px; border-radius:999px;
}

/* Body */
.product-body {
  padding:16px;
  display:flex; flex-direction:column; gap:8px;
  flex:1;
}

.product-name {
  font-size:15px; font-weight:900; color:var(--dark);
  line-height:1.3;
}

.product-prices { display:flex; align-items:baseline; gap:8px; }
.price-current { font-size:18px; font-weight:900; color:var(--primary); }
.price-old     { font-size:12px; color:#aab8b0; text-decoration:line-through; font-weight:700; }
.price-inquiry { font-size:13px; font-weight:800; color:#9a9a40; }

.product-note {
  font-size:12px; color:#6a8579; font-weight:700; line-height:1.6;
  background:var(--light); border-radius:10px; padding:8px 10px;
  border-right:3px solid var(--primary);
}

.product-actions {
  margin-top:auto; display:flex; flex-direction:column; gap:6px; padding-top:4px;
}

.btn-order {
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:11px 16px; border-radius:12px;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff; font-weight:900; font-size:13px;
  border:none; cursor:pointer; font-family:'Cairo',sans-serif;
  transition:.25s; text-decoration:none;
}
.btn-order:hover { opacity:.88; transform:translateY(-1px); color:#fff; }

.btn-tg {
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 16px; border-radius:12px;
  background:#f0f8ff; color:#229ed9;
  border:1.5px solid #cce7f5;
  font-weight:800; font-size:12px;
  font-family:'Cairo',sans-serif; cursor:pointer;
  transition:.25s; text-decoration:none;
}
.btn-tg:hover { background:#229ed9; color:#fff; border-color:#229ed9; }

.no-results {
  display:none; text-align:center; padding:40px;
  font-size:17px; font-weight:800; color:var(--muted);
  grid-column:1/-1;
}

/* ══════════════════════════════════════
   SINGLE PRODUCT PAGE
══════════════════════════════════════ */
.woocommerce div.product {
  display:grid; grid-template-columns:1fr 1fr; gap:40px;
  padding:40px 0;
}
.woocommerce div.product .woocommerce-product-gallery { border-radius:var(--radius); overflow:hidden; }
.woocommerce div.product .summary { display:flex; flex-direction:column; gap:14px; }
.woocommerce div.product .product_title { font-size:32px; font-weight:900; color:var(--dark); }
.woocommerce div.product p.price { font-size:26px; font-weight:900; color:var(--primary); }
.woocommerce div.product .woocommerce-product-details__short-description { font-size:15px; color:var(--muted); line-height:1.8; }

/* ══════════════════════════════════════
   WC ONSALE BADGE
══════════════════════════════════════ */
.woocommerce span.onsale {
  background:linear-gradient(135deg,#ff4d4d,#e03030) !important;
  border-radius:999px !important; min-height:unset !important; min-width:unset !important;
  padding:4px 10px !important; font-size:10.5px !important; font-weight:900 !important;
  top:10px !important; right:10px !important; left:auto !important;
  line-height:1.4 !important;
}

/* ══════════════════════════════════════
   CONTACT SECTION
══════════════════════════════════════ */
.contact-section { padding:64px 0; }

.contact-box {
  background:linear-gradient(135deg,var(--dark) 0%,#0d6644 60%,var(--primary) 100%);
  color:#fff; padding:60px 48px;
  border-radius:40px; text-align:center;
  box-shadow:0 32px 80px rgba(10,143,91,.32);
  position:relative; overflow:hidden;
}

.contact-box::before {
  content:'';
  position:absolute; top:-80px; right:-80px;
  width:300px; height:300px; border-radius:50%;
  background:rgba(255,255,255,.04);
  pointer-events:none;
}

.contact-box h2 { font-size:clamp(26px,4vw,40px); font-weight:900; margin-bottom:12px; }
.contact-box p  { font-size:16px; line-height:1.9; opacity:.88; max-width:600px; margin:auto; }

.contact-btns {
  display:flex; justify-content:center; gap:14px; flex-wrap:wrap; margin-top:32px;
}

.btn-wa {
  padding:16px 28px; border-radius:18px; font-weight:900; font-size:15px;
  background:#fff; color:var(--primary);
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  transition:.25s;
}
.btn-wa:hover { transform:translateY(-3px); color:var(--primary); box-shadow:0 12px 32px rgba(0,0,0,.18); }

.btn-tgc {
  padding:16px 28px; border-radius:18px; font-weight:900; font-size:15px;
  background:rgba(255,255,255,.12); color:#fff;
  border:1.5px solid rgba(255,255,255,.25);
  transition:.25s;
}
.btn-tgc:hover { background:rgba(255,255,255,.2); transform:translateY(-3px); color:#fff; }

/* ══════════════════════════════════════
   FLOATING WA
══════════════════════════════════════ */
.wa-float {
  position:fixed; bottom:24px; left:24px;
  width:56px; height:56px; border-radius:50%;
  background:linear-gradient(135deg,#25d366,#1ebe5d);
  display:flex; align-items:center; justify-content:center;
  font-size:26px; color:#fff;
  box-shadow:0 8px 28px rgba(30,190,93,.45);
  z-index:999; transition:.3s; text-decoration:none;
}
.wa-float:hover { transform:scale(1.1); color:#fff; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  padding:32px; text-align:center;
  color:var(--muted); font-weight:700; font-size:14px;
  border-top:1.5px solid var(--border);
  background:rgba(255,255,255,.6);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width:1100px) {
  .products-grid { grid-template-columns:repeat(3,1fr); }
}

@media (max-width:900px) {
  .hero-grid { grid-template-columns:1fr; }
  .hero-visual { display:none; }
}

@media (max-width:768px) {
  .navbar { flex-direction:column; gap:14px; }
  .products-grid { grid-template-columns:repeat(2,1fr); gap:14px; }
  .woocommerce div.product { grid-template-columns:1fr; }
  .contact-box { padding:36px 24px; }
  .filter-bar { padding:18px; }
}

@media (max-width:480px) {
  .products-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
  .product-name { font-size:13px; }
  .price-current { font-size:16px; }
}

/* ══════════════════════════════════════
   FIXES v2.1
══════════════════════════════════════ */

/* إخفاء عنوان الصفحة الذي يضيفه ووردبريس */
.page-title,
.entry-title,
h1.page-title,
.woocommerce-page h1.page-title,
.woocommerce h1.page-title {
  display: none !important;
}

/* إصلاح woocommerce wrapper */
.woocommerce-page .woocommerce,
.woocommerce {
  width: 100%;
}

/* إخفاء breadcrumb */
.woocommerce-breadcrumb { display: none !important; }

/* إصلاح الكارد — منع overflow خارج الـ grid */
.products-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* تحسين شكل الـ product-card في الـ loop */
.products-grid li.product,
.products-grid .product-card {
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}

/* إصلاح WC loop wrapper */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4,1fr) !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: both !important;
}

/* إزالة margin WC الافتراضي */
.woocommerce .products-grid ~ .woocommerce-pagination,
.woocommerce-page .woocommerce-pagination {
  margin-top: 32px;
  text-align: center;
}

/* تحسين صورة المنتج بدون صورة */
.product-thumb .icon-fallback {
  font-size: 56px;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 4px 12px rgba(10,143,91,.18));
}

/* تحسين الـ filter-bar على موبايل */
@media (max-width: 640px) {
  .filter-bar { padding: 14px; gap: 12px; }
  .search-wrap { max-width: 100%; }
  .cat-pills { gap: 6px; }
  .cat-pill { padding: 6px 12px; font-size: 12px; }
  .woocommerce ul.products { grid-template-columns: repeat(2,1fr) !important; gap: 12px !important; }
}

/* loading state */
#tcGrid.loading { opacity: .5; pointer-events: none; transition: opacity .2s; }
#tcGrid { transition: opacity .2s; }

/* تحسين section-head */
.section-head h2 {
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  border-radius: 4px;
  margin: 10px auto 0;
}

/* hero responsive fix */
@media (max-width: 900px) {
  .hero { padding: 40px 0 32px; }
  .hero-stats { gap: 12px; }
  .stat-item { padding: 10px 14px; min-width: 80px; }
  .stat-num { font-size: 18px; }
}

/* navbar scrolled */
.navbar.scrolled {
  box-shadow: 0 8px 32px rgba(6,40,24,.18);
  background: rgba(255,255,255,.96);
}

/* product-thumb as link */
a.product-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg,#eafff3,#d4f4e4);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

a.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .4s;
}

.product-card:hover a.product-thumb img {
  transform: scale(1.05);
}
