/* Normalização de Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Estilos básicos e reset */
:root {
    --primary-color: #e67e22;
    --secondary-color: #d35400;
    --light-gray: #f4f4f4;
    --gray: #ccc;
    --dark-gray: #333;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

.container {
    max-width: 800px;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

/* Header e Navbar */
.navbar {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    flex-direction: column; /* empilha logo e menu no desktop */
    justify-content: center;
    align-items: center;
    gap: .25rem;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap; /* permite quebrar linha quando necessário */
    gap: 0 .6rem;
    justify-content: center;
}

.nav-links li a {
    color: var(--dark-gray);
    padding: .75rem .6rem;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.nav-links li a.active { color: var(--secondary-color); font-weight: 800; }

/* Seção do Conversor */
.converter-section {
    padding: 2rem 0;
    text-align: center;
}

.converter-section h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* App do Conversor */
.converter-app {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.cup-toggle {
    margin-bottom: 1.5rem;
}
.cup-toggle span {
    margin-right: 10px;
    font-weight: bold;
}
.cup-toggle button {
    padding: 8px 12px;
    border: 1px solid var(--gray);
    background: var(--light-gray);
    cursor: pointer;
    transition: background 0.3s;
}
.cup-toggle button.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.converter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0; /* Reset margin as gap is used now */
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[readonly] {
    background-color: #eee;
    font-weight: bold;
}

.converter-controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.converter-controls button {
    padding: 10px 20px;
    border: none;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
}

.converter-controls button:hover {
    background: var(--primary-color);
}

.converter-controls button i {
    margin-right: 8px;
}

/* Placeholder de Anúncio */
.ad-placeholder {
    background: #e9e9e9;
    border: 2px dashed var(--gray);
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    max-width: 100%;
}
.ad-leaderboard {
    width: 728px;
    height: 90px;
}

.ad-bottom-banner {
    width: 300px;
    height: 250px;
}

/* Footer */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer a { color: var(--white); text-decoration: underline; }
.footer a:visited { color: var(--white); }
.footer a:hover { color: #ffd9bd; }

/* Responsividade */
@media (max-width: 768px) {
    /* Fallback robusto para dispositivos com suporte parcial a flex */
    .nav-links { display: block; width: 100%; text-align: center; }
    .nav-links li { display: inline-block; margin: 0 .25rem .35rem; }
    .nav-links li a { display: inline-block; padding: .6rem .75rem; }
    .converter-form {
        grid-template-columns: 1fr;
        row-gap: 1rem;
    }
    .ad-leaderboard {
        width: 300px;
        height: 250px;
    }
    .info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-links { margin-top: 0.5rem; }
    .converter-controls {
        flex-direction: column;
    }
}
/* Breadcrumb */
.breadcrumb {
    font-size: 0.95rem;
    color: #666;
    margin: .5rem 0 0;
    display: flex;
    gap: .35rem;
    justify-content: center;
    align-items: center;
}
.breadcrumb a { color: var(--secondary-color); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 .25rem; }

@media (min-width: 769px) {
    .nav-links { gap: 0 .6rem; }
    .breadcrumb { justify-content: center; }
    .navbar .container { gap: 2rem; } /* mais espaço entre logo e menu no desktop */
}

/* Tabelas responsivas */
.table-responsive { overflow-x: visible; }
.table-responsive.wide { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table.wide { min-width: 560px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; word-break: break-word; }
