/* RPM Mobile Mechanic - Master CSS Fix v7.0 */
/* Goal: Match usamobiletruckrepair.com styling while keeping RPM green branding */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&family=Open+Sans:wght@400;500;600;700&display=swap');

/* === BASE RESET === */
body { font-family: 'Open Sans', Arial, sans-serif; font-size: 19px; color: #666; }

/* === LAYOUT FIXES === */
#page-container { padding-top: 0 !important; margin-top: 0 !important; }
#main-content .container { padding-top: 0 !important; }
.et_pb_pagebuilder_layout #main-content { background-color: #fff; }
.et_full_width_page #left-area { padding-bottom: 0; width: 100% !important; }
.et_right_sidebar #left-area { width: 100% !important; }
#sidebar { display: none !important; }
.widget-area { display: none !important; }
.et_right_sidebar #sidebar, .et_right_sidebar .widget-area { display: none !important; width: 0 !important; }

/* Force all Divi animated elements visible */
.et_animated { opacity: 1 !important; visibility: visible !important; }
.et-waypoint { opacity: 1 !important; visibility: visible !important; }
.et_pb_section { display: block !important; visibility: visible !important; opacity: 1 !important; }

/* === HEADER === */
#main-header, #main-header .container, .et-fixed-header#main-header { 
    background-color: #023f16 !important; position: relative !important; 
}
#main-header .container { display: flex; align-items: center; justify-content: space-between; }

/* Navigation - force horizontal */
#top-menu-nav { display: block !important; }
#top-menu { display: flex !important; list-style: none !important; margin: 0; padding: 0; }
#top-menu > li { display: inline-block !important; float: left; position: relative; }
#top-menu > li > a, .et_nav_text_color_dark #top-menu > li > a { 
    color: #fff !important; font-family: 'Open Sans', sans-serif; font-size: 16px; 
    letter-spacing: 0.5px; font-weight: 500; padding: 20px 15px; display: block;
}
#top-menu > li > a:hover, #top-menu > li.current-menu-item > a { color: #f8ff30 !important; }
#top-menu li li a { color: rgba(0,0,0,.7) !important; font-size: 14px; }
#top-menu li li a:hover { color: #023f16 !important; background: #f9f9f9; }
#top-menu > li > ul { background: #fff; }
#et_mobile_nav_menu .mobile_menu_bar:before { color: #fff; }
.logo_container img { max-height: 80px; }

/* Logo left, menu right */
.logo_container { flex-shrink: 0; }
#et-top-navigation { flex-grow: 1; display: flex; justify-content: flex-end; align-items: center; }

/* Header CTA button - match USA's "ADD MY BUSINESS TO DIRECTORY" style */
#main-header .et_pb_button,
.custom-header3-cta-button {
    background-color: #023f16 !important; color: #fff !important; padding: 10px 20px;
    border: 2px solid #f8ff30; text-transform: uppercase; font-family: 'Open Sans', sans-serif;
    font-weight: 600; font-size: 14px; letter-spacing: 0.5px;
}
#main-header .et_pb_button:hover,
.custom-header3-cta-button:hover { background-color: #f8ff30 !important; color: #000 !important; }

/* === HERO SECTION (Section 0 - Specialty) === */
.et_pb_section_0.et_section_specialty { 
    padding: 1.2% 0 4px !important; margin-bottom: 0.4%;
}
.et_pb_section_0 > .et_pb_row,
.et_pb_section_0.et_section_specialty > .et_pb_row { width: 100%; max-width: 100%; }

/* Hero left column padding */
.et_pb_column_0 { padding-top: 0; padding-bottom: 60px; padding-left: 10%; }

/* Hero text */
.et_pb_text_0 { line-height: 2.1em; font-size: 18px; margin-right: 14px !important; max-width: 948px; }
.et_pb_text_0.et_pb_text { color: #000 !important; }
.et_pb_text_0 h1 { 
    font-family: 'Oswald', Helvetica, Arial, sans-serif; font-weight: 500;
    font-size: 56px; color: #023f16 !important; line-height: 1.4em;
}
.et_pb_text_0 h1 em { font-style: italic; }

/* Search bar - match USA styling */
.et_pb_search_0 { overflow: hidden; }
.et_pb_search_0 input.et_pb_searchsubmit { 
    font-size: 21px; color: #fff !important; 
    background-color: #023f16 !important; border-color: #023f16 !important; 
}
.et_pb_search_0 form input.et_pb_s,
.et_pb_search_0 form input.et_pb_s::placeholder { font-size: 20px; }
.et_pb_search_0 input.et_pb_s { 
    border-color: #023f16 !important; height: auto; min-height: 0;
    padding: 0.715em !important; background-color: #fff; color: #000;
}

/* === LISTING HEADER BARS (Row 0 pattern: blue on USA → green on RPM) === */
.et_pb_section_2.et_pb_section { padding-top: 2px; padding-bottom: 10px; }

/* The header bar row - green background */
.et_pb_row_0, [class*="et_pb_row_"][class*="et_pb_with_border"] {
    max-width: 1080px !important; margin-left: auto !important; margin-right: auto !important;
}

.et_pb_row_0 {
    background-color: #023f16 !important; border-bottom-width: 0;
}
.et_pb_row_0.et_pb_row { padding-top: 5px !important; padding-bottom: 3px !important; }

/* All listing header h3 text */
.et_pb_text_1 h3, .et_pb_text_2 h3 { font-family: 'Arial', Helvetica, Arial, sans-serif; }
.et_pb_text_1 { margin-left: 10px !important; }

/* Header bar text styling */
.et_pb_with_border.et_pb_row[style*="background-color"] h3,
.et_pb_row_0 h3 {
    font-family: 'Open Sans', Arial, sans-serif; font-size: 20px; font-weight: 600; 
    margin: 0; color: #fff !important;
}
.et_pb_with_border.et_pb_row[style*="background-color"] a,
.et_pb_row_0 a { color: #fff !important; text-decoration: none; }
.et_pb_with_border.et_pb_row[style*="background-color"] *,
.et_pb_row_0 * { color: #fff !important; }

/* Miles badge */
.miles { 
    background: #023f16; color: #fff !important; padding: 3px 12px; 
    border-radius: 3px; display: inline-block; font-size: 14px; font-weight: 600;
}
.miles span, .miles a { color: #fff !important; }

/* === LISTING CONTENT ROWS === */
.et_pb_row_1 { border-color: #023f16; }
.et_pb_row_1.et_pb_row { padding-top: 0 !important; padding-bottom: 0 !important; }

/* Content row with image + tabs */
.et_pb_with_border.et_pb_row.et_pb_gutters1 {
    border: 1px solid #ddd !important; border-top: 0 !important;
    padding: 0 !important; margin-bottom: 25px !important;
    max-width: 1080px !important; margin-left: auto !important; margin-right: auto !important;
    background: #fff;
}

/* Listing images */
.et_pb_image_0 { width: 100%; max-width: 100% !important; text-align: left; margin-left: 0; }
.et_pb_image_0 .et_pb_image_wrap, .et_pb_image_0 img { width: 100%; }
.et_pb_image_wrap { display: block; max-width: 100%; }
.et_pb_image_wrap img { width: 100%; height: auto; display: block; }

/* === TABS STYLING (Match USA's Divi tabs exactly) === */
.et_pb_tabs { 
    border: none !important; /* USA has border-width: 0; border-style: none */
    margin: 0;
}
.et_pb_tabs_controls { 
    background-color: #f4f4f4 !important; 
    list-style: none !important; padding: 0 !important; line-height: inherit !important;
}
.et_pb_tabs_controls:after { 
    border-top: 1px solid #d9d9d9; content: ""; display: block; 
    visibility: visible; position: relative; top: -1px; z-index: 9; 
}
.et_pb_tabs_controls li { 
    float: left; border-right: 1px solid #d9d9d9; font-weight: 600;
    position: relative; cursor: pointer; max-width: 100%; display: table; 
    z-index: 11; line-height: 1.7em;
    background-color: transparent !important; /* RGBA(255,255,255,0) from USA */
}
.et_pb_tabs_controls li:not(.et_pb_tab_active):last-child { border-right: none; }
.et_pb_tabs_controls li a { 
    text-decoration: none; color: #666 !important; padding: 4px 30px;
    vertical-align: middle; display: table-cell; line-height: inherit;
    font-size: 14px; font-weight: 600;
}
.et_pb_tabs_controls li.et_pb_tab_active { background-color: #fff !important; }
.et_pb_tabs_controls li.et_pb_tab_active a { color: #333 !important; }
.et_pb_all_tabs { background-color: #fff; }
.et_pb_tab { padding: 24px 30px; }
.et_pb_tab_content { 
    position: relative; color: #333 !important; font-size: 15px; line-height: 1.7;
}
.et_pb_tab_content p { color: #333 !important; }

/* === INFO-LEFT STYLING === */
.info-left { margin-bottom: 5px; color: #333; line-height: 1.6; }
.info-right { margin-bottom: 5px; color: #333; }
.info-right a, .info-left a { color: #023f16; text-decoration: none; }
.info-right a:hover, .info-left a:hover { text-decoration: underline; }

/* Phone numbers in listings */
.info-left a[href^="tel:"] { 
    color: #023f16; font-weight: 600; font-size: 16px; 
}

/* "Open in Maps" links */
.info-left a[href*="maps"] {
    display: inline-block; margin-top: 5px; padding: 3px 10px;
    background: #f0f4f0; border-radius: 3px; font-size: 13px; color: #023f16;
}

/* === TEXT CONTENT SECTIONS === */
.entry-content, .entry-content p, .et_pb_text_inner, .et_pb_text_inner p { color: #666 !important; }
.entry-content h1, .entry-content h2 { color: #333 !important; }
.entry-content h3 { color: #333 !important; }

/* Content sections below listings */
.et_pb_section_7, .et_pb_section_8, .et_pb_section_9 { 
    padding: 40px 0 !important;
}
.et_pb_section_7 .et_pb_row, .et_pb_section_8 .et_pb_row { max-width: 900px; margin: 0 auto; }
.et_pb_section_7 h2, .et_pb_section_8 h2, .et_pb_section_9 h2 { 
    font-family: 'Open Sans', sans-serif; font-weight: 600; 
    text-align: center; color: #333 !important; font-size: 30px;
}
.et_pb_section_7 p, .et_pb_section_8 p { color: #666 !important; line-height: 1.7; }

/* "To Serve You Better" / CTA section */
.et_pb_section_8 { text-align: center; }

/* "Get your business listed" section - match USA */
#listing, [id="listing"] {
    padding: 30px; background: #f8f9fa; text-align: center; border-top: 2px solid #023f16;
}

/* === SPONSOR LOGOS ROW === */
.et_pb_section_6 { padding: 20px 0 !important; text-align: center; }
.et_pb_section_6 img { max-height: 50px; margin: 0 10px; }

/* === SECTION SPACING (tighter like USA) === */
.et_pb_section { padding: 15px 0 !important; }
.et_pb_section_1, .et_pb_section_2, .et_pb_section_3, 
.et_pb_section_4, .et_pb_section_5 { padding: 2px 0 10px !important; }

/* === FOOTER (match USA's dark footer) === */
#main-footer { background-color: #fff !important; }
.footer-widget, .footer-widget li, .footer-widget li a, #footer-info { font-size: 14px; }
.footer-widget .et_pb_widget div, .footer-widget .et_pb_widget ul, 
.footer-widget .et_pb_widget ol, .footer-widget .et_pb_widget label { line-height: 1.7em; }
#et-footer-nav { background-color: #000; }
.bottom-nav, .bottom-nav a, .bottom-nav li.current-menu-item a { color: #000; }
#footer-bottom { background-color: rgba(255,255,255,0.32) !important; padding: 15px 0; }
#footer-bottom .container { color: #333; }

/* === MEGA MENU / DROPDOWNS — Pure CSS flyout matching USA === */
#main-header { overflow: visible !important; height: auto !important; }
#et-top-navigation { overflow: visible !important; }
.nav li, #top-menu li { position: relative !important; }

/* Hide ALL sub-menus by default */
#top-menu .sub-menu,
#top-menu li ul,
.nav li ul {
    display: none !important;
    position: absolute !important;
    z-index: 99999 !important;
    background: #fff !important;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15) !important;
    border-top: none !important; /* Removed gap-causing border */
    padding: 5px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    max-height: 500px;
    overflow-y: auto;
}

/* Level 1: Show on hover — States dropdown */
#top-menu > li:hover > .sub-menu,
#top-menu > li:hover > ul,
.nav > li:hover > ul {
    display: block !important;
    top: 100% !important;
    left: 0 !important;
    border-top: 3px solid #023f16 !important; /* Only top border on level 1 */
}

/* Level 1 items (states) */
#top-menu .sub-menu li,
#top-menu li ul li {
    display: block !important;
    float: none !important;
    position: relative !important;
    border-bottom: 1px solid #f0f0f0;
    list-style: none !important;
}
#top-menu .sub-menu li a,
#top-menu li ul li a {
    color: #333 !important;
    padding: 8px 20px !important;
    display: block !important;
    font-size: 14px !important;
    white-space: nowrap;
    text-decoration: none !important;
}
#top-menu .sub-menu li:hover > a,
#top-menu li ul li:hover > a {
    color: #023f16 !important;
    background: #f5f7f5 !important;
}

/* Arrow indicator for items with sub-menus */
#top-menu .menu-item-has-children > a:after {
    content: ' ▸';
    color: #999;
}
#top-menu > li.menu-item-has-children > a:after { content: ' ▾'; }

/* Level 2: City flyout (pops out to the RIGHT, NO gap) */
#top-menu .sub-menu li:hover > .sub-menu,
#top-menu .sub-menu li:hover > ul,
#top-menu li ul li:hover > ul {
    display: block !important;
    top: -5px !important; /* Overlap with parent padding for seamless hover */
    left: 100% !important;
    z-index: 100000 !important;
    min-width: 280px;
    border-left: 1px solid #e0e0e0 !important;
}

/* Level 2 items (cities) — slightly smaller */
#top-menu .sub-menu .sub-menu li a,
#top-menu li ul li ul li a {
    font-size: 13px !important;
    padding: 6px 18px !important;
}

/* Dropdown scrollbar styling */
#top-menu ul::-webkit-scrollbar { width: 6px; }
#top-menu ul::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#top-menu ul::-webkit-scrollbar-track { background: #f5f5f5; }

/* === RESPONSIVE / MOBILE === */
@media (min-width: 981px) {
    #et_mobile_nav_menu { display: none !important; height: 0 !important; overflow: hidden !important; }
    .et_header_style_left #et-top-navigation, .et_header_style_split #et-top-navigation { padding: 51px 0 0 0; }
    .et_header_style_left #et-top-navigation nav > ul > li > a,
    .et_header_style_split #et-top-navigation nav > ul > li > a { padding-bottom: 51px; }
    .et-fixed-header #top-menu li a { font-size: 18px; }
}

@media (max-width: 980px) {
    #top-menu, .et_mobile_menu { background: #023f16 !important; }
    .et_mobile_menu li a { color: #fff !important; border-color: rgba(255,255,255,.1) !important; }
    #top-menu-nav { display: none !important; }
    #et_mobile_nav_menu { display: block; }
    .mobile_nav .mobile_menu_bar { display: block; cursor: pointer; }
    .et_mobile_menu { display: none; background: #023f16; }
    .et_mobile_menu li a { 
        color: #fff !important; padding: 10px 15px; display: block; 
        border-bottom: 1px solid rgba(255,255,255,.1); 
    }
    
    .et_pb_row > .et_pb_column.et_pb_column_0 { padding-right: 10%; padding-left: 10%; }
    .et_pb_text_0 h1 { font-size: 46px; }
    
    /* Tabs go vertical on mobile */
    .et_pb_tabs_controls { border-bottom: none; height: auto !important; }
    .et_pb_tabs_controls li { float: none; border-right: none; border-bottom: 1px solid #d9d9d9; display: block; }
}

@media (max-width: 767px) {
    .et_pb_text_0 { font-size: 15px; }
    .et_pb_text_0 h1 { font-size: 36px; }
    .et_pb_tabs_controls li { float: none; border-right: none; border-bottom: 1px solid #d9d9d9; }
    .et_pb_tab { padding: 15px; }
}

/* === BUTTON GLOBAL STYLES === */
body .et_pb_bg_layout_light.et_pb_button:hover,
body .et_pb_bg_layout_light .et_pb_button:hover,
body .et_pb_button:hover { border-radius: 0; }

/* === HEADING SIZES (Match USA) === */
h1, h1.et_pb_contact_main_title, .et_pb_title_container h1 { font-size: 35px; }
h2, .product .related h2 { font-size: 30px; }
h3 { font-size: 25px; }
h4 { font-size: 21px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

/* === ACCENT COLOR (green replaces USA blue #0C71C3) === */
.et_pb_contact_submit, .et_password_protected_form .et_submit_button,
.et_pb_bg_layout_light .et_pb_newsletter_button, .comment-reply-link,
.form-submit .et_pb_button, .et_pb_bg_layout_light .et_pb_promo_button,
.et_pb_bg_layout_light .et_pb_more_button,
.et_pb_bg_layout_light.et_pb_module.et_pb_button { color: #023f16; }

.et-search-form, .nav li ul, .et_mobile_menu,
.footer-widget li:before, blockquote { border-color: #023f16; }

a { color: #023f16; }
a:hover { color: #012d10; }

/* === GOOGLE MAPS EMBEDS === */
.rpm-map-embed {
    margin-top: 10px; border: 1px solid #ddd; border-radius: 4px; overflow: hidden;
}
.rpm-map-embed iframe { display: block; width: 100%; height: 200px; border: 0; }
