/* ====== KeenerPet — Common Styles ====== */
/* All shared layout & component styles. Each page sets its own --primary colors. */

/* ====== Reset & Base ====== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #fafaf9;
    color: #292524;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --text: #292524;
    --text-muted: #78716c;
    --bg: #fafaf9;
    --card-bg: #ffffff;
    --border: #e7e5e4;
    --success: #059669;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ====== Header ====== */
header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--primary); }
.logo-icon { font-size: 22px; }

nav { display: flex; align-items: center; gap: 6px; }
nav a {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}
nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
nav a.active { background: var(--primary); color: white; }

@media (max-width: 600px) {
    nav { gap: 4px; }
    nav a { padding: 5px 10px; font-size: 12px; }
    .logo { font-size: 17px; }
}

/* ====== Page Hero ====== */
.hero {
    padding: 40px 0 24px;
    text-align: center;
}
.hero h1 {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.2;
    color: #1c1917;
}
.hero h1 span { color: var(--primary); }
.hero p {
    margin-top: 10px;
    font-size: 16px;
    color: var(--text-muted);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 14px; }
}

/* ====== Calculator Card ====== */
.calc-section { padding-bottom: 48px; }
.calc-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-lg);
}
.calc-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1c1917;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
@media (max-width: 640px) {
    .calc-grid { grid-template-columns: 1fr; }
    .calc-card { padding: 20px; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.field select, .field input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2378716c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.field select:focus, .field input:focus { border-color: var(--primary); }

.calc-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    margin-top: 16px;
}
.calc-btn:hover { background: var(--primary-dark); }

/* ====== Results ====== */
.results {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    border: 1px solid var(--primary);
}
.results.show { display: block; }

.results .main-result {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}
.results .main-label { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
@media (max-width: 480px) {
    .results-grid { grid-template-columns: 1fr; }
}
.result-item {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: center;
}
.result-item .value { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.result-item .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Results bigger variant (used on some pages) */
.results .big { font-size: 36px; font-weight: 800; color: var(--primary-dark); text-align: center; }
.results .big-label { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 16px; }

@media (max-width: 480px) {
    .results .main-result { font-size: 22px; }
    .results .big { font-size: 28px; }
}

/* ====== Affiliate Recommendation ====== */
.affiliate-rec {
    margin-top: 16px;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.affiliate-rec .rec-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.affiliate-rec a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-light);
    color: #92400e;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.affiliate-rec a:hover { background: var(--accent); color: white; }
.affiliate-note {
    margin-top: 16px;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.affiliate-note a { color: var(--primary); font-weight: 600; }

/* ====== Tools Grid ====== */
.tools-section { padding-bottom: 48px; }
.tools-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1c1917;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.tool-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    transition: all 0.2s;
    cursor: pointer;
    display: block;
}
.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.tool-card .icon { font-size: 28px; margin-bottom: 8px; }
.tool-card h3 { font-size: 15px; font-weight: 700; color: #1c1917; margin-bottom: 4px; }
.tool-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.tool-card .go-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.tool-card:hover .go-link { gap: 8px; }

/* ====== About / Trust ====== */
.about-section { padding-bottom: 48px; }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 540px) {
    .about-grid { grid-template-columns: 1fr; }
}
.about-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    text-align: center;
}
.about-card .icon { font-size: 28px; }
.about-card h3 { font-size: 15px; font-weight: 700; margin: 10px 0 5px; }
.about-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ====== Newsletter ====== */
.newsletter-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    margin-bottom: 48px;
}
.newsletter-section h2 { font-size: 20px; font-weight: 700; color: #1c1917; }
.newsletter-section p { color: var(--text-muted); margin-top: 6px; font-size: 14px; }
.newsletter-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 16px auto 0;
}
.newsletter-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.newsletter-form input:focus { border-color: var(--primary); }
.newsletter-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}
.newsletter-form button:hover { background: var(--primary-dark); }
#newsletter-msg { font-size: 13px; margin-top: 8px; }

/* ====== Page Header (for non-home pages: h1 + sub) ====== */
.page-header { padding: 32px 0 24px; }
.page-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; color: #1c1917; }
.page-header .sub { font-size: 15px; color: var(--text-muted); }
@media (max-width: 480px) {
    .page-header h1 { font-size: 22px; }
}

/* ====== Insurance Cards ====== */
.insurance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .insurance-grid { grid-template-columns: 1fr; } }
.ins-card {
    background: white; border-radius: 8px; padding: 14px 16px;
    border: 1px solid var(--border); text-align: center;
}
.ins-card .name { font-size: 14px; font-weight: 700; color: #1c1917; }
.ins-card .price { font-size: 18px; font-weight: 800; color: var(--primary-dark); margin: 4px 0; }
.ins-card .rating { font-size: 12px; color: var(--text-muted); }
.ins-card a {
    display: inline-block; margin-top: 8px; padding: 6px 14px;
    background: var(--accent); color: #92400e; border-radius: 6px;
    font-size: 12px; font-weight: 600; transition: background 0.2s;
}
.ins-card a:hover { background: #d97706; color: white; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ====== Footer ====== */
footer {
    border-top: 1px solid var(--border);
    background: white;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding: 36px 0;
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
.footer-brand .logo { font-size: 18px; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    color: #1c1917;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ====== Modal ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    position: relative;
}
.modal-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    margin-bottom: 10px;
}
.modal-input:focus { border-color: var(--primary); }
.modal-submit {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.modal-submit:hover { background: var(--primary-dark); }
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* ====== Utility ====== */
.disclaimer { font-size: 11px; color: #a8a29e; margin-top: 16px; text-align: center; line-height: 1.5; }

/* ====== Unit Toggle (used on main page) ====== */
.unit-toggle {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.unit-toggle button {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted);
    transition: all 0.2s;
}
.unit-toggle button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.unit-toggle button:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* ====== FAQ Section ====== */
.faq-section { padding-bottom: 48px; }
.faq-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: #1c1917; }
.faq-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
}
.faq-item summary {
    font-size: 15px;
    font-weight: 600;
    color: #1c1917;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
    content: "▼";
    font-size: 10px;
    color: var(--primary);
    transition: transform 0.2s;
}
.faq-item[open] summary::before { transform: rotate(180deg); }
.faq-item .faq-answer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}
.faq-item .faq-answer a { color: var(--primary); font-weight: 600; }
