/* ═══════════════════════════════════════════════
   A Square Solutions — Main Stylesheet
   static/css/style.css
════════════════════════════════════════════════ */

:root {
  --red:        #cc0000;
  --dark-red:   #990000;
  --black:      #1a1a1a;
  --dark-grey:  #333;
  --mid-grey:   #666;
  --light-grey: #f5f5f5;
  --border:     #ddd;
  --white:      #ffffff;
  --font-main:  'Georgia', serif;
  --font-body:  'Arial', sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--dark-grey);
  background: var(--white);
  font-size: 15px;
  line-height: 1.7;
}

/* ── TOP BAR ── */
.top-bar {
  background: var(--black);
  color: #ccc;
  font-size: 13px;
  padding: 6px 0;
}
.top-bar .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.top-bar a { color: #ccc; text-decoration: none; }
.top-bar a:hover { color: var(--white); }

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 110px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; text-decoration: none; height: 100%; }
.logo-box {
  width: 48px; height: 48px;
  background: var(--red);
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 4px 6px;
  flex-shrink: 0;
}
.logo-box span { color: white; font-size: 22px; font-weight: bold; font-family: var(--font-main); }
.logo-img { height: 104px; width: auto; max-width: 420px; object-fit: contain; flex-shrink: 0; }
.logo-text h1 { font-family: var(--font-main); font-size: 20px; color: var(--red); line-height: 1.1; letter-spacing: 1px; }
.logo-text p { font-size: 10px; color: var(--mid-grey); letter-spacing: 0.5px; }

/* ── NAV ── */
nav ul { list-style: none; display: flex; align-items: center; gap: 0; }
nav ul li { position: relative; }
nav ul li a, nav ul li span {
  display: block;
  padding: 0 16px;
  height: 110px;
  line-height: 110px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
nav ul li a:hover, nav ul li span:hover,
nav ul li a.active { color: var(--red); }

/* dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: 110px; left: 0;
  background: var(--white);
  border-top: 3px solid var(--red);
  min-width: 240px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 2000;
}
.dropdown a {
  height: auto;
  line-height: 1.4;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 400;
  color: var(--dark-grey);
  text-transform: none;
  border-bottom: 1px solid #f0f0f0;
  display: block;
}
.dropdown a:hover { background: var(--light-grey); color: var(--red); }
nav ul li:hover .dropdown { display: block; }

/* hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.hamburger span { width: 24px; height: 2px; background: var(--black); display: block; transition: all 0.3s; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d0000 50%, #cc0000 100%);
  color: white;
  padding: 90px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(255,255,255,0.02) 60px, rgba(255,255,255,0.02) 62px);
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero h2 { font-family: var(--font-main); font-size: 48px; font-weight: normal; line-height: 1.1; margin-bottom: 16px; }
.hero h2 span { color: #ff6666; }
.hero p { font-size: 18px; opacity: 0.85; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

.btn-hero {
  display: inline-block;
  background: var(--white);
  color: var(--red);
  padding: 14px 36px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin: 6px;
  border: none;
}
.btn-hero:hover { background: var(--red); color: white; }
.btn-hero.outline { background: transparent; color: white; border: 2px solid white; }
.btn-hero.outline:hover { background: white; color: var(--red); }

/* ── CONTENT SECTIONS ── */
.section { padding: 70px 20px; }
.section-grey { background: var(--light-grey); }
.section-red { background: var(--red); color: white; }
.container { max-width: 1200px; margin: 0 auto; }

.section-title {
  font-family: var(--font-main);
  font-size: 32px;
  color: var(--red);
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 50px; height: 3px;
  background: var(--red);
}
.section-title.white { color: white; }
.section-title.white::after { background: white; }
.section-title.center { text-align: center; }
.section-title.center::after { left: 50%; transform: translateX(-50%); }

.lead { font-size: 17px; color: var(--mid-grey); max-width: 700px; margin-bottom: 30px; }

/* ── GRID CARDS ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }

.card {
  background: white;
  border: 1px solid var(--border);
  padding: 36px 32px;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 250px;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.10); transform: translateY(-2px); border-color: var(--red); }
.card-icon {
  font-size: 36px;
  margin-bottom: 18px;
  width: 64px; height: 64px;
  background: var(--light-grey);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card h3 { font-family: var(--font-main); font-size: 22px; color: var(--black); margin-bottom: 12px; line-height: 1.3; }
.card p { font-size: 16px; color: var(--mid-grey); line-height: 1.75; }

/* product / brand image card */
.img-card {
  background: white;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.img-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-3px); }
.img-card-img {
  width: 100%; height: 160px;
  background: var(--light-grey);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  border-bottom: 1px solid var(--border);
}
.img-card-body { padding: 16px; }
.img-card-body h4 { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 4px; }
.img-card-body p { font-size: 12.5px; color: var(--mid-grey); }

/* brand logo card */
.brand-card {
  border: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  background: white;
  text-decoration: none;
  color: inherit;
}
.brand-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.10); border-color: var(--red); }
.brand-logo {
  width: 100%; height: 70px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--mid-grey);
  letter-spacing: 1px;
}
.brand-card p { font-size: 12px; color: var(--mid-grey); }

/* ── STATS BAR ── */
.stats-bar { background: var(--red); padding: 40px 20px; }
.stats-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-num { font-family: var(--font-main); font-size: 44px; color: white; font-weight: normal; }
.stat-label { font-size: 13px; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ── ABOUT CONTENT ── */
.about-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.about-block h3 { font-family: var(--font-main); font-size: 22px; color: var(--red); margin-bottom: 12px; }
.about-block p { color: var(--mid-grey); margin-bottom: 14px; }
.about-block ul { padding-left: 20px; color: var(--mid-grey); }
.about-block ul li { margin-bottom: 6px; }

/* ── BRANDS TICKER ── */
.brands-bar { background: var(--black); padding: 20px; overflow: hidden; }
.brands-ticker { display: flex; gap: 60px; animation: ticker 25s linear infinite; white-space: nowrap; }
.brands-ticker span { color: rgba(255,255,255,0.5); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
@keyframes ticker { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ── PAGE HERO ── */
.page-hero {
  background: var(--black);
  color: white;
  padding: 48px 20px;
  border-bottom: 4px solid var(--red);
}
.page-hero h2 { font-family: var(--font-main); font-size: 38px; font-weight: normal; }
.page-hero p { color: rgba(255,255,255,0.65); margin-top: 6px; font-size: 15px; }
.breadcrumb { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.breadcrumb a { color: rgba(255,255,255,0.4); text-decoration: none; }
.breadcrumb a:hover { color: rgba(255,255,255,0.7); }
.breadcrumb .current { color: var(--red); }

/* ── CONTACT FORM ── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--dark-grey); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--dark-grey);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--red); }
.form-group textarea { min-height: 120px; resize: vertical; }
.btn-submit {
  background: var(--red);
  color: white;
  border: none;
  padding: 14px 36px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--dark-red); }

/* ── SUCCESS BANNER ── */
.alert-success {
  background: #e8f5e9;
  border-left: 4px solid #388e3c;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #2e7d32;
  font-weight: 600;
}

/* ── INFO BOXES ── */
.info-box { background: var(--light-grey); border-left: 4px solid var(--red); padding: 24px; margin-bottom: 24px; }
.info-box h4 { font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 8px; }
.info-box p { color: var(--mid-grey); font-size: 14px; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { background: var(--black); color: white; padding: 12px 16px; text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
table tr:hover td { background: var(--light-grey); }

/* ── PRODUCT / BRAND DETAIL ── */
.detail-icon {
  background: var(--light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
  font-size: 80px;
}
.detail-list {
  color: var(--mid-grey);
  padding-left: 20px;
  line-height: 2;
}
.detail-list li { margin-bottom: 4px; }

/* ── FOOTER ── */
footer { background: var(--black); color: rgba(255,255,255,0.65); padding: 56px 20px 0; }
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.footer-logo-box {
  width: 38px; height: 38px;
  background: var(--red);
  display: flex; align-items: flex-end;
  padding: 3px 5px;
  flex-shrink: 0;
}
.footer-logo-box span { color: white; font-size: 18px; font-weight: bold; font-family: Georgia, serif; }
.footer-logo-img { height: 78px; width: auto; max-width: 320px; object-fit: contain; flex-shrink: 0; }
.footer-logo-name { font-family: Georgia, serif; font-size: 16px; color: white; letter-spacing: 1px; }
.footer-logo-tagline { font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 0.5px; }
.footer-col h5 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--red); display: inline-block; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.55); text-decoration: none; font-size: 13px; }
.footer-col ul li a:hover { color: white; }
.footer-col p { font-size: 13px; line-height: 1.8; }
.contact-detail { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.contact-detail strong { color: white; min-width: 16px; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom-tagline { color: rgba(255,255,255,0.3); }

/* ── STEP BADGE ── */
.step-badge {
  font-size: 28px;
  background: var(--red);
  color: white;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-style: normal;
  font-weight: 700;
}

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 900px) {
  nav ul { display: none; }
  .hamburger { display: flex; }
  nav.open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 110px; left: 0; right: 0;
    background: white;
    border-top: 3px solid var(--red);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 999;
  }
  nav.open ul li a, nav.open ul li span { height: auto; line-height: 1; padding: 14px 20px; border-bottom: 1px solid #eee; }
  .dropdown { position: static; box-shadow: none; border-top: none; background: var(--light-grey); }
  nav.open ul li:hover .dropdown { display: block; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .about-blocks { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 32px; }
}
@media (max-width: 540px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── BRAND LOGO GRID ── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.brand-logo-card {
  border: 1px solid var(--border);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  padding: 0;
  overflow: hidden;
}
.brand-logo-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--red);
  transform: translateY(-3px);
}
.brand-logo-img-wrap {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}
.brand-logo-img-wrap img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}
.brand-logo-fallback {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.brand-logo-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--mid-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  background: var(--light-grey);
  width: 100%;
  border-top: 1px solid var(--border);
}

/* ── BRAND DETAIL LOGO BOX ── */
.brand-detail-logo-box {
  background: var(--light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 40px;
}
.brand-detail-logo-box img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.brand-detail-logo-fallback {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}

/* ── PRODUCT IMAGE CARDS ── */
.img-card-img {
  width: 100%;
  height: 180px;
  background: var(--light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.img-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-card-icon-fallback {
  font-size: 48px;
}

/* ── PRODUCT DETAIL IMAGE ── */
.product-detail-img-box {
  background: var(--light-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
}
.product-detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 400px;
}
.detail-icon-fallback {
  font-size: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  width: 100%;
}

/* ── WHATSAPP FLOATING BUTTON ── */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: #25D366;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.65);
}

/* ── RESPONSIVE BRANDS GRID ── */
@media (max-width: 1100px) {
  .brands-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .brands-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  .brands-grid { grid-template-columns: repeat(2, 1fr); }
  .whatsapp-float { bottom: 18px; right: 18px; width: 50px; height: 50px; }
}

/* ── SHOWCASE SECTION (image + heading + text + button) ── */
.showcase {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.showcase-img-box {
  width: 100%;
  max-width: 460px;
  margin: 0 auto 36px;
  aspect-ratio: 1 / 1;
  background: var(--light-grey);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.showcase-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.showcase-img-placeholder {
  color: var(--mid-grey);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  line-height: 1.6;
}
.showcase h2 { justify-content: center; }
.showcase .lead { max-width: 680px; margin-left: auto; margin-right: auto; font-size: 19px; line-height: 1.8; }

/* ═════════════════════════════════════════════════════════════════════════
   PRODUCT GALLERY - big preview on the left, vertical thumbnail strip
   Hovering a thumbnail swaps the main image. Broken/missing image files
   are pre-checked in JS and never rendered, so no gray placeholder shows.
   (These rules also live inline in product_detail.html's extra_head block;
   kept here too so the gallery still looks right if that block is ever
   trimmed. Safe to keep in both places — duplicate selectors just cascade.)
═════════════════════════════════════════════════════════════════════════ */
.product-gallery {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: transparent;
}
.gallery-main {
  flex: 1;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-main img.loaded { opacity: 1; }

.gallery-thumbs {
  width: 76px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  display: block;
  background: #fff;
}
.gallery-thumb:hover, .gallery-thumb.active {
  border-color: var(--red);
}

.product-detail-img-box.has-gallery {
  background: transparent;
  min-height: 0;
}

@media (max-width: 600px) {
  .product-gallery { flex-direction: column-reverse; }
  .gallery-thumbs {
    width: 100%;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
  }
  .gallery-thumb { width: 64px; flex-shrink: 0; }
}