/* ============================================================
   X2X Converter — Unified Theme
   Single source of truth for all page styles.
   Tool-specific overrides remain in their own pages.
   ============================================================ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #0d6efd;
  --primary-dark:   #0a58ca;
  --secondary:      #6c757d;
  --success:        #2ecc71;
  --bg:             #f8f9fa;
  --bg-white:       #ffffff;
  --text:           #333333;
  --text-muted:     #666666;
  --border:         #dee2e6;
  --border-input:   #cccccc;
  --shadow-sm:      0 2px 4px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.12);
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --nav-bg:         #ffffff;
  --nav-height:     64px;
  --footer-bg:      #1a2035;
  --footer-text:    #b0bac9;
  --footer-heading: #ffffff;
  --footer-link:    #8fa6c8;
  --footer-link-hover: #ffffff;
  --ad-bg:          #f1f3f5;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Allow main content to push footer down */
.page-main { flex: 1; }

/* ─── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--primary);
  margin-bottom: 0.5em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ─── Navigation ────────────────────────────────────────────── */
.x2x-nav {
  background: var(--nav-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links > li > a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  background: #e8f0fe;
  color: var(--primary);
  text-decoration: none;
}

/* Dropdown */
.dropdown { position: relative; }

.dropbtn { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.dropbtn .fa-chevron-down { font-size: 0.7rem; }

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-white);
  min-width: 220px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  z-index: 200;
  padding: 6px 0;
}

.dropdown-content a {
  display: block;
  padding: 9px 18px;
  color: var(--text);
  font-size: 0.875rem;
  transition: background 0.15s;
}
.dropdown-content a:hover {
  background: var(--bg);
  color: var(--primary);
  text-decoration: none;
}

.dropdown:hover .dropdown-content { display: block; }

/* Mobile toggle button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background 0.2s;
}

/* ─── Ad Units ──────────────────────────────────────────────── */
.ad-header-wrap {
  background: var(--ad-bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
  /* no min-height — collapses fully when ad is disabled */
}
.ad-header-wrap:not(:empty) { padding: 8px 0; }

.ad-content-wrap {
  background: var(--ad-bg);
  border-radius: var(--radius-md);
  margin: 0 auto 24px;
  max-width: 1280px;
  text-align: center;
  /* no min-height — collapses fully when ad is disabled */
}
.ad-content-wrap:not(:empty) { padding: 8px; }

/* ─── Page Wrapper ──────────────────────────────────────────── */
.page-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  box-sizing: border-box;
}

/* ─── Tool Container ────────────────────────────────────────── */
.tool-container {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 24px;
}

.tool-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.tool-description {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Form Elements ─────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

textarea { min-height: 180px; resize: vertical; }

.input-group { margin-bottom: 16px; }

/* ─── Buttons ───────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

button:active { transform: translateY(1px); }

.btn-primary, button {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover, button:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover { background: #545b62; }

.btn-success {
  background: var(--success);
  color: #fff;
}

/* Back button */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-decoration: none;
}
.back-button:hover { background: #545b62; color: #fff; text-decoration: none; }

/* ─── Result / Output Area ──────────────────────────────────── */
.result-box {
  margin-top: 20px;
  padding: 18px;
  background: #f7fafc;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

/* ─── Upload / Drop Zone ────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: #f0f5ff;
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ─── Homepage Hero ─────────────────────────────────────────── */
.hero-section {
  text-align: center;
  padding: 60px 24px 50px;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: #fff;
  width: 100%;
}
.hero-title  { font-size: 3rem; color: #fff; margin-bottom: 12px; }
.hero-subtitle { font-size: 1.4rem; color: rgba(255,255,255,0.9); margin-bottom: 10px; }
.hero-description { font-size: 1rem; color: rgba(255,255,255,0.8); max-width: 640px; margin: 0 auto; }

/* ─── Homepage tool categories wrapper ──────────────────────── */
.homepage-tools,
.menu {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 40px;
  box-sizing: border-box;
}

/* ─── Category Sections (Homepage) ──────────────────────────── */
.category-section {
  margin: 40px 0;
  /* no max-width or padding: inherits from .homepage-tools wrapper */
}
.category-title {
  font-size: 1.5rem;
  color: var(--text);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.category-title i { color: var(--primary); margin-right: 8px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}

.tool-info { display: flex; flex-direction: column; gap: 4px; }
.tool-name  { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.tool-description { color: var(--text-muted); font-size: 0.8rem; }
.tool-icon { color: var(--primary); margin-right: 6px; }

/* ─── Blog Cards ────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.blog-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.blog-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.blog-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.blog-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.blog-card-excerpt { color: var(--text-muted); font-size: 0.875rem; flex: 1; }
.blog-card-meta { font-size: 0.78rem; color: #999; margin-top: 10px; }
.blog-card-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

/* ─── Text Analyzer Stat Grid ───────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.11); transform: translateY(-2px); }
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 6px; line-height: 1; }
.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Image Downloader Grid ─────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.image-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: box-shadow 0.2s, transform 0.15s;
}
.image-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.13); transform: translateY(-1px); }
.image-thumb {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  overflow: hidden;
}
.image-thumb img {
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.image-item-meta {
  padding: 5px 7px;
  flex: 1;
}
.image-title {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.image-info {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.75;
}
.img-btn-container {
  display: flex;
  gap: 4px;
  padding: 5px 7px;
  border-top: 1px solid var(--border);
}
.img-btn-container .view-btn,
.img-btn-container .dl-btn {
  flex: 1;
  border: none;
  padding: 4px 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}
.img-btn-container .view-btn { background: var(--primary); color: #fff; }
.img-btn-container .dl-btn   { background: var(--secondary); color: #fff; }

/* ─── Footer ────────────────────────────────────────────────── */
.x2x-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 60px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 50px 24px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  color: var(--footer-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: var(--footer-link);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--footer-link-hover); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.footer-bottom-links a {
  color: var(--footer-link);
  font-size: 0.875rem;
  text-decoration: none;
}
.footer-bottom-links a:hover { color: var(--footer-link-hover); }

.footer-copy {
  color: var(--footer-text);
  font-size: 0.8rem;
  margin: 0;
}
.footer-copy a { color: var(--footer-link); }
.footer-copy a:hover { color: var(--footer-link-hover); }
.footer-copy strong { color: #fff; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 12px 0;
    z-index: 999;
  }
  .nav-links.open { display: flex; }

  .nav-links > li { width: 100%; }
  .nav-links > li > a { padding: 12px 20px; }

  .dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }

  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1.1rem; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid  { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .page-wrapper { padding: 20px 16px; }
  .tool-container { padding: 20px 16px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .homepage-tools, .menu { padding: 0 16px 24px; }
  .blog-section, .blog-section-home { padding: 24px 16px; }
  .blog-section-header { flex-direction: column; align-items: flex-start; }
  .converter, .calculator, .analyzer, .info-section { padding: 20px 16px; }
  .container { padding: 16px 16px 0; }
}

@media (max-width: 420px) {
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.7rem; }
}

/* ============================================================
   LEGACY CLASS ALIASES
   Maps old page class names to modern styles so all tool pages
   render correctly without needing HTML changes.
   ============================================================ */

/* .container acts as the outer page wrapper on some tool pages;
   .converter/.info-section inside it are cards that fill its width */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 0;
  box-sizing: border-box;
}
/* When .converter / .info-section are nested inside .container,
   remove their auto margins so they don't double-center */
.container > .converter,
.container > .calculator,
.container > .analyzer,
.container > .info-section {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

/* .converter, .calculator, .analyzer → tool card + page-level centering */
.converter,
.calculator,
.analyzer {
  width: 100%;
  max-width: 1280px;
  margin: 24px auto 24px;
  padding: 32px;
  box-sizing: border-box;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* .converter h2, h3 headings */
.converter h2,
.calculator h2,
.analyzer h2 {
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8f0fe;
}

/* .upload-area → drop zone style */
.upload-area {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin: 16px 0;
  background: #fafbfc;
}
.upload-area:hover {
  border-color: var(--primary);
  background: #f0f5ff;
}
.upload-area p { margin: 0; color: var(--text-muted); }

/* .upload-btn, .download-btn → button styles */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.upload-btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.download-btn:hover { background: #27ae60; color: #fff; text-decoration: none; }

/* .result → output area */
.result {
  margin-top: 20px;
  padding: 18px;
  background: #f7fafc;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

/* .controls, .control-group → flex layout row */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  align-items: flex-end;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

/* .info-section → article content below the tool */
.info-section {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 40px;
  box-sizing: border-box;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  border: 1px solid var(--border);
  line-height: 1.8;
}
.info-section h2 {
  color: var(--primary);
  font-size: 1.6rem;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.info-section h2:first-child { margin-top: 0; }
.info-section h3 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 8px;
}
.info-section h4 {
  color: var(--text);
  font-size: 1rem;
  margin-top: 16px;
  margin-bottom: 6px;
}
.info-section ul,
.info-section ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.info-section li { margin-bottom: 6px; }

/* .header → old tool header (page-level heading block) */
.header {
  margin-bottom: 24px;
}

/* .input-wrapper → labeled input row */
.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* .button-group → row of buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

/* .preview-container → image/content preview box */
.preview-container {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8f9fa;
  text-align: center;
  padding: 8px;
}
.preview-container img,
.preview-container canvas {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

/* .history → previous conversions list */
.history {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* .progress → progress bar container */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* .output-line → one result line (text tools) */
.output-line {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.output-line:last-child { border-bottom: none; }

/* ─── FAQ styles (used on several tool pages) ───────────────── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-question {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── Step / Feature blocks ─────────────────────────────────── */
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.step-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.step-description { color: var(--text-muted); font-size: 0.9rem; }

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.feature-icon {
  color: var(--primary);
  font-size: 1.4rem;
  min-width: 28px;
}
.feature-title { font-weight: 600; margin-bottom: 4px; }
.feature-desc { color: var(--text-muted); font-size: 0.875rem; }

/* ─── Stat boxes ────────────────────────────────────────────── */
.stat-box {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Effect / size options (image tools) ───────────────────── */
.effect-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.effect-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  background: var(--bg-white);
  user-select: none;
}
.effect-option .effect-icon {
  font-size: 2rem;
  line-height: 1;
}
.effect-option h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.effect-option p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}
.effect-option:hover,
.effect-option.active {
  border-color: var(--primary);
  background: #e8f0fe;
  box-shadow: 0 4px 12px rgba(13,110,253,0.12);
  transform: translateY(-2px);
}
.effect-option:hover h4,
.effect-option.active h4 { color: var(--primary); }

/* Size options grid container */
.size-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

/* Section label inside size-options grid (spans full width) */
.size-section-label {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}

/* Size option card */
.size-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: var(--bg-white);
  text-align: left;
}
.size-option .size-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 6px;
}
.size-option h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 2px;
}
.size-option p {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
}
.size-option small {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.size-option:hover,
.size-option.active {
  border-color: var(--primary);
  background: #e8f0fe;
  box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.size-option:hover h3 { color: var(--primary); }

/* Upload area dragover state */
.upload-area.dragover {
  border-color: var(--primary);
  background: #e8f0fe;
}

/* ─── Info cards ────────────────────────────────────────────── */
.info-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ─── Sitemap page ──────────────────────────────────────────── */
.sitemap-section {
  margin-bottom: 32px;
}
.sitemap-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.sitemap-list li a {
  display: block;
  padding: 10px 14px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.2s, color 0.2s;
}
.sitemap-list li a:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* ─── Radio group / measurement type (calculator pages) ─────── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
}
.radio-group label:has(input:checked) {
  border-color: var(--primary);
  background: #e8f0fe;
  color: var(--primary);
}
.radio-group input[type="radio"] { accent-color: var(--primary); }

.measurement-type { margin-bottom: 20px; }

/* .instructions → numbered instructions block */
.instructions {
  background: #f0f5ff;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
}
.instructions h3 { font-size: 1rem; margin-bottom: 10px; color: var(--primary-dark); }
.instructions ol { padding-left: 20px; }
.instructions li { margin-bottom: 4px; font-size: 0.9rem; color: var(--text-muted); }

/* .bra-recommendation → result sub-section */
.bra-recommendation {
  margin-top: 12px;
  padding: 12px;
  background: #e8f0fe;
  border-radius: var(--radius-sm);
}

/* ─── Floating label inputs ─────────────────────────────────── */
.floating-label {
  position: relative;
  margin-bottom: 20px;
}
.floating-label input {
  padding-top: 20px;
  padding-bottom: 6px;
}
.floating-label .label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s;
}

/* ─── Asset / input groups ──────────────────────────────────── */
.asset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* ─── Blog section (homepage) ───────────────────────────────── */
.blog-section,
.blog-section-home {
  width: 100%;
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 40px 24px;
  box-sizing: border-box;
}
.blog-section h2,
.blog-section-home h2 {
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 24px;
}

/* Blog section header row (title + view all link) */
.blog-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.blog-section-header h2 { margin: 0; color: var(--text); font-size: 1.8rem; }
.blog-view-all {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.blog-view-all:hover { color: var(--primary-dark); text-decoration: underline; }
.blog-loading { color: #999; text-align: center; padding: 40px 0; }

/* ─── Section headings (homepage sections) ──────────────────── */
.section-heading {
  font-size: 1.8rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  padding-bottom: 14px;
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* ─── Why X2X Section ───────────────────────────────────────── */
.why-x2x-section {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 40px;
  width: 100%;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}
.why-card {
  text-align: center;
  padding: 24px 16px;
}
.why-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 12px;
  display: block;
}
.why-card h4 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 8px;
}
.why-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ─── About / SEO section ───────────────────────────────────── */
.about-section {
  background: var(--bg);
  width: 100%;
}

/* ─── Responsive legacy ─────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .converter,
  .calculator,
  .analyzer { padding: 20px 16px; }
  .info-section { padding: 20px 16px; }
  .controls { flex-direction: column; }
  .radio-group { flex-direction: column; gap: 8px; }
  .sitemap-list { grid-template-columns: 1fr; }
}
