/* ============================================================
   KartodroM — Global Responsive Styles
   ============================================================ */

/* --- Box sizing --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Base layout containers --- */
.kd-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 40px);
}

/* --- 2-column grids → 1 column on mobile --- */
@media (max-width: 768px) {
  /* All inline-style 2-col grids used on our pages */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }
  /* Featured article 2-col grid */
  article[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Stats bar 3-col */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 2px !important;
  }
  /* 4-col facts bars */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 2px !important;
  }
  /* Padding reduction on small screens */
  section[style*="padding:100px"] { padding: 56px clamp(16px,5vw,40px) !important; }
  section[style*="padding:80px"] { padding: 48px clamp(16px,5vw,40px) !important; }
  /* Hero sections */
  section[style*="min-height:100vh"] { min-height: 90vh !important; }
  section[style*="min-height:60vh"] { min-height: 50vh !important; }
  section[style*="min-height:55vh"] { min-height: 45vh !important; }
  section[style*="min-height:65vh"] { min-height: 55vh !important; }
  /* Race calendar list items */
  div[style*="grid-template-columns:auto 1fr auto"] {
    grid-template-columns: auto 1fr !important;
    grid-template-rows: auto auto !important;
  }
  /* Pricing packages */
  div[style*="grid-template-columns:1fr 1fr"][style*="max-width:900px"] {
    grid-template-columns: 1fr !important;
  }
}

/* --- Tablet: 640px–900px --- */
@media (min-width: 640px) and (max-width: 960px) {
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* --- News featured article on mobile --- */
@media (max-width: 768px) {
  article > div[style*="min-height:340px"] {
    min-height: 220px !important;
  }
  article > img[style*="min-height:340px"] {
    min-height: 220px !important;
  }
}

/* --- Timeline on mobile --- */
@media (max-width: 640px) {
  div[style*="position:absolute;left:80px"] {
    display: none !important;
  }
  div[style*="width:80px;flex-shrink:0"] {
    width: auto !important;
    text-align: left !important;
    padding-right: 0 !important;
  }
}

/* --- Footer responsive --- */
@media (max-width: 768px) {
  footer > div[style*="grid-template-columns:2fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }
  footer > div > div[style*="border-top"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
}

/* --- Images don't overflow --- */
img { max-width: 100%; height: auto; }

/* --- Body top padding for fixed header --- */
body > section:first-of-type,
#page > section:first-of-type { padding-top: 68px; }
/* WooCommerce page dark background */
body.kd-wc-page { background: #111; }
.woocommerce-page .entry-content { background: #111; }

/* ================================================
   Contact Form 7 CI Styling
   ================================================ */
.wpcf7 form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  border-radius: 2px;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: #e63329;
  background: #111;
  outline: none;
}
.wpcf7 select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.wpcf7 textarea {
  min-height: 160px;
  resize: vertical;
}
.wpcf7 .wpcf7-acceptance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.wpcf7 .wpcf7-acceptance input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #e63329;
}
.wpcf7 .wpcf7-acceptance .wpcf7-list-item-label {
  color: #888;
  font-size: 0.85rem;
  line-height: 1.5;
}
.wpcf7 .wpcf7-acceptance a {
  color: #e63329;
  text-decoration: none;
}
.wpcf7 .wpcf7-acceptance a:hover {
  text-decoration: underline;
}
.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
  background: #e63329;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
  align-self: flex-start;
  width: auto;
}
.wpcf7 input[type="submit"]:hover {
  background: #c0251b;
}
.wpcf7 .wpcf7-response-output {
  border: 1px solid #e63329 !important;
  background: #1a1a1a;
  color: #ccc;
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 0.9rem;
}
.wpcf7 .wpcf7-not-valid-tip {
  color: #e63329;
  font-size: 0.8rem;
  margin-top: 4px;
  display: block;
}
.wpcf7 .wpcf7-not-valid input,
.wpcf7 .wpcf7-not-valid select,
.wpcf7 .wpcf7-not-valid textarea {
  border-color: #e63329 !important;
}
/* ============================================================
   GLOBAL PAGE POLISH
   ============================================================ */

/* Ensure all section headings use the design system font */
.kd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #E30613;
  margin-bottom: 12px;
}
.kd-eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 2px;
  background: #E30613;
  flex-shrink: 0;
}

/* Global link inside body */
.kd-content a:not(.kd-btn) { color: #E30613; }

/* Hero section — only the section itself, not child elements */
.kd-hero {
  min-height: 100vh;
}

/* Better image rendering globally */
img { max-width: 100%; height: auto; }

/* Smooth page load */
body {
  animation: kd-fade-in 0.3s ease-out both;
}

/* Section bottom borders for separation */
.kd-section-sep {
  border: none;
  border-top: 1px solid #1a1a1a;
  margin: 0;
}

/* Inner pages: padding top for fixed header */
.kd-inner-page {
  padding-top: 68px;
}

/* Responsive table fix */
@media (max-width: 768px) {
  table { width: 100%; overflow-x: auto; display: block; }
}

/* WooCommerce product price color fix */
.woocommerce-Price-amount.amount {
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 700 !important;
}

/* Product grid on mobile */
@media (max-width: 600px) {
  .kd-products-grid { grid-template-columns: 1fr !important; }
}

/* Improve WC checkout on mobile */
@media (max-width: 768px) {
  .woocommerce-checkout .col2-set {
    display: block !important;
  }
  .woocommerce-checkout .col2-set .col-1,
  .woocommerce-checkout .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    margin-bottom: 24px;
  }
}

/* Page-inner.php fix: ensure padding includes header */
.kd-content {
  min-height: 60vh;
}