/* ==========================================
   BuildingAtoZ - main stylesheet
   ========================================== */

:root {
  --navy: #10233e;
  --navy-light: #17325a;
  --orange: #f5941f;
  --orange-dark: #d97e0d;
  --green-wa: #25d366;
  --bg: #f5f6f8;
  --border: #e1e4e9;
  --text: #202531;
  --text-light: #667085;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.logo span { color: var(--orange); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav > a {
  color: #dfe6f0;
  font-weight: 500;
}
.main-nav > a:hover { color: var(--orange); }

.dropdown { position: relative; cursor: pointer; color: #dfe6f0; }
.dropdown:hover { color: var(--orange); }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  color: var(--text);
  min-width: 190px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 8px 0;
  margin-top: 10px;
  z-index: 60;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
  display: block;
  padding: 9px 16px;
  color: var(--text);
}
.dropdown-menu a:hover { background: var(--bg); color: var(--orange-dark); }

.btn-whatsapp-nav {
  background: var(--green-wa);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: .9rem;
}
.btn-whatsapp-nav:hover { opacity: .9; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  padding: 60px 0;
  text-align: center;
}
.hero h1 { font-size: 2.3rem; margin: 0 0 12px; }
.hero p { color: #cfd8e6; max-width: 600px; margin: 0 auto 22px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: .95rem;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-danger { background: #e03b3b; color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ---------- Section titles ---------- */
.section { padding: 46px 0; }
.section-title {
  font-size: 1.5rem;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Category chips ---------- */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.cat-chip {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 500;
}
.cat-chip.active, .cat-chip:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }

.product-card .thumb {
  width: 100%;
  height: 180px;
  background: #f0f1f4 url('data:image/svg+xml;utf8,') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab0bb;
  font-size: .85rem;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-card .info { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.product-card .cat-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--orange-dark);
  font-weight: 700;
  margin-bottom: 4px;
}
.product-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.product-card .desc { color: var(--text-light); font-size: .87rem; flex: 1; margin-bottom: 10px; }
.product-card .price { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; color: var(--navy); }

.btn-whatsapp {
  background: var(--green-wa);
  color: #fff;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .9rem;
}
.btn-whatsapp:hover { opacity: .9; }

/* ---------- Product detail page ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}
.product-detail .thumb-lg {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f0f1f4;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab0bb;
}
.product-detail .thumb-lg img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { margin-top: 0; }
.product-detail .price { font-size: 1.6rem; color: var(--navy); font-weight: 700; margin: 14px 0; }

.pd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pd-tags .cat-label {
  background: #fdf1e0;
  padding: 5px 12px;
  border-radius: 14px;
  margin-bottom: 0;
  font-size: .74rem;
}
.pd-tags .cat-label:hover { background: var(--orange); color: #fff; }

.pd-short-desc { color: var(--text-light); font-size: .95rem; margin-bottom: 18px; }

.pd-full-desc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  margin-top: 26px;
}
.pd-full-desc h3 { margin-top: 0; }

.pd-toggle-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  margin-top: 26px;
}

.pd-toggle {
  display: inline-flex;
  background: var(--bg);
  border-radius: 24px;
  padding: 4px;
  margin-bottom: 20px;
}
.pd-toggle-btn {
  border: none;
  background: transparent;
  padding: 9px 22px;
  border-radius: 20px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text-light);
}
.pd-toggle-btn.active { background: var(--navy); color: #fff; }

.pd-panel { display: none; }
.pd-panel.active { display: block; }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: 11px 6px; font-size: .92rem; }
.spec-table .spec-label { font-weight: 600; color: var(--text-light); width: 40%; }

.download-list { list-style: none; padding: 0; margin: 0; }
.download-list li { margin-bottom: 10px; }
.download-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg);
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--navy);
}
.download-list a:hover { background: #e6e9ee; }

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
  .main-nav { gap: 12px; }
  .main-nav > a { font-size: .85rem; }
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cfd8e6; margin-top: 50px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 40px 20px;
}
.footer-inner h3, .footer-inner h4 { color: #fff; margin-top: 0; }
.footer-inner span { color: var(--orange); }
.footer-inner a { display: block; margin-bottom: 6px; color: #cfd8e6; }
.footer-inner a:hover { color: var(--orange); }
.copyright { text-align: center; padding: 14px; border-top: 1px solid #23345a; font-size: .82rem; }

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Forms (used by admin too) ---------- */
.form-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 520px;
  margin: 0 auto;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=password],
.form-group input[type=file],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 90px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: .9rem; }
.alert-success { background: #e5f9ee; color: #14804a; border: 1px solid #b7ecd0; }
.alert-error { background: #fdeaea; color: #b42318; border: 1px solid #f7c8c5; }

/* ---------- Admin ---------- */
.admin-body { background: #eef1f5; }
.admin-header {
  background: var(--navy);
  color: #fff;
  padding: 16px 0;
}
.admin-header .container { display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: #cfd8e6; margin-left: 18px; }
.admin-header a:hover { color: var(--orange); }

.admin-wrap { max-width: 1000px; margin: 30px auto; padding: 0 20px; }

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  vertical-align: middle;
}
.admin-table th { color: var(--text-light); font-size: .78rem; text-transform: uppercase; }
.admin-table img.thumb-sm { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }

.action-links a { margin-right: 12px; font-weight: 600; font-size: .85rem; }
.action-links .edit { color: #1a6fd1; }
.action-links .delete { color: #e03b3b; }

.dashboard-stats { display: flex; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 26px;
  flex: 1;
  min-width: 150px;
}
.stat-box .num { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.stat-box .label { color: var(--text-light); font-size: .85rem; }

/* ---------- Admin dynamic rows (specs / downloads builder) ---------- */
.dyn-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.dyn-row .form-group { flex: 1; margin-bottom: 0; }
.dyn-row .btn-remove-row {
  background: #fdeaea;
  color: #b42318;
  border: none;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  flex-shrink: 0;
}
.dyn-row .existing-file {
  font-size: .82rem;
  color: var(--text-light);
  margin-top: 4px;
}
.btn-add-row {
  background: var(--bg);
  border: 1px dashed var(--text-light);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
  margin-top: 6px;
}
