/* ==========================================================================
   Centimetar v2 — BAU дизајн систем (teal + red)
   Се вчитува ПОСЛЕ style.css, заменува palette + header + nav + hero
   ========================================================================== */

:root {
  --teal: #0f5157;
  --teal-dark: #082c30;
  --teal-light: #1a7a82;
  --red: #d92b19;
  --red-dark: #b91c1c;
  --white: #ffffff;
  --bg-light: #f4f4f1;
  --text-dark: #1a1a1a;
  --text-mid: #555;
  --border: #e5e5e2;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--text-dark);
  line-height: 1.5;
}

/* ============ LANGUAGE BAR ============ */
.lang-bar {
  background: var(--teal-dark);
  color: var(--white);
  padding: 6px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 13px;
}
.lang-bar a {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-bar a:hover, .lang-bar a.active {
  opacity: 1;
  font-weight: 600;
}
.lang-bar img { width: 16px; height: 16px; border-radius: 2px; }

/* ============ HEADER ============ */
header.header,
body > header {
  background: var(--teal);
  color: var(--white);
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.cm-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--white);
}
.cm-logo-text {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1;
}
.cm-logo-dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  margin-top: 18px;
}

.cm-search-bar {
  position: relative;
  max-width: 720px;
  width: 100%;
  justify-self: center;
}
.cm-search-bar input {
  width: 100%;
  padding: 14px 20px 14px 52px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
  outline: none;
  color: var(--text-dark);
}
.cm-search-bar svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--teal);
}
.cm-search-bar button[type="submit"] {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.cm-header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.cm-header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}
.cm-header-action svg { width: 22px; height: 22px; }
.cm-header-action .cm-cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.cm-help-btn {
  background: var(--white);
  color: var(--teal);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.cm-help-btn::before { content: "✦"; color: var(--red); }

/* ============ NAVIGATION ============ */
nav.cm-nav {
  background: var(--teal);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--white);
  flex-wrap: wrap;
}
.cm-menu-toggle {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 14px 0;
  display: flex;
  align-items: center;
}
.cm-nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 0;
  position: relative;
}
.cm-nav-link:hover { color: #ffdf6a; }
.cm-nav-link.diy {
  font-style: italic;
  font-weight: 700;
}
.cm-nav-link.diy::after {
  content: "Совети";
  font-style: normal;
  font-weight: 400;
  margin-left: 6px;
  font-size: 14px;
  opacity: 0.85;
}

/* ============ BENEFITS BAR ============ */
.cm-benefits {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-size: 14px;
  color: var(--text-dark);
}
.cm-benefit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid var(--border);
}
.cm-benefit:last-child { border-right: none; }
.cm-benefit svg { width: 18px; height: 18px; color: var(--teal); }

/* ============ MAIN HERO GRID (homepage) ============ */
main.cm-main {
  background: var(--bg-light);
  padding: 20px 24px;
  margin: 0;
  max-width: none;
}

.cm-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.cm-hero-card {
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cm-card-catalogue {
  background: var(--teal);
  color: var(--white);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.cm-card-catalogue-content h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 38px;
  line-height: 1.05;
  margin-bottom: 8px;
  color: var(--white);
}
.cm-card-catalogue-content p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 28px;
}
.btn-red {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-red:hover { background: var(--red-dark); }

.cm-card-catalogue-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}
.cm-card-catalogue-visual svg { width: 80%; max-width: 240px; }

.cm-card-product {
  background: var(--teal);
  color: var(--white);
  padding: 28px;
  text-align: center;
}
.cm-card-product-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}
.cm-card-product-image svg { width: 60%; max-width: 180px; }
.cm-card-product h3 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--white);
}
.cm-price {
  font-family: 'Archivo', sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cm-price-arrow { font-size: 20px; }

.cm-card-promo {
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
  color: var(--white);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cm-card-promo-icon {
  font-size: 64px;
  text-align: center;
  margin: 20px 0;
}
.cm-card-promo h3 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--white);
}
.cm-card-promo a {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

/* ============ RENTAL BANNER ============ */
.cm-rental-banner {
  background: var(--teal);
  color: var(--white);
  margin: 16px auto 0;
  max-width: 1600px;
  border-radius: 4px;
  padding: 24px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.cm-rental-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-rental-icon svg { width: 100%; height: 100%; }
.cm-rental-banner h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 26px;
  text-align: center;
  color: var(--white);
}
.btn-white {
  background: var(--white);
  color: var(--teal);
  border: none;
  padding: 14px 28px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
}

/* ============ ALERT BAR ============ */
.cm-alert-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
}
.cm-alert-bar svg.alert-icon { width: 20px; height: 20px; color: #f59e0b; flex-shrink: 0; }
.cm-alert-bar a {
  color: var(--text-dark);
  text-decoration: underline;
  font-weight: 600;
}
.cm-alert-arrow {
  background: none;
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ============ CATEGORIES SECTION (circular) ============ */
.cm-categories {
  background: var(--bg-light);
  padding: 32px 24px;
}
.cm-categories-header {
  max-width: 1600px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cm-categories-header h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--teal);
  position: relative;
  padding-left: 16px;
}
.cm-categories-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--red);
}
.btn-outline {
  background: var(--white);
  color: var(--teal);
  border: 1.5px solid var(--teal);
  padding: 12px 24px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  display: inline-block;
}

.cm-categories-grid {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 16px;
  align-items: start;
}
.cm-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
  cursor: pointer;
}
.cm-category-circle {
  width: 110px;
  height: 110px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cm-category-item:hover .cm-category-circle {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(15, 81, 87, 0.15);
}
.cm-category-circle svg { width: 52px; height: 52px; color: var(--teal); }
.cm-category-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}
.cm-category-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--teal);
  text-decoration: none;
  font-size: 18px;
  align-self: center;
  margin-top: 32px;
}

/* ============ FOOTER (BAU-tinted refresh) ============ */
.footer {
  background: var(--teal-dark);
  color: rgba(255,255,255,0.85);
  margin-top: 40px;
}
.footer h3 { color: var(--white); }
.footer a { color: rgba(255,255,255,0.9); }
.footer a:hover { color: #ffdf6a; }
.footer .footer-admin-link { color: rgba(255,255,255,0.4); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); }

/* ============ Flash messages — keep visible above teal bg ============ */
.flash {
  margin-top: 12px;
  border-radius: 4px;
}

/* ============ SIDE DRAWER (Products) ============ */

/* Hamburger ↔ X toggle on the nav button */
.cm-menu-toggle .cm-icon-close { display: none; }
.cm-menu-toggle.is-open .cm-icon-menu { display: none; }
.cm-menu-toggle.is-open .cm-icon-close { display: block; }
.cm-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

/* The drawer itself: fixed left, slides in from -100% */
.cm-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(380px, 100vw);
  background: var(--white);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 300ms ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
}
.cm-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.cm-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}
.cm-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Header of the drawer */
.cm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--teal);
  color: var(--white);
  flex-shrink: 0;
}
.cm-drawer-head strong {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.cm-drawer-close {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-drawer-close:hover { background: rgba(255, 255, 255, 0.12); }
.cm-drawer-close:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* Scrollable items list */
.cm-drawer-items {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.cm-drawer-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark, #1a1a1a);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}
.cm-drawer-item:hover,
.cm-drawer-item:focus-visible {
  background: var(--bg-light, #f4f4f1);
  outline: none;
}
.cm-drawer-item:focus-visible { box-shadow: inset 3px 0 0 var(--red); }
.cm-drawer-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}
.cm-drawer-icon svg { width: 24px; height: 24px; }
.cm-drawer-label { line-height: 1.3; }
.cm-drawer-chev { color: var(--text-muted, #8a8a8a); flex-shrink: 0; }

/* Footer pinned at bottom */
.cm-drawer-foot {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-light, #f4f4f1);
}
.cm-drawer-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cm-drawer-all-link:hover { color: var(--red); }

/* Desktop: drawer starts BELOW the header (lang-bar + header + nav + benefits ≈ 150px) */
@media (min-width: 1025px) {
  .cm-drawer { top: 150px; width: 380px; }
  .cm-drawer-overlay { top: 150px; }
}
/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
  .cm-drawer { top: 140px; width: 360px; }
  .cm-drawer-overlay { top: 140px; }
}
/* Mobile: drawer covers everything from top */
@media (max-width: 767px) {
  .cm-drawer { top: 0; width: 100%; max-width: 380px; }
  .cm-drawer-overlay { top: 0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .cm-hero-grid { grid-template-columns: 1fr 1fr; }
  .cm-card-catalogue { grid-column: span 2; }
  .cm-categories-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  body > header { grid-template-columns: auto 1fr; }
  .cm-search-bar { grid-column: span 2; order: 3; }
  .cm-header-actions { gap: 12px; }
  .cm-help-btn span { display: none; }
  .cm-benefits { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cm-benefit { font-size: 12px; }
  .cm-hero-grid { grid-template-columns: 1fr; }
  .cm-card-catalogue { grid-column: span 1; grid-template-columns: 1fr; }
  .cm-card-catalogue-visual { display: none; }
  .cm-categories-grid { grid-template-columns: repeat(3, 1fr); }
  .cm-rental-banner { grid-template-columns: 1fr; text-align: center; }
  nav.cm-nav { gap: 16px; overflow-x: auto; padding: 0 16px; }
  .cm-category-circle { width: 88px; height: 88px; }
  .cm-category-circle svg { width: 40px; height: 40px; }
}
