/* ===================================
   BREWHAUSER COMPONENT LIBRARY
   Reusable UI components with consistent theming
   =================================== */

/* CSS Variables - Brewhauser Theme */
:root {
    --primary-amber: #F5A623;
    --secondary-navy: #0F172A;
    --neutral-cream: #F5F5F5;
    --gold-accent: #D4AF37;
}

/* ===================================
   DROPDOWN / SELECT COMPONENT
   =================================== */

.brewhauser-select {
    padding: 0.75rem 3rem 0.75rem 1.5rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 50px;
    color: var(--primary-amber);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5A623' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.5rem;
}

.brewhauser-select:hover {
    background-color: rgba(245, 166, 35, 0.2);
    border-color: rgba(245, 166, 35, 0.5);
}

.brewhauser-select:focus {
    outline: none;
    border-color: var(--primary-amber);
    background-color: rgba(245, 166, 35, 0.15);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.brewhauser-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(245, 166, 35, 0.05);
}

.brewhauser-select option {
    background: var(--secondary-navy);
    color: var(--neutral-cream);
    padding: 0.5rem;
    font-weight: normal;
}

/* Mobile optimizations for native select */
@media (max-width: 768px) {
    .brewhauser-select {
        font-size: 18px !important; /* Prevents iOS zoom on focus, larger for visibility */
        color: #FFF !important; /* Pure white for maximum visibility */
        background: rgba(245, 166, 35, 0.4) !important; /* Stronger background */
        border: 2px solid #F5A623 !important; /* Visible border */
        padding: 0.875rem 3rem 0.875rem 1.25rem !important;
        font-weight: 700 !important; /* Bolder text */
    }

    .brewhauser-select option {
        background: #1A2B3C !important;
        color: #FFFFFF !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        padding: 12px !important;
        min-height: 48px !important;
    }

    /* Additional specificity for mobile browsers */
    select.brewhauser-select,
    select.brewhauser-select option {
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
    }

    #stateSelect,
    #citySelect {
        font-size: 18px !important;
    }

    #stateSelect option,
    #citySelect option {
        font-size: 18px !important;
        font-weight: 700 !important;
    }
}

/* ===================================
   CUSTOM DROPDOWN (Mobile-Friendly Alternative)
   =================================== */

.custom-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.custom-dropdown-button {
    width: 100%;
    text-align: left;
}

.custom-dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #1A2B3C;
    border: 2px solid #F5A623;
    border-top: none;
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    margin-top: -8px;
}

.custom-dropdown-wrapper.open .custom-dropdown-button {
    border-radius: 50px 50px 0 0;
}

.custom-dropdown-option {
    padding: 16px 20px;
    color: #FFF;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid rgba(245, 166, 35, 0.2);
    transition: background 0.2s;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover,
.custom-dropdown-option.selected {
    background: rgba(245, 166, 35, 0.3);
}

.custom-dropdown-wrapper.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Hide custom dropdown on desktop, use native */
@media (min-width: 769px) {
    .custom-dropdown-wrapper {
        display: none;
    }
    .brewhauser-select {
        display: block !important;
    }
}

/* Show custom dropdown on mobile */
@media (max-width: 768px) {
    .custom-dropdown-wrapper + .brewhauser-select {
        display: none !important;
    }
}

/* ===================================
   BUTTON COMPONENTS
   =================================== */

.brewhauser-btn-primary {
    background: linear-gradient(135deg, var(--primary-amber), var(--gold-accent));
    color: var(--secondary-navy);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.brewhauser-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.brewhauser-btn-secondary {
    background: transparent;
    color: var(--primary-amber);
    padding: 0.75rem 2rem;
    border: 2px solid var(--primary-amber);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.brewhauser-btn-secondary:hover {
    background: rgba(245, 166, 35, 0.1);
    border-color: var(--gold-accent);
}

/* ===================================
   INPUT COMPONENTS
   =================================== */

.brewhauser-input {
    padding: 0.75rem 1.5rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 50px;
    color: var(--neutral-cream);
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.brewhauser-input::placeholder {
    color: rgba(245, 166, 35, 0.5);
}

.brewhauser-input:focus {
    outline: none;
    border-color: var(--primary-amber);
    background-color: rgba(245, 166, 35, 0.15);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

@media (max-width: 768px) {
    .brewhauser-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* ===================================
   CARD COMPONENTS
   =================================== */

.brewhauser-card {
    background: rgba(26, 43, 60, 0.7);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.brewhauser-card:hover {
    background: rgba(26, 43, 60, 0.9);
    border-color: rgba(245, 166, 35, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.1);
}

/* ===================================
   BADGE COMPONENTS
   =================================== */

.brewhauser-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 20px;
    color: var(--primary-amber);
    font-size: 0.875rem;
    font-weight: 500;
}

.brewhauser-badge-solid {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-amber), var(--gold-accent));
    border-radius: 20px;
    color: var(--secondary-navy);
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===================================
   FILTER GROUP (for label + select pairs)
   =================================== */

.brewhauser-filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brewhauser-filter-group label {
    font-weight: 600;
    color: var(--neutral-cream);
    font-size: 1rem;
}

@media (max-width: 768px) {
    .brewhauser-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .brewhauser-filter-group label {
        font-size: 0.875rem;
    }

    .brewhauser-filter-group .brewhauser-select {
        width: 100%;
    }
}
