/* ===== FLOORING CALCULATOR UK — GLOBAL STYLES ===== */
/* Mobile-first, system fonts, warm wood tones */

:root {
  --primary: #92400e;
  --primary-dark: #78350f;
  --primary-light: #b45309;
  --accent: #d97706;
  --bg: #fffbeb;
  --bg-alt: #fef3c7;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-warm: #d6b88a;
  --success: #16a34a;
  --info: #2563eb;
  --warning: #ea580c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --max-width: 1200px;
  --content-width: 800px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.site-logo:hover {
  color: var(--bg-alt);
  text-decoration: none;
}

.site-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.site-nav {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-lg);
}

.site-nav.open {
  display: block;
}

.site-nav ul {
  list-style: none;
  padding: 0;
}

.site-nav li {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.site-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  transition: background 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span {
  margin: 0 0.35rem;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.92;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

.content-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ===== CALCULATOR CARD ===== */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.calculator-card h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg-alt);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(146,64,14,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== RESULTS ===== */
.results-panel {
  background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.results-panel h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.result-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-item .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.result-item .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.result-item .unit {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 400;
}

.result-item.highlight {
  background: var(--primary-dark);
  color: #fff;
}

.result-item.highlight .label {
  color: rgba(255,255,255,0.8);
}

.result-item.highlight .value {
  color: #fff;
}

.result-item.highlight .unit {
  color: rgba(255,255,255,0.7);
}

.result-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(217,119,6,0.2);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  margin-bottom: 2.5rem;
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-alt);
}

.content-section h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--text);
}

.content-section ul,
.content-section ol {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text);
}

.content-section li {
  margin-bottom: 0.4rem;
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table thead {
  background: var(--primary-dark);
  color: #fff;
}

.data-table th {
  padding: 0.7rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

/* ===== INFO BOXES ===== */
.info-box {
  background: #eff6ff;
  border-left: 4px solid var(--info);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.info-box.tip {
  background: #f0fdf4;
  border-color: var(--success);
}

.info-box.warning {
  background: #fff7ed;
  border-color: var(--warning);
}

.info-box strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* ===== FAQ SECTION ===== */
.faq-section {
  margin: 2rem 0;
}

.faq-section h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 2.5rem 1rem 1rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  line-height: 1.4;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
  content: '\2212';
}

.faq-answer {
  display: none;
  padding: 0 1rem 1rem;
  color: var(--text-light);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ===== INTERNAL LINKS GRID ===== */
.calc-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.calc-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: var(--text);
}

.calc-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.calc-link .icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.calc-link .link-text h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.15rem;
}

.calc-link .link-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== AD SLOTS ===== */
.ad-slot {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin: 1.5rem 0;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot ins {
  display: block;
  width: 100%;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.35rem;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-col p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ===== UPDATED BADGE ===== */
.updated-badge {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* ===== ABOUT / CONTACT / POLICY ===== */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-content h1 {
  font-size: 1.75rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.page-content h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin: 1.5rem 0 0.5rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.page-content li {
  margin-bottom: 0.4rem;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form textarea {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(146,64,14,0.1);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.btn:active {
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .calc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-links {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .header-inner {
    padding: 0 1.5rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0;
  }

  .site-nav li {
    border-bottom: none;
  }

  .site-nav a {
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    border-radius: 4px;
  }

  main {
    padding: 2rem 1.5rem 3rem;
  }

  .calculator-card {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .result-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .calc-links {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .calc-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ===== PRINT ===== */
@media print {
  .site-header, .site-footer, .ad-slot, .nav-toggle { display: none; }
  body { background: #fff; }
  .hero { background: var(--primary-dark); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .results-panel { border: 2px solid #333; }
}
