/* rural-run-rental.css - V6.18 - Cross-Browser Compatibility Update */

/* =========================================================================
   0. BROWSER RESET & COMPATIBILITY
   ========================================================================= */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Safari mobile */
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #0073aa #f0f0f0;
}

/* Safari smooth scrolling */
.rrc-scrollable-terms, 
.rrc-slider-viewport,
.rr-dashboard-sidebar {
    -webkit-overflow-scrolling: touch;
}

/* Firefox select fix */
@-moz-document url-prefix() {
    select {
        text-indent: 0.01px;
        text-overflow: "";
        padding-top: 10px; /* Align better in FF */
    }
}

/* Safari select/input reset */
input[type="date"],
input[type="time"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 6px; /* Ensure Safari doesn't force pill shape */
}

/* Fix for Safari date input height */
input[type="date"] {
    min-height: 45px;
    display: flex;
    align-items: center;
}

/* =========================================================================
   1. GLOBAL LAYOUT
   ========================================================================= */

.trr-page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.trr-main-title {
    font-size: 3rem;
    font-family: "Montserrat", sans-serif;
    letter-spacing: 0.06em;
    color: rgba(38, 122, 72, 0.86);
    margin: 0;
    font-weight: 400;
}

/* =========================================================================
   2. FILTER SECTION
   ========================================================================= */

.rental-filters-modern {
    background: #ffffff; /* Changed to White */
    padding: 30px; /* Increased padding slightly */
    border-radius: 12px; /* reduced from 51px for a cleaner card look */
    border: 1px solid #e0e0e0; /* Subtle border */
    border-top: 5px solid #02a6ff; /* Ruralrun Blue accent top border */
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Softer, larger shadow for lift */
    margin-right: 330px;
    margin-bottom: 20px;
}

.rrc-header-split {
    position: relative;
    margin-bottom: 30px;
}

.rrc-ad-section {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
}

/* Filter Grid Layout */
.rrc-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns: Cat, Sub, City */
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-end;
    width: 100%; /* Fix for Firefox container width */
}

.rrc-hero-group { 
    flex: 1; 
    min-width: 0; /* Critical for Firefox flex-item shrinking */
}

.rrc-input-label {
    display: block;
    font-size: 13px; /* Slightly larger */
    font-weight: 700;
    text-transform: uppercase;
    color: #444; /* Darker grey */
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-family: "Montserrat", sans-serif;
}

select {
    width: 100%;
    padding: 12px 15px; /* Comfortable padding */
    height: 50px;
    border: 1px solid #ccc; /* Standard border */
    border-radius: 6px; /* Smaller radius */
    background: #f9f9f9; /* Very light grey input background */
    max-width: 100%;
    box-sizing: border-box;
    /* Cross-browser appearance reset */
    appearance: none; 
    -moz-appearance: none;
    -webkit-appearance: none;
    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='%23555' 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 15px center;
    background-size: 1.2em;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
}
select:focus {
    border-color: #27ae60;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Reset Button (Dark Grey) */
.rrc-filter-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-reset-filters {
    background: #fff; /* White background */
    color: #555;
    border: 1px solid #ccc;
    padding: 0 30px;
    height: 45px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: "Montserrat", sans-serif;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.btn-reset-filters:hover { 
    background: #f5f5f5; 
    border-color: #999;
    color: #333;
}

/* Ad Container */
.trr-ad-container {
    position: relative;
    width: 100%;
    min-height: 350px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}
.trr-ad-container:hover { transform: translateY(-2px); }
/* The ad link fills the full container so object-fit:cover works correctly */
.trr-ad-container .trr-track-ad {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}
.trr-ad-container img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* "Advertise with us" — subtle overlay pill, bottom-right of the ad image */
.trr-advertise-link {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.50);
    color: #fff !important;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: 0.3px;
    padding: 3px 9px;
    border-radius: 3px;
    opacity: 0.75;
    transition: opacity 0.2s, background 0.2s;
    line-height: 1.5;
    z-index: 2;
}
.trr-advertise-link:hover { opacity: 1; background: rgba(0, 0, 0, 0.75); }

/* Mobile Stack for Filters */
@media (max-width: 900px) {
    .rental-filters-modern { padding: 20px; border-radius: 12px; margin-right: 0; margin-bottom: 20px; }
    .trr-main-title { font-size: 1.8rem; text-align: center; }
    .rrc-header-split { display: flex; flex-direction: column; gap: 20px; }
    .rrc-filter-grid { grid-template-columns: 1fr; gap: 15px; margin-bottom: 20px; }
    .rrc-ad-section { position: static; width: 100%; margin: 0 auto; display: flex; justify-content: center; order: 1; }
    .trr-ad-container { min-height: 250px; }
    .btn-reset-filters { width: 100%; justify-content: center; }
    
    .rrc-grid-view {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
}

/* =========================================================================
   3. LOCATION STATUS BAR
   ========================================================================= */
.rrc-location-status-bar {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.rrc-loc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    color: #666;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #ddd;
}
.rrc-loc-badge:hover { background: #e0e0e0; color: #333; }
.rrc-loc-badge.active { background: #e7f4fa; color: #0073aa; border: 1px solid #0073aa; }

/* =========================================================================
   4. MODALS: MAP & PROMPT
   ========================================================================= */
.rrc-map-modal {
    position: fixed; z-index: 9999; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
}
.rrc-map-content {
    background: #fff; width: 90%; max-width: 500px;
    border-radius: 12px; overflow: hidden; position: relative;
    display: flex; flex-direction: column;
}
.rrc-close-modal {
    position: absolute; right: 15px; top: 10px; font-size: 24px; cursor: pointer; color: #999; z-index:10;
}
.rrc-prompt-header {
    padding: 20px; text-align: center; background: #f9f9f9; border-bottom: 1px solid #eee;
}
.rrc-prompt-header h3 { margin: 0 0 5px; }
.rrc-prompt-header p { margin: 0; color: #666; font-size: 0.9em; }

.rrc-prompt-options { padding: 25px; display: flex; flex-direction: column; gap: 15px; }
.rrc-prompt-btn {
    padding: 14px; border: none; border-radius: 8px; font-size: 16px; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.1s;
}
.rrc-prompt-btn.primary { background: #0073aa; color: white; }
.rrc-prompt-btn.secondary { background: #fff; color: #0073aa; border: 2px solid #0073aa; }

.rrc-prompt-divider {
    text-align: center; font-size: 0.85em; color: #ccc; font-weight: bold; text-transform: uppercase; margin: 5px 0;
}
.rrc-prompt-divider span { background: #fff; padding: 0 10px; }
.rrc-prompt-manual { display: flex; flex-direction: column; gap: 10px; }

/* Map Specifics */
.rrc-map-header { padding: 15px 20px; background: #f9f9f9; border-bottom: 1px solid #eee; }
.rrc-map-header h3 { margin: 0 0 5px; font-size: 1.2em; }
.rrc-map-header p { margin: 0; font-size: 0.9em; color: #666; }
#rrc-interactive-map { position: relative; }
.rrc-map-pin-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 50; color: #e74c3c;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.rrc-map-pin-overlay .dashicons { font-size: 40px; width: 40px; height: 40px; }
.rrc-map-footer { padding: 15px; text-align: center; background: #fff; border-top: 1px solid #eee; }
#rrc-confirm-map-location {
    padding: 10px 25px; background: #0073aa; color: white; border: none; 
    border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%;
}
#rrc-confirm-map-location:hover { background: #005177; }

/* =========================================================================
   5. GRID & CARD STYLES
   ========================================================================= */

.rrc-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.rrc-grid-item { position: relative; perspective: 1000px; }

.rrc-card-inner {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; 
}

@media (min-width: 769px) {
    .rrc-card-inner:hover {
        transform: translateY(-7px) scale(1.02);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        border-color: #0073aa;
        z-index: 10;
    }
}

.rrc-card-media {
    position: relative !important; 
    width: 100%;
    padding-top: 66%;
    background: #ffffff;
    overflow: hidden;
}
.rrc-card-media img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; background-color: #ffffff;
    transition: transform 0.5s ease;
}
@media (min-width: 769px) {
    .rrc-card-inner:hover .rrc-card-media img { transform: scale(1.05); }
}

.rrc-stretched-link::after {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1; content: ""; pointer-events: auto;
}

/* PRICE BADGE: Top Left & Blue */
.rrc-price-badge.rrc-price-daily {
    position: absolute;
    top: 15px; /* Top */
    left: 15px; /* Left */
    bottom: auto;
    right: auto;
    background: #0073aa !important; /* Blue */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.95em;
    padding: 5px 10px;
    color: #fff;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(2px);
}
.rrc-price-badge .per-period { font-size: 0.75em; font-weight: 400; opacity: 0.9; margin-left: 2px; }

/* Content & Hover */
.rrc-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #fff;
}
.rrc-card-title { margin: 0 0 10px 0; font-size: 1.3em; line-height: 1.3; font-family: "Montserrat", sans-serif; }
.rrc-card-title a { text-decoration: none; color: #2c3e50; transition: color 0.2s; }
.rrc-card-title a:hover { color: #0073aa; }

.rrc-hover-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}
@media (min-width: 769px) {
    .rrc-card-inner:hover .rrc-hover-details {
        max-height: 500px; opacity: 1; margin-top: 15px;
    }
}

.rrc-price-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-bottom: 15px; background: #f9f9f9; padding: 10px;
    border-radius: 6px; font-size: 0.9em;
}
.rrc-price-grid div {
    display: flex; justify-content: space-between;
    border-bottom: 1px dotted #ddd; padding-bottom: 4px;
}

.rrc-card-actions { 
    display: flex; gap: 10px; margin-top: auto;
    position: relative; z-index: 5; 
}

.btn-view, .rrc-card-actions .btn {
    flex: 1; padding: 12px 15px;
    background-color: #0073aa; color: #fff;
    border: none; border-radius: 6px;
    font-weight: 600; text-align: center; text-decoration: none;
    transition: background 0.2s; display: inline-flex;
    align-items: center; justify-content: center; white-space: nowrap;
}
.btn-view:hover { background-color: #005177; color: #fff; }

.btn-grid-share {
    flex: 0 0 auto !important; width: 46px;
    background: transparent; border: 2px solid #eee !important; color: #0073aa;
    border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-grid-share:hover { background: #f0f7fc; border-color: #0073aa !important; color: #005177; }
.btn-grid-share .dashicons { font-size: 20px; width: auto; height: auto; }

/* Mobile Optimizations for Cards */
@media (max-width: 768px) {
    .rrc-hover-details { max-height: none !important; opacity: 1 !important; margin-top: 15px; }
    .rrc-card-inner { height: auto; }
    .rrc-card-inner:hover { transform: none; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
    .rrc-category-header { margin-left: 0 !important; padding-left: 15px !important; }
}

/* =========================================================================
   6. FEATURE BADGES (PRESERVED)
   ========================================================================= */
.rrc-badge-container {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 5;
    display: flex; flex-direction: column; gap: 8px;
}
.rrc-icon-badge {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    color: white; background-color: #555;
}
.rrc-icon-badge .dashicons {
    font-size: 18px; width: 18px; height: 18px; line-height: 18px;
}
/* Green Car (Delivery) */
.rrc-icon-badge.delivery { background: rgba(39, 174, 96, 0.95); }
/* Gold Lightning (Same Day) */
.rrc-icon-badge.sameday { background: rgba(243, 156, 18, 0.95); }

/* =========================================================================
   7. UTILITIES: LOADER, ERROR & LIGHTBOX
   ========================================================================= */
.rrc-infinite-loader, .rrc-no-more-items {
    font-size: 1.1em; padding: 15px;
}
.spin { animation: rrc-spin 1s linear infinite; }
@keyframes rrc-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Error Modal */
.rrc-error-content {
    background: #fff; padding: 30px; border-radius: 8px;
    max-width: 450px; width: 90%; position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.25); text-align: center;
}
.rrc-error-content h3 {
    margin-top: 0; color: #e74c3c; border-bottom: 1px solid #eee;
    padding-bottom: 15px; margin-bottom: 15px; font-size: 22px;
}
.rrc-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px;
    margin-top: -20px; margin-left: -20px; border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa; border-radius: 50%;
    animation: rrc-spin 1s linear infinite; z-index: 21;
}

/* Hide Lightbox */
#rr-lightbox-modal { display: none !important; }

/* =========================================================================
   8. MOBILE-FRIENDLY OVERRIDES (SINGLE PAGE)
   ========================================================================= */
@media (max-width: 768px) {
    .rr-master-rental-container {
        display: flex !important; flex-direction: column !important;
        gap: 20px !important; padding: 0 10px !important;
    }
    .rr-gallery-section, .rr-details-sidebar, .rr-full-description {
        width: 100% !important; max-width: 100% !important; flex: none !important;
    }
    .rr-gallery-main-stage { max-height: 300px !important; }
    .rr-gallery-main-stage img { height: auto !important; max-height: 300px !important; object-fit: contain !important; }
    
    /* Improve Sidebar visibility on mobile */
    .rr-details-sidebar {
        order: 2; /* Move sidebar below gallery but above description */
    }
    .rr-full-description {
        order: 3;
    }

    .rr-period-card { padding: 15px !important; font-size: 16px !important; }
    .rr-booking-action .rr-book-btn { padding: 20px !important; font-size: 18px !important; width: 100% !important; }
    
    /* Scroller for Related Items on Mobile */
    .rrc-related-scroller {
        padding: 10px 15px;
        margin-left: -10px;
        margin-right: -10px;
    }
    .rr-related-item {
        flex: 0 0 80%; /* Show part of the next item to hint at swiping */
        max-width: 80%;
    }
}

/* Force White Internal Boxes on Single Page */
.rr-features-box, .rr-location-box, 
.rr-card-content {
    background-color: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
}

/* =========================================================================
   9. RELATED ACCESSORIES SCROLLER
   ========================================================================= */
.rrc-related-slider-wrapper {
    margin-top: 40px; margin-bottom: 40px;
    padding-top: 20px;
    border: none !important; 
    box-shadow: none !important;
    background-color: #ffffff !important;
}

.rr-related-section h3 {
    margin-top: 0; margin-bottom: 20px; color: #2c3e50;
    font-size: 1.4rem; font-family: "Montserrat", sans-serif;
}
.rr-related-scroller {
    display: flex; overflow-x: auto; gap: 20px;
    padding: 10px 5px; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.rr-related-item {
    flex: 0 0 260px; max-width: 260px;
    border: 1px solid #e0e0e0; border-radius: 12px;
    overflow: hidden; background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s; display: flex; flex-direction: column;
}
.rr-related-item:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.rr-related-item .rrc-card-inner { border: none; box-shadow: none; height: 100%; }
.rr-related-item .rrc-card-media { padding-top: 60%; }
.rr-related-item .rrc-card-content { padding: 15px; }
.rr-related-item .rrc-card-title { font-size: 1.1rem; margin-bottom: 10px; }
.rr-related-item .rrc-price-grid { font-size: 0.85em; padding: 8px; margin-bottom: 10px; }
.rr-related-item .rrc-card-actions { margin-top: auto; }
.rr-related-item .btn-view { padding: 8px 12px; font-size: 0.9em; }

.rr-related-item .rrc-price-badge.rrc-price-daily {
    top: 10px; left: 10px; font-size: 0.85em;
}