/* ============================================ */
/* PERCENTAGE OF SALES CALCULATOR - STANDALONE CSS */
/* ============================================ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --accent-dark: #1d4ed8;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --success: #16a34a;
  --warning: #f59e0b;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #3b82f6;
  --accent-light: #1e3a8a;
  --accent-dark: #60a5fa;
  --success: #22c55e;
  --warning: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* NAVBAR */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.nav-logo { font-size: 1.35rem; font-weight: 800; color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

.hamburger { display: block; width: 24px; height: 2px; background: var(--text); position: relative; }
.hamburger::before, .hamburger::after {
  content: ''; position: absolute; width: 24px; height: 2px; background: var(--text); left: 0;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-menu { display: flex; list-style: none; gap: 8px; align-items: center; }
.nav-menu li { list-style: none; }
.nav-menu a {
  padding: 8px 14px; color: var(--text); font-weight: 500;
  font-size: 0.95rem; border-radius: var(--radius);
  transition: all 0.15s ease; text-decoration: none; display: inline-block;
}
.nav-menu a:hover, .nav-menu a.active {
  background: var(--bg-secondary); color: var(--accent); text-decoration: none;
}

.nav-dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; min-width: 260px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); display: none; z-index: 100;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-category { padding: 8px 0; }
.category-label {
  display: block; font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 4px 8px; margin-bottom: 4px;
}
.dropdown-tools { list-style: none; }
.dropdown-tools li { list-style: none; }
.dropdown-tools a {
  display: block; padding: 6px 12px; font-size: 0.9rem; color: var(--text-secondary);
}
.dropdown-tools a:hover { background: var(--bg-secondary); color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.view-all { display: block; padding: 8px 12px; font-weight: 600; color: var(--accent); text-align: center; }
.theme-toggle { background: none; border: none; cursor: pointer; padding: 8px; font-size: 1.1rem; border-radius: var(--radius); }
.nav-theme-item { list-style: none; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-card); flex-direction: column; padding: 20px;
    border-top: 1px solid var(--border); display: none;
    align-items: stretch; gap: 4px;
  }
  .nav-menu.active { display: flex; }
  .nav-dropdown:hover .dropdown-menu {
    position: static; display: block; box-shadow: none; border: none; padding-left: 16px;
  }
  .nav-menu a { display: block; width: 100%; }
}

/* HERO */
.pos-hero {
  padding: 60px 0 40px; text-align: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.pos-hero h1 { font-size: 2.5rem; margin-bottom: 16px; font-weight: 800; }
.pos-hero-subtitle {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 720px; margin: 0 auto 24px; line-height: 1.6;
}
.pos-hero-badge {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 12px; font-size: 0.95rem; color: var(--text-secondary);
}

/* CALCULATOR */
.pos-calculator-section { padding: 60px 0; }

/* TABS */
.pos-tabs-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px; justify-content: center;
}
.pos-tab-btn {
  padding: 12px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-weight: 600; font-size: 0.95rem;
  color: var(--text-secondary); transition: all 0.15s ease;
  font-family: inherit;
}
.pos-tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.pos-tab-btn.active {
  background: var(--accent); color: white; border-color: var(--accent);
}

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

.pos-calc-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; margin-bottom: 48px;
}
.pos-form-card, .pos-result-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.pos-form-title, .pos-result-title {
  font-size: 1.3rem; margin-bottom: 24px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
  font-weight: 700;
}
.pos-field { margin-bottom: 20px; }
.pos-field label {
  display: block; font-weight: 600; font-size: 0.92rem;
  margin-bottom: 8px; color: var(--text);
}
.pos-input-wrap { position: relative; display: flex; align-items: center; }
.pos-input-wrap input {
  width: 100%; padding: 12px 16px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-family: inherit;
  transition: border-color 0.15s ease;
}
.pos-input-wrap input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.pos-input-prefix, .pos-input-suffix {
  position: absolute; font-weight: 600; font-size: 0.9rem;
  color: var(--text-secondary); pointer-events: none;
}
.pos-input-prefix { left: 16px; }
.pos-input-suffix { right: 16px; }
.pos-input-wrap:has(.pos-input-prefix) input { padding-left: 32px; }
.pos-input-wrap:has(.pos-input-suffix) input { padding-right: 50px; }

.pos-btn-group { display: flex; gap: 12px; margin-top: 24px; }
.pos-btn {
  padding: 12px 24px; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius); border: none; cursor: pointer;
  transition: all 0.15s ease; flex: 1; font-family: inherit;
}
.pos-btn.primary { background: var(--accent); color: white; }
.pos-btn.primary:hover {
  background: var(--accent-dark); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.pos-btn.secondary {
  background: var(--bg-secondary); color: var(--text);
  border: 1px solid var(--border);
}
.pos-btn.secondary:hover { background: var(--bg); border-color: var(--accent); }

.pos-highlight-box {
  padding: 28px 24px; border-radius: var(--radius);
  text-align: center; margin-bottom: 24px;
  color: white;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.pos-highlight-box.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.pos-highlight-box.success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}
.pos-result-label {
  font-size: 0.9rem; opacity: 0.9; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.pos-result-value { font-size: 2.5rem; font-weight: 800; line-height: 1.1; }

.pos-breakdown-list { list-style: none; padding: 0; margin: 0 0 20px; }
.pos-breakdown-item {
  display: flex; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem;
}
.pos-breakdown-item:last-child { border-bottom: none; }
.pos-breakdown-label { color: var(--text-secondary); }
.pos-breakdown-value { font-weight: 700; color: var(--text); }

.pos-formula-box {
  background: var(--bg-secondary); padding: 14px 16px;
  border-radius: var(--radius); font-size: 0.88rem;
  color: var(--text-secondary); margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}
.pos-formula-box code {
  display: block; margin-top: 6px;
  font-family: 'Courier New', monospace; font-size: 0.92rem;
  color: var(--text); font-weight: 600;
}

/* FORMULA SECTION */
.pos-formula-section {
  padding: 60px 0; background: var(--bg-secondary);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.pos-formula-section h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; font-weight: 700; }
.pos-formula-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.pos-formula-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.pos-formula-card h3 { font-size: 1.1rem; margin-bottom: 16px; font-weight: 700; }
.pos-formula-box-large {
  background: var(--bg-secondary); padding: 18px;
  border-radius: var(--radius); text-align: center;
  margin-bottom: 12px; border: 1px solid var(--border); overflow-x: auto;
}
.pos-formula-box-large code {
  font-family: 'Courier New', monospace; font-size: 0.9rem;
  font-weight: 700; color: var(--accent); white-space: nowrap;
}
.pos-formula-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* CONTENT */
.pos-content-article { padding: 60px 0; background: var(--bg-secondary); }
.pos-content-article h2 { font-size: 2rem; margin-bottom: 20px; font-weight: 700; }
.pos-content-article h3 { font-size: 1.4rem; margin: 32px 0 16px; font-weight: 700; }
.pos-content-article h4 { font-size: 1.15rem; margin: 24px 0 12px; color: var(--text); }
.pos-content-article p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }
.pos-content-article ul, .pos-content-article ol {
  margin-left: 24px; color: var(--text-secondary);
  line-height: 1.9; margin-bottom: 16px;
}
.pos-internal-links {
  margin-top: 40px; padding: 24px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pos-internal-links h3 { margin-top: 0; }
.pos-internal-links ul { list-style: none; margin: 0; padding: 0; }
.pos-internal-links li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.pos-internal-links li:last-child { border-bottom: none; }
.pos-internal-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.pos-internal-links a:hover { text-decoration: underline; }

/* FAQ */
.pos-faq { padding: 60px 0; }
.pos-faq h2 { text-align: center; margin-bottom: 40px; font-size: 2rem; font-weight: 700; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; background: none; border: none;
  padding: 18px 0; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px;
  font-size: 1.05rem; font-weight: 600;
  color: var(--text); font-family: inherit;
}
.faq-question:hover { color: var(--accent); }
.faq-icon {
  font-size: 1.5rem; font-weight: 300; color: var(--accent);
  flex-shrink: 0; line-height: 1;
}
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer p {
  padding: 0 0 18px; color: var(--text-secondary);
  line-height: 1.7; font-size: 0.98rem;
}

/* FOOTER */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 32px;
}
.footer-brand p { color: var(--text-secondary); margin-top: 12px; font-size: 0.95rem; line-height: 1.6; }
.footer-logo { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.footer-tagline { font-weight: 600; color: var(--accent); margin-top: 8px; }
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 8px; list-style: none; }
.footer-nav a { color: var(--text-secondary); font-size: 0.92rem; text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px; text-align: center;
  color: var(--text-muted); font-size: 0.88rem;
}
.footer-privacy { margin-top: 6px; font-size: 0.82rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .pos-calc-grid, .pos-formula-grid { grid-template-columns: 1fr; }
  .pos-hero h1 { font-size: 2rem; }
  .pos-result-value { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .pos-hero { padding: 40px 0 30px; }
  .pos-hero h1 { font-size: 1.75rem; }
  .pos-btn-group { flex-direction: column; }
  .pos-form-card, .pos-result-card { padding: 20px; }
  .pos-result-value { font-size: 1.8rem; }
  .pos-tabs-nav { flex-direction: column; }
  .pos-tab-btn { width: 100%; }
}