/*
Theme Name: Kelzar SEO Ultimate
Description: Custom WordPress theme for Kelzar Tile Polishing with CPTs
Author: AI Assistant
Version: 2.0
Text Domain: kelzar
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Noto Sans Arabic', sans-serif; font-size: 1rem; line-height: 1.75;
       background: #f5f7fc; color: #1a2240; direction: rtl; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; padding: 0; margin: 0; }

:root {
  --primary: #253162; --primary2: #1d2abc; --accent: #efbe4e; --red: #cc2d3d;
  --bg: #f5f7fc; --bg2: #edf0f9; --surface: #ffffff;
  --text: #1a2240; --muted: #556080; --border: rgba(37,49,98,.14);
  --shadow: 0 4px 24px rgba(23,33,72,.09); --shadow-md: 0 12px 48px rgba(23,33,72,.12);
  --shadow-lg: 0 24px 80px rgba(23,33,72,.16);
  --r: 16px; --r-lg: 24px; --r-xl: 32px; --r-full: 9999px;
}

html[lang="ar"] .en { display: none !important; }
html[lang="en"] .ar { display: none !important; }
html[lang="en"] { direction: ltr; }

.wrap { width: min(1160px, calc(100% - 2.5rem)); margin-inline: auto; }
.narrow { width: min(800px, calc(100% - 2.5rem)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Header & Nav */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(245,247,252,.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 900; font-size: 1.05rem; }
.brand-icon { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary2)); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(37,49,98,.35); }
.brand-name { line-height: 1.2; }
.brand-name span { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.main-nav { display: flex; gap: .15rem; }
.main-nav a { padding: .6rem .95rem; border-radius: var(--r-full); color: var(--muted); font-weight: 700; font-size: .88rem; transition: .2s; }
.main-nav a:hover { background: rgba(37,49,98,.08); color: var(--primary); }
.header-right { display: flex; gap: .4rem; }
.btn-cta { height: 42px; padding: 0 1.15rem; border-radius: var(--r-full); background: var(--primary); color: #fff; font-weight: 800; font-size: .88rem; display: inline-flex; align-items: center; gap: .4rem; box-shadow: 0 4px 14px rgba(37,49,98,.3); }
.hamburger { display: none; background: #fff; border: 1px solid var(--border); border-radius: 50%; width: 42px; height: 42px; place-items: center; }

/* Sections */
.section { padding: clamp(2.5rem,6vw,4.5rem) 0; }
.section-alt { background: var(--bg2); }
.section-head { margin-bottom: 2.2rem; }
.section-head.center { text-align: center; }
.section-head h2 { font-size: clamp(1.5rem,2.5vw,2.4rem); font-weight: 900; line-height: 1.2; margin-bottom: .6rem; }
.section-head p { color: var(--muted); max-width: 64ch; font-size: .97rem; margin-inline: auto; }

/* Cards & Grid */
.cards-grid { display: grid; gap: 1.2rem; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; box-shadow: var(--shadow); transition: .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.7; margin-bottom: 0;}
.icon-box { width: 52px; height: 52px; border-radius: 15px; font-size: 1.3rem; display: grid; place-items: center; background: rgba(37,49,98,.08); margin-bottom: 1rem; }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 52px; padding: 0 1.5rem; border-radius: var(--r-full); background: var(--primary); color: #fff; font-weight: 800; font-size: .95rem; box-shadow: 0 6px 20px rgba(37,49,98,.3); transition: .2s; }
.btn-primary:hover { background: var(--primary2); transform: translateY(-2px); }

/* Page Hero */
.page-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%); color: #fff; padding: 3.5rem 0; text-align: center; }
.page-hero h1 { font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 900; margin-bottom: 0.5rem; }
.page-hero p { color: rgba(255,255,255,.8); font-size: 1.05rem; }

/* Single Content (Service & Blog) */
.single-content { background: var(--surface); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow); margin-top: -3rem; position: relative; z-index: 10; border: 1px solid var(--border); }
.single-thumb { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r-lg); margin-bottom: 2rem; box-shadow: var(--shadow-md); }
.post-body h2, .post-body h3 { color: var(--primary); font-weight: 800; margin: 2rem 0 1rem; }
.post-body p { margin-bottom: 1.2rem; color: var(--muted); font-size: 1.05rem; line-height: 1.8; }
.post-body ul { list-style: disc; margin-right: 1.5rem; margin-bottom: 1.5rem; color: var(--muted); }
.post-body li { margin-bottom: 0.5rem; }

/* Forms & Review specific */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-md); }
.field { margin-bottom: 1.2rem; display: grid; gap: .4rem; }
.field label { font-weight: 800; font-size: .9rem; color: var(--primary); }
.field input, .field select, .field textarea { width: 100%; padding: .9rem 1rem; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg); color: var(--text); transition: .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary2); box-shadow: 0 0 0 3px rgba(29,42,188,.14); }
.alert-success { background: #d1fae5; color: #065f46; padding: 1rem; border-radius: var(--r); margin-bottom: 1.5rem; font-weight: 700; border: 1px solid #34d399; }

/* Responsive */
@media (max-width: 1024px) {
  .main-nav, .header-right .btn-cta { display: none; }
  .hamburger { display: grid; }
}
@media (max-width: 640px) {
  .cards-3, .cards-4 { grid-template-columns: 1fr; }
  .single-content { margin-top: 0; border-radius: 0; border-left: none; border-right: none; }
}

/* Blog/Service Card overrides */
.article-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--r-lg) var(--r-lg) 0 0; margin: -1.5rem -1.5rem 1.5rem -1.5rem; width: calc(100% + 3rem); }
.service-card { display: flex; flex-direction: column; height: 100%; }
.service-card .btn-primary { margin-top: auto; align-self: flex-start; }

/* Reviews System */
.stars { color: var(--accent); letter-spacing: 2px; margin-bottom: 0.5rem; font-size: 1.1rem; }
.review-text { color: var(--muted); font-style: italic; line-height: 1.6; }
.reviewer-name { font-weight: 800; color: var(--primary); margin-top: 1rem; display: block; }
.reviewed-service { font-size: 0.8rem; color: var(--faint); background: var(--bg2); padding: 0.2rem 0.6rem; border-radius: var(--r-full); display: inline-block; margin-top: 0.4rem; }

/* Footer */
.site-footer { background: #0f152a; color: #d4daf2; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-copy { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; margin-top: 2rem; font-size: 0.9rem; }

/* Star Rating Widget */
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.2rem; }
.star-rating input { display: none; }
.star-rating label { font-size: 2.2rem; color: #cbd5e1; cursor: pointer; transition: color 0.2s; line-height:1; }
.star-rating input:checked ~ label, .star-rating label:hover, .star-rating label:hover ~ label { color: var(--accent); }

/* ── FAQ ACCORDION ── */
.faq-section { background: var(--bg2); border-top: 1px solid var(--border); }
.faq-accordion { display: grid; gap: 1rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow-md); }
.faq-question {
  padding: 1.25rem 1.5rem; font-weight: 800; font-size: 1.05rem;
  color: var(--primary); cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; user-select: none; position: relative;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+'; font-size: 1.5rem; color: var(--accent);
  transition: transform 0.3s; line-height: 1; font-weight: 400;
}
.faq-item[open] .faq-question::after { content: '−'; transform: rotate(180deg); }
.faq-answer {
  padding: 0 1.5rem 1.25rem 1.5rem; color: var(--muted);
  font-size: 0.95rem; line-height: 1.8; border-top: 1px dashed var(--border);
  margin-top: 0.5rem; padding-top: 1rem;
}

/* ── BREADCRUMBS ── */
.breadcrumbs { padding: .75rem 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs a { color: var(--primary); font-weight: 700; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { color: var(--muted); margin: 0 .4rem; }

/* ── WHATSAPP FLOAT ── */
.wa-float {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 9999;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.45); font-size: 1.7rem;
  text-decoration: none; transition: transform .25s, box-shadow .25s;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 10px 28px rgba(37,211,102,.55); }
.wa-float-tooltip {
  position: absolute; left: calc(100% + .75rem); background: #1a2240; color: #fff;
  padding: .4rem .9rem; border-radius: 99px; font-size: .8rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.wa-float:hover .wa-float-tooltip { opacity: 1; }

/* ── 404 PAGE ── */
.page-404 { text-align: center; padding: 6rem 1rem; }
.page-404 .err-code { font-size: clamp(5rem,14vw,10rem); font-weight: 900; color: var(--primary); line-height: 1; opacity: .1; }
.page-404 h1 { font-size: clamp(1.5rem,3vw,2.4rem); font-weight: 900; margin: -2rem 0 1rem; color: var(--primary); }
.page-404 p { color: var(--muted); max-width: 44ch; margin: 0 auto 2rem; }
.page-404 .cta-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ── LANGUAGE SWITCHER ── */
.lang-switcher {
  display: flex; align-items: center; gap: .3rem;
  background: rgba(37,49,98,.08); border-radius: var(--r-full);
  padding: .2rem .3rem;
}
.lang-btn {
  width: 34px; height: 28px; border-radius: var(--r-full);
  font-size: .75rem; font-weight: 800; color: var(--muted);
  display: grid; place-items: center; transition: .2s; cursor: pointer;
  background: none; border: none;
}
.lang-btn.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(37,49,98,.25);
}

/* ── BILINGUAL VISIBILITY ── */
html[lang="ar"] .en-content { display: none !important; }
html[lang="en"] .ar-content { display: none !important; }
html[lang="en"] { direction: ltr; }
html[lang="en"] body { direction: ltr; }
html[lang="en"] .site-header .brand-name span::before { content: 'Tile Polishing Riyadh'; }

/* ── CPT METABOX STYLES (admin) ── */

/* ── CONTACT FORM ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-info-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
  color: #fff; border-radius: var(--r-xl); padding: clamp(1.8rem, 4vw, 2.8rem);
  box-shadow: var(--shadow-lg); position: sticky; top: 5rem;
}
.contact-info-card h3 { font-size: 1.4rem; font-weight: 900; margin-bottom: 1.5rem; }
.contact-info-item {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.4rem; padding-bottom: 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.contact-info-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.contact-info-icon {
  width: 42px; height: 42px; background: rgba(255,255,255,.15);
  border-radius: 12px; display: grid; place-items: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-info-text strong { display: block; font-size: .85rem; color: rgba(255,255,255,.7); margin-bottom: .2rem; }
.contact-info-text a { color: #fff; font-weight: 800; font-size: 1rem; }
.wa-send-btn {
  width: 100%; margin-top: 1.5rem; height: 56px;
  background: #25d366; color: #fff; border-radius: var(--r-full);
  font-size: 1.05rem; font-weight: 900; display: flex; align-items: center;
  justify-content: center; gap: .6rem; cursor: pointer; border: none;
  box-shadow: 0 6px 20px rgba(37,211,102,.4); transition: .2s;
}
.wa-send-btn:hover { background: #1ebe5d; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37,211,102,.5); }
.wa-send-btn:active { transform: translateY(0); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.required-star { color: var(--red); }
.field select option[disabled] { color: #aaa; }
/* Pulse animation on WA button */
@keyframes wa-pulse {
  0%,100% { box-shadow: 0 6px 20px rgba(37,211,102,.4); }
  50% { box-shadow: 0 6px 30px rgba(37,211,102,.7); }
}
.wa-send-btn { animation: wa-pulse 2.5s ease-in-out infinite; }
.wa-send-btn:hover { animation: none; }

/* ── REVIEWS SLIDER ── */
.reviews-slider-wrap {
  position: relative;
  margin: 0 -1rem; padding: 0 1rem; /* Full bleed on mobile */
}
.reviews-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;
  padding-bottom: 2rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
.reviews-slider::-webkit-scrollbar { display: none; }
.reviews-slider .card {
  flex: 0 0 85%;
  min-width: 280px;
  max-width: 400px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .reviews-slider-wrap { margin: 0; padding: 0; }
  .reviews-slider .card { flex: 0 0 calc(33.333% - 1rem); scroll-snap-align: start; }
}
