:root {
    --primary: #f8e11c;
    --primary-dark: #e0cb19;
    --secondary: #3a3a3a;
    --text-color: #333;
    --white: #ffffff;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* min-height: 100vh; Removed for Iframe Resizer compatibility */
    padding: 10px;
}

.main-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.search-card {
    background: var(--white);
    padding: 1rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    /* ensure autocompletes stack correctly */
    z-index: 10;
}

.header {
    text-align: center;
    margin-bottom: 0.8rem;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--secondary);
    font-weight: 700;
}

/* Toggles */
.toggles-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.toggle-row {
    display: flex;
    background: #eee;
    padding: 4px;
    border-radius: 50px;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.toggle-option.active {
    background: var(--white);
    color: var(--secondary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Inputs */
.input-group {
    margin-bottom: 1.2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}

label i {
    margin-right: 5px;
    color: #cc3535;
}

input,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    background: #fffdf0;
}

.row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.row .input-group {
    flex: 1;
    min-width: 0;
    /* Critical for Firefox flexbox overflow */
}

.btn-search {
    width: 100%;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(248, 225, 28, 0.4);

}

/* Autocomplete List */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    /* In case of very narrow inputs */
    min-width: 250px;
}

/* Fix for right-side items going off screen if min-width makes it too wide */
#dest-list,
#return-box .autocomplete-list {
    right: 0;
    left: auto;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal;
    /* Allow wrapping */
}

.autocomplete-item:hover {
    background-color: #f9f9f9;
    color: var(--primary-dark);
}

.ac-icon {
    width: 20px;
    text-align: center;
    color: #555;
    font-size: 1rem;
}

.ac-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ac-main {
    font-weight: 600;
    color: var(--secondary);
}

.ac-sub {
    font-size: 0.75rem;
    color: #888;
}

/* Footer & Extra Buttons */
.extra-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Reduced gap */
    align-items: center;
    margin-top: 1rem;
    /* Reduced top margin */
    width: 100%;
}

.whatsapp-btn,
.install-btn {
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Center text */
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    width: 100%;
    max-width: 300px;
    /* Slightly reduced max width for better aesthetic */
    white-space: nowrap;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow */
}

.whatsapp-btn {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.install-btn {
    background: var(--primary);
    color: var(--secondary);
    box-shadow: 0 4px 10px rgba(248, 225, 28, 0.3);
}

.whatsapp-btn:hover,
.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.footer {
    margin-top: 0.8rem;
    /* Reduced from 1.5rem */
    text-align: center;
    color: #888;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    /* Control spacing between logo and text */
}

.footer img {
    max-width: 100px;
    /* Un poco más chico logo footer */
    opacity: 0.8;
    transition: opacity 0.3s;
    margin-bottom: 0px;
}

.footer img:hover {
    opacity: 1;
}