/*
Theme Name: United Polymers
Theme URI: https://unitedpolymers.org
Author: United Polymers
Description: Bilingual (Arabic/English) catalog and quote-request theme for United Polymers.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: united-polymers
*/

:root {
  --ink: #10252f;
  --muted: #5d7078;
  --paper: #f5f8f8;
  --white: #fff;
  --navy: #0b2230;
  --teal: #0a7176;
  --teal-dark: #05575b;
  --line: #dce5e6;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(11, 34, 48, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.section { padding-block: 90px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.main-nav { display: flex; gap: 26px; margin-inline-start: auto; }
.main-nav a { font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.main-nav a:hover { color: var(--teal); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.lang-active { color: var(--teal); }
.lang-sep { margin-inline: 4px; opacity: .5; }
.menu-toggle { display: none; border: 0; background: none; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 26px; border-radius: 8px;
  font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 9px 16px; font-size: 13px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 22px rgba(11,138,143,.28); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; }
.text-link { color: var(--teal); font-weight: 700; font-size: 14px; }
.text-link:hover { color: var(--teal-dark); }

/* Shared headings */
.eyebrow {
  margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--teal);
}
.eyebrow.light { color: #5fd0cf; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 16px; }
h1 { font-size: clamp(36px, 5.4vw, 66px); letter-spacing: -1.6px; }
h2 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.9px; }
h3 { font-size: 19px; }
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 30px;
  margin-bottom: 36px; flex-wrap: wrap;
}
.section-lead { max-width: 460px; color: var(--muted); margin: 0; font-size: 15px; }

/* Hero */
.hero {
  position: relative; min-height: 640px; display: flex; align-items: center;
  color: #fff; background: var(--navy) url("assets/sections/cover.jpg") center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,26,36,.94) 0%, rgba(7,29,39,.78) 45%, rgba(7,29,39,.35) 100%);
}
.hero-content { position: relative; padding-block: 90px; }
.hero-content h1 { max-width: 760px; }
.hero-sub { max-width: 640px; font-size: 17px; color: #d8e5e8; margin-bottom: 30px; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-facts { display: flex; gap: 44px; margin-top: 56px; flex-wrap: wrap; }
.hero-facts div { display: flex; flex-direction: column; }
.hero-facts strong { font-size: 32px; line-height: 1; color: #6bd6d2; }
.hero-facts span { font-size: 13px; color: #c7d7db; margin-top: 6px; }

/* About */
.about { background: var(--white); }
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: center; }
.about-image img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.about-block { margin-bottom: 22px; }
.about-block h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.about-block p { color: var(--muted); margin: 0; font-size: 15px; }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.category-card {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 220px;
  background: var(--navy); display: flex; align-items: end; isolation: isolate;
}
.category-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .78; transition: transform .5s, opacity .3s; z-index: -1;
}
.category-card:hover img { transform: scale(1.06); opacity: .9; }
.category-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(6,25,34,.92), rgba(6,25,34,.08) 75%);
}
.category-card span { color: #fff; font-weight: 700; padding: 22px; font-size: 16px; }
.category-card small { display: block; font-weight: 500; color: #b9d3d6; font-size: 12px; margin-top: 2px; }

/* Products */
.products { background: var(--white); }
.product-tools { display: flex; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; min-width: 290px;
}
.search-icon { font-size: 22px; color: var(--muted); }
.search-box input { border: 0; background: none; padding: 12px 0; outline: none; width: 100%; }
.filter-chips { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--white); color: var(--muted);
  border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.chip:hover, .chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--white); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-media { position: relative; background: #eef3f3; aspect-ratio: 4 / 3; overflow: hidden; cursor: zoom-in; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.code-badge {
  position: absolute; inset-inline-start: 10px; top: 10px;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px; letter-spacing: .3px;
}
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 11px; color: var(--teal); font-weight: 700; }
.product-name { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.45; min-height: 40px; }
.product-qty { font-size: 12px; color: var(--muted); margin: 0; }
.product-action {
  margin-top: auto; border: 1px solid var(--teal); color: var(--teal); background: transparent;
  border-radius: 8px; padding: 9px; font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s;
}
.product-action:hover { background: var(--teal); color: #fff; }
.empty-state { text-align: center; color: var(--muted); padding: 50px 0; }

/* Quote */
.quote { background: var(--navy); color: #fff; }
.quote-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.quote-intro h2 { max-width: 440px; }
.quote-intro > p:not(.eyebrow) { color: #b9ced3; max-width: 460px; }
.quick-contact { display: grid; gap: 12px; margin-top: 34px; }
.contact-pill {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
}
.contact-pill:hover { background: rgba(255,255,255,.12); }
.pill-icon {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); font-size: 18px; flex-shrink: 0;
}
.contact-pill small { display: block; color: #9fb9bf; font-size: 11px; }
.contact-pill strong { font-size: 14px; word-break: break-word; }
.quote-form { background: var(--white); color: var(--ink); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quote-form label { display: block; margin-bottom: 16px; }
.quote-form label > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.quote-form input, .quote-form select, .quote-form textarea {
  width: 100%; border: 1px solid var(--line); background: var(--paper);
  border-radius: 8px; padding: 11px 13px; outline: none; color: var(--ink);
}
.quote-form input:focus, .quote-form select:focus, .quote-form textarea:focus { border-color: var(--teal); }
.quote-form textarea { resize: vertical; }
.form-status { font-size: 13px; font-weight: 700; margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; }
.form-status.ok { background: #e5f6f1; color: #075e50; }
.form-status.error { background: #fdecec; color: #8a1f1f; }
.form-note { font-size: 11px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.contact-icon {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; background: rgba(11,138,143,.1); color: var(--teal);
  font-size: 20px; margin-bottom: 16px;
}
.contact-card h3 { font-size: 17px; }
.contact-card p, .contact-card a { color: var(--muted); font-size: 14px; }
.contact-card .text-link { color: var(--teal); }
.contact-card div a { display: block; padding-block: 4px; min-height: 26px; }

/* Footer */
.site-footer { background: #071923; color: #a9c0c5; padding-block: 30px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.footer-brand .brand-name { color: #fff; }
.footer-inner p { margin: 0; }
.footer-inner > a { color: #6bd6d2; font-weight: 700; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,15,21,.92);
  display: grid; place-items: center; padding: 30px; cursor: zoom-out;
}
.lightbox figure { margin: 0; max-width: min(760px, 92vw); }
.lightbox img { max-height: 78vh; margin-inline: auto; border-radius: 10px; background: #fff; }
.lightbox figcaption { color: #d5e6e9; text-align: center; margin-top: 14px; font-size: 14px; }
.lightbox-close {
  position: absolute; top: 20px; inset-inline-end: 24px;
  background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; line-height: 1;
}

/* RTL-specific tweaks */
[dir="rtl"] .brand-name, [dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }
[dir="rtl"] .hero-overlay {
  background: linear-gradient(270deg, rgba(7,26,36,.94) 0%, rgba(7,29,39,.78) 45%, rgba(7,29,39,.35) 100%);
}

@media (max-width: 1000px) {
  .main-nav { gap: 16px; }
  .nav-quote { display: none; }
  .category-grid, .product-grid { grid-template-columns: repeat(3, 1fr); }
  .about-grid, .quote-grid { gap: 36px; }
}
@media (max-width: 780px) {
  .section { padding-block: 60px; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 74px; inset-inline: 0;
    flex-direction: column; gap: 0; background: var(--white);
    border-bottom: 1px solid var(--line); padding: 10px 20px 18px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; }
  .hero { min-height: 560px; }
  .hero-facts { gap: 26px; }
  .about-grid, .quote-grid { grid-template-columns: 1fr; }
  .about-image { max-width: 460px; }
  .category-grid, .product-grid, .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .search-box { min-width: 100%; }
}
@media (max-width: 520px) {
  .container { width: min(100% - 28px, 1180px); }
  .brand-name { font-size: 16px; }
  .category-grid, .product-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-facts strong { font-size: 26px; }
  .quote-form { padding: 20px; }
  .section-head { align-items: start; }
}
