/* --- GLOBAL VARIABLES --- */
:root {
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --primary: #EA580C;
    --primary-light: #FFF7ED;
    --text-dark: #111827;
    --text-med: #4B5563;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --radius: 12px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* --- GLOBAL RESET & LAYOUT --- */
html { overflow-y: scroll; } /* Prevents jump between short/long pages */

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* --- HEADER & NAVIGATION --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
}

.brand i { font-size: 2rem; color: var(--primary); }
.brand-name { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }

.brand-tag {
    background: var(--text-dark);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-med);
    font-weight: 500;
    font-size: 1.0rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); font-weight: 600; }


.global-unit-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-med);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-left: 20px; /* Space from nav links */
}

.global-unit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Adjust mobile layout to fit the button */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
    }
    .global-unit-btn {
        margin-left: auto; /* Push to right */
        margin-right: 10px;
    }
}

/* --- COMMON CARD STYLES --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}
h2 i { color: var(--primary); font-size: 1.25rem; }

.hidden { display: none; }


/* Mobile Navigation Styles */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Default Desktop Nav (Resetting your inline styles) */
.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

@media (max-width: 768px) {
    /* Show hamburger on mobile */
    .mobile-toggle {
        display: block;
    }

    /* Hide menu by default on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%; /* Pushes it right below the header */
        left: 0;
        width: 100%;
        background-color: #fff;
        border-bottom: 1px solid var(--border, #e5e7eb);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 10px 0;
        z-index: 50;
    }

    /* Show menu when active */
    .nav-menu.active {
        display: flex;
        gap: 0;
    }

    .nav-link {
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }

    /* Adjust container relative positioning for the absolute menu */
    header {
        position: relative; 
    }
}


/* --- CALCULATOR SPECIFIC STYLES --- */
.main-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
}

.form-group { margin-bottom: 20px; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-med);
    margin-bottom: 8px;
}

select, input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    box-sizing: border-box;
    background-color: #FAFAFA;
    transition: all 0.2s;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.row { display: flex; gap: 20px; }
.row .form-group { flex: 1; }


/* Unit Toggle Styling */
.unit-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.unit-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #e5e7eb;
}

.unit-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-btn.active {
    background: #fff;
    color: var(--primary, #000); /* Fallback to black if var missing */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Slider */
.slider-container { margin-top: 25px; }
.slider-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 600; color: var(--text-dark); }
.highlight-text { color: var(--primary); }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%;
    background: var(--primary); cursor: pointer; margin-top: -8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px; cursor: pointer; background: #E5E7EB; border-radius: 2px;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-light); margin-top: 8px; }

/* Results Panel */
.results-panel {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.results-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--primary); }

.total-section { text-align: center; padding: 20px 0 30px 0; }
.total-label { text-transform: uppercase; letter-spacing: 1px; font-size: 0.75rem; font-weight: 600; color: var(--text-light); margin-bottom: 10px; }
.total-weight { font-size: 3.5rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.unit { font-size: 1.5rem; color: var(--text-light); font-weight: 500; }

.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.breakdown-row span:first-child { color: var(--text-med); font-size: 0.95rem; }
.value { font-weight: 700; font-size: 1.25rem; color: var(--text-dark); }
.disclaimer { margin-top: auto; padding-top: 20px; font-size: 0.75rem; color: var(--text-light); line-height: 1.4; }

/* Info Cards */
.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-top: 24px; }
@media (max-width: 768px) { .info-grid { grid-template-columns: 1fr; gap: 16px;} }
.info-card { padding: 24px; }
.info-card h3 { font-size: 0.9rem; color: var(--text-dark); margin-top: 0; display: flex; align-items: center; gap: 8px; }
.info-card i { color: var(--primary); font-size: 1.1rem; }
.info-card p { font-size: 0.85rem; color: var(--text-med); line-height: 1.6; margin: 0; }

/* --- GUIDE SPECIFIC STYLES --- */
.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: 1.75rem; margin: 0 0 8px 0; }
.page-header p { color: var(--text-med); margin: 0; }

.wax-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.wax-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: transform 0.2s;
}
.wax-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

.card-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.wax-name { font-weight: 700; font-size: 1.1rem; color: var(--text-dark); margin-bottom: 4px; }
.manufacturer { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.badge { font-size: 0.7rem; padding: 4px 8px; border-radius: 99px; font-weight: 600; text-transform: uppercase; }
.badge-soy { background: #ECFDF5; color: #047857; }
.badge-para { background: #EFF6FF; color: #1D4ED8; }
.badge-blend { background: #FFF7ED; color: #C2410C; }
.badge-natural { background: #FEF3C7; color: #B45309; }

.description { font-size: 0.85rem; color: var(--text-med); line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }

.specs { background-color: #FAFAFA; border-radius: 8px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.spec-item { text-align: center; }
.spec-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-light); font-weight: 600; margin-bottom: 4px; display: block; }
.spec-value { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); }

.btn-tds {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px;
    border: 1px solid var(--border); border-radius: 6px; background: transparent;
    color: var(--text-med); font-size: 0.85rem; font-weight: 500; text-decoration: none;
    transition: all 0.2s; box-sizing: border-box;
}
.btn-tds:hover { border-color: var(--primary); color: var(--primary); background-color: var(--primary-light); }

.footer { margin-top: 40px; text-align: center; font-size: 0.8rem; color: var(--text-light); padding-top: 20px; border-top: 1px solid var(--border); }


/* --- FOOTER STYLES --- */
.site-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px 0;
    margin-top: 60px; /* Separates footer from main content */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; /* Brand column is wider */
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-med);
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 300px;
}

.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 20px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-med);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-light);
    font-size: 1.5rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--primary);
}

.badge-mini {
    background-color: #EFF6FF;
    color: #1E40AF;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Stack everything */
        gap: 40px;
        text-align: center;
    }

    .footer-desc {
        margin: 0 auto 20px auto; /* Center text */
    }

    .brand {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
}