/* ==========================================================================
   TOP BAR (Red Announcement Bar)
   ========================================================================== */
.rm-top-bar {
    background-color: #d1302b;
    color: #ffffff;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.rm-top-bar .rm-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.rm-top-bar-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rm-top-bar-left span.highlight {
    color: #fbd066;
    font-weight: 500;
}

.rm-top-bar-left span.divider {
    margin: 0 10px;
    opacity: 0.7;
}

.rm-top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rm-top-bar-link {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.rm-top-bar-link:hover {
    opacity: 0.8;
}

.rm-top-bar-link svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */
.rm-header {
    background-color: #ffffff;
    min-height: 80px; /* Changed from height: 80px so it can grow */
    padding: 10px 0; /* Add a bit of space top and bottom */
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Fix: Elementor sets margin-top: -353px on the top banner section of find-a-store page.
   This pulls the banner up behind our sticky header. We reset it to 0 here. */
.elementor-element-e65b504 {
    margin-top: 0 !important;
}

.rm-header .rm-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Mobile Toggle Menu Button */
.rm-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #1a1a1a;
    margin-right: 15px;
}

.rm-mobile-toggle svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Logo */
.rm-logo {
    display: flex;
    align-items: center;
    margin-right: 60px;
    flex-shrink: 0; /* Stops the menu from squishing the logo horizontally */
}

.rm-logo img {
    width: 140px; /* Change this number to control the overall size */
    height: auto;
    max-width: none !important; /* Forces Astra to let the logo grow */
    display: block;
}

/* Navigation Menu */
.rm-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.rm-nav-item {
    position: relative;
}

.rm-nav-link {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.rm-nav-link.active {
    color: #e2241a;
}

.rm-nav-link:hover {
    color: #e2241a;
}

.rm-nav-link svg.chevron {
    width: 12px;
    height: 12px;
    stroke: #666;
    stroke-width: 2.5;
    transition: transform 0.2s;
}

.rm-nav-link:hover svg.chevron {
    stroke: #e2241a;
    transform: rotate(180deg);
}

/* ===== DROPDOWN MENUS ===== */
.rm-has-dropdown { position: relative; }

/* Arrow bridge — prevents dropdown from disappearing when mouse moves between link and dropdown */
.rm-has-dropdown::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    right: 0;
    height: 14px;
    z-index: 1999;
}

.rm-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: -16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
    padding: 8px 0;
    min-width: 210px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    border-top: 3px solid #e2241a;
}

/* Small arrow tip pointing up */
.rm-dropdown::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 6px solid #e2241a;
}

.rm-has-dropdown:hover .rm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rm-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13.5px;
    color: #2d2d2d;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    white-space: nowrap;
    position: relative;
}

/* Left accent bar on hover */
.rm-dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: #e2241a;
    border-radius: 0 3px 3px 0;
    transition: transform 0.15s;
}

.rm-dropdown-link:hover {
    background: #fdf3f3;
    color: #e2241a;
    padding-left: 26px;
}

.rm-dropdown-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

/* Divider between dropdown items */
.rm-dropdown-divider {
    height: 1px;
    background: #f5f5f5;
    margin: 6px 14px;
}

/* ===== MEGA MENU (Shop) ===== */
.rm-mega-menu {
    display: none;
    flex-direction: row;
    gap: 0;
    padding: 0;
    min-width: 740px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-radius: 14px;
    overflow: hidden;
}

/* Reset the arrow for mega menu — center it */
.rm-has-mega .rm-dropdown::before {
    left: 50%;
    transform: translateX(-50%);
}

.rm-has-mega:hover .rm-dropdown {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Each column in the mega menu */
.rm-mega-col {
    flex: 1;
    padding: 20px 18px 22px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #f2f2f2;
    transition: background 0.2s;
}

.rm-mega-col:last-child {
    border-right: none;
    background: #fdf8f8; /* Subtle tint for last col */
}

/* Category heading */
.rm-mega-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    color: #e2241a;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 2px solid #f5e0e0;
    transition: color 0.15s;
}

.rm-mega-heading::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #e2241a;
    border-radius: 50%;
    flex-shrink: 0;
}

.rm-mega-heading:hover { color: #b71c1c; }

/* Links inside mega columns */
.rm-mega-col .rm-dropdown-link {
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
    border-radius: 5px;
}

.rm-mega-col .rm-dropdown-link::before { display: none; }

.rm-mega-col .rm-dropdown-link:hover {
    background: #fff0f0;
    color: #e2241a;
    padding-left: 10px;
}

/* Standalone "button-style" links for Combo & Latest Products */
.rm-mega-standalone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #e2241a;
    text-decoration: none;
    border: 1.5px solid #f5c5c5;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
}

.rm-mega-standalone:hover {
    background: #e2241a;
    border-color: #e2241a;
    color: #fff;
}

.rm-mega-standalone svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Mobile dropdown styles */
@media (max-width: 992px) {
    .rm-has-dropdown::after { display: none; }
    .rm-dropdown::before { display: none; }

    .rm-dropdown {
        position: static;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid #e2241a;
        border-radius: 0;
        padding: 4px 0 4px 12px;
        margin: 4px 0 10px 0;
        min-width: unset;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        transition: none;
    }
    .rm-has-dropdown.open .rm-dropdown { display: block; }

    .rm-mega-menu {
        flex-direction: column;
        min-width: unset;
        transform: none;
        left: auto;
        border-radius: 0;
        overflow: visible;
    }
    .rm-has-mega.open .rm-dropdown { display: flex; }

    .rm-mega-col {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 10px 0;
        background: transparent !important;
    }
    .rm-mega-col:last-child { border-bottom: none; }

    .rm-mega-heading { font-size: 12px; padding-bottom: 6px; margin-bottom: 4px; }
    .rm-mega-col .rm-dropdown-link { padding: 6px 4px; }
    .rm-mega-standalone { padding: 8px 10px; font-size: 12.5px; }

    .rm-dropdown-link { padding: 9px 6px; font-size: 13.5px; }
    .rm-dropdown-link:hover { padding-left: 12px; }
}

/* Right Side Actions (Search + Icons) */
.rm-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

/* Search Bar */
.rm-search-form {
    position: relative;
    width: 350px;
    margin: 0;
}

.rm-search-input {
    width: 100%;
    height: 42px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 30px !important;
    padding: 0 20px 0 45px !important;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    outline: none;
    background-color: #fff !important;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rm-search-input::placeholder {
    color: #999;
}

.rm-search-input:focus {
    border-color: #f5a623 !important;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1) !important;
}

.rm-search-btn {
    position: absolute !important;
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: 32px !important;
    height: 32px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.rm-search-btn:hover, .rm-search-btn:focus, .rm-search-btn:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.rm-search-icon {
    width: 16px !important;
    height: 16px !important;
    color: #666;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
}

/* AJAX Search Suggestions Dropdown */
.rm-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 9999;
    display: none; /* hidden by default */
    max-height: 400px;
    overflow-y: auto;
}

.rm-search-suggestions.active {
    display: block;
}

.rm-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.rm-suggestion-item:last-child {
    border-bottom: none;
}

.rm-suggestion-item:hover {
    background: #fdf6e8;
}

.rm-suggestion-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    background: #f5f5f5;
}

.rm-suggestion-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rm-suggestion-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 3px;
}

.rm-suggestion-price {
    font-size: 13px;
    color: #e2241a;
    font-weight: 700;
}

.rm-suggestion-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}
.rm-search-loading {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Action Icons */
.rm-icon-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #fdf6e8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.rm-action-btn:hover {
    background-color: #f5e6c8;
    color: #e2241a;
    border-color: #f5e6c8;
}

.rm-action-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

/* Cart Badge */
.rm-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #e2241a;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    line-height: 1;
}

/* Mobile specific elements */
.rm-mobile-search {
    display: none;
    width: 100%;
    margin-bottom: 20px;
}

.rm-mobile-search .rm-search-form {
    width: 100%;
}

.rm-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.rm-mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Offset for WordPress admin bar */
.admin-bar .rm-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .rm-header {
        top: 46px;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN 
   ========================================================================== */
@media (max-width: 1200px) {
    .rm-search-form { width: 250px; }
    .rm-nav { gap: 20px; margin-left: 20px; }
}

@media (max-width: 992px) {
    .rm-header .container { padding: 0 20px; }
    
    .rm-top-bar { display: none; }
    .rm-mobile-toggle { display: block; }
    
    .rm-header .container { justify-content: flex-start; }
    .rm-header-actions { margin-left: auto; }
    .rm-header-actions .rm-search-form { display: none; }
    
    .rm-nav {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        margin: 0;
        padding: 30px 20px;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .rm-nav.active {
        left: 0;
    }

    .rm-mobile-search { display: block; }

    .rm-nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .rm-nav-link {
        padding: 15px 0;
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .rm-logo img { height: 50px; }
    .rm-icon-group { gap: 8px; }
    .rm-action-btn { width: 36px; height: 36px; }
    .rm-action-btn svg { width: 16px; height: 16px; }
}
