/* =========================================
   1. GLOBAL VARIABLES & TYPOGRAPHY
   ========================================= */
:root {
    --ww-primary: #2c3e50; 
    --ww-accent: #e67e22;  
    --ww-bg-light: #f8f9fa;
    --ww-border-radius: 8px;
    --ww-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --ww-transition: all 0.3s ease;
}

.workways-btn {
    cursor: pointer;
    transition: var(--ww-transition);
    font-family: inherit;
}

/* =========================================
   2. SEARCH PAGE (CUSTOM AVAILABILITY BAR)
   ========================================= */

.wwp-availability-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; 
    background: #ffffff;
    padding: 20px;
    border-radius: var(--ww-border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    align-items: flex-end; 
    margin-bottom: 40px; 
}

/* Inputs & Selects - STRICT ALIGNMENT */
.wwp-availability-bar input[type="date"],
.wwp-availability-bar select {
    margin-top: 0 !important; 
    padding: 0 12px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: #f9f9f9;
    width: 100%;
    transition: border-color 0.2s;
    height: 45px !important; 
    line-height: 43px !important;
    box-sizing: border-box;
    display: block;
}

.wwp-availability-bar input:focus,
.wwp-availability-bar select:focus {
    border-color: var(--ww-accent);
    background-color: #fff;
    outline: none;
}

/* Check Availability Button */
#check-availability-btn {
    background-color: var(--ww-accent) !important; 
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0 25px;
    height: 45px !important; 
    line-height: 45px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    flex: 0 0 auto;
}

#check-availability-btn:hover {
    background-color: #d35400 !important; 
    transform: translateY(-1px);
}

/* Force hide the availability checker calendar */
.jet-listing-grid__item .workways-calendar,
.workways-room-card .workways-calendar {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* =========================================
   MAKE WHOLE CARD CLICKABLE
   ========================================= */
.workways-room-card { position: relative; }
.workways-book-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; cursor: pointer;
}
.workways-room-card:hover { border-color: var(--ww-accent); cursor: pointer; }

/* =========================================
   SEARCH BAR INTERNAL STYLING
   ========================================= */
.wwp-availability-bar-inner {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.wwp-bar-row { display: flex; gap: 15px; margin-bottom: 15px; }
.wwp-inputs-row { align-items: flex-end; }

/* Quick Buttons (Search Bar) */
.wwp-qbtn-filter {
    padding: 8px 16px;
    border: 1px solid #666;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}
.wwp-qbtn-filter:hover { background: #eee; border-color: #ccc; }
.wwp-qbtn-filter.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }

/* Inputs */
.wwp-input-group { flex: 1; display: flex; flex-direction: column; }
.wwp-input-group label { font-size: 0.85em; font-weight: 600; margin-bottom: 5px; color: #444; }
.wwp-input-group input, .wwp-input-group select { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; height: 42px; }

/* Check Button */
.wwp-btn-group button {
    background: #2c3e50; color: white; border: none; padding: 0 20px; height: 42px;
    border-radius: 4px; cursor: pointer; font-weight: 600; text-transform: uppercase; width: 100%;
}
.wwp-btn-group button:hover { background: #34495e; }

/* Naked Mode */
.wwp-availability-bar-inner.wwp-naked {
    background: transparent; padding: 0; box-shadow: none; border: none; margin: 0;
}
.wwp-naked .wwp-inputs-row { margin-bottom: 0; gap: 10px; }
.wwp-naked input, .wwp-naked select, .wwp-naked button { height: 40px; border-radius: 4px; font-size: 14px; }
.wwp-naked .wwp-buttons-row { margin-bottom: 5px; gap: 5px; }
.wwp-naked .wwp-qbtn-filter { padding: 2px 12px; font-size: 13px; text-transform: uppercase; background: #eee; border: 1px solid #ddd; }
.wwp-naked .wwp-qbtn-filter.active { background: #000; color: #fff; }
.wwp-label-sm { font-size: 13px; text-transform: uppercase; font-weight: bold; color: #888; align-self: center; height: 32px; }

@media (max-width: 768px) { .wwp-bar-row { flex-direction: column; } }

/* =========================================
   3. BOOKING FORM & BUTTONS
   ========================================= */
#workways-booking-form button[type="submit"],
#workways-registration-form button[type="submit"] {
    background-color: #5c7444 !important;
    color: #ffffff !important;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 1;
    visibility: visible;
}

#workways-booking-form button[type="submit"]:disabled,
#workways-registration-form button[type="submit"]:disabled {
    background-color: #5c7444 !important;
    cursor: not-allowed;
}

.workways-booking-wrapper { padding-bottom: 50px; }

/* High-Contrast Quick Select Buttons */
#workways-booking-form .wwp-quick-buttons .wwp-qbtn {
    background-color: #ffffff !important;
    color: #5c7444 !important;
    border: 1px solid #2c3e50 !important;
    padding: 0px 15px;
    border-radius: 4px;
    font-weight: 600 !important;
    min-width: 100px;
    text-align: center;
    transition: all 0.2s ease;
    opacity: 1 !important;
    visibility: visible !important;
}

#workways-booking-form .wwp-quick-buttons .wwp-qbtn:hover { background-color: #f8f4f0 !important; }
#workways-booking-form .wwp-quick-buttons .wwp-qbtn.active {
    background-color: #2c3e50 !important; color: #ffffff !important; border-color: #2c3e50 !important;
}

/* Force One-Line Layout (Desktop) */
@media (min-width: 992px) {
    #workways-booking-form .workways-form-grid {
        display: grid !important;
        grid-template-columns: 2fr 1fr 1fr 1fr !important; 
        gap: 15px !important;
        align-items: end !important;
    }
    #workways-booking-form .workways-form-row {
        grid-column: span 1 !important; width: 100% !important; margin-bottom: 0 !important;
    }
}

/* Sleek Price Display */
.workways-price-box {
    background: transparent !important; border-top: 1px solid #eee;
    padding: 15px 0 !important; margin-top: 20px !important;
    text-align: right !important; display: flex; flex-direction: column; align-items: flex-end;
}
.workways-price-box span {
    font-size: 0.8em; font-weight: bold; color: #888; text-transform: uppercase; margin-right: 0;
}
.workways-price {
    font-size: 1.5rem !important; color: #2c3e50 !important; font-weight: 800;
}

/* Spinner */
.wwp-spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 3px solid rgba(44,62,80,0.3); border-radius: 50%;
    border-top-color: #2c3e50; animation: wwp-spin 1s ease-in-out infinite; margin-left: 10px;
}
@keyframes wwp-spin { to { transform: rotate(360deg); } }

/* ——— FINAL BUTTON TEXT FIX ——— */
#workways-registration-form button[type="submit"],
#workways-registration-form button[type="submit"] span,
#workways-booking-form button[type="submit"],
#workways-booking-form button[type="submit"] span {
    color: #ffffff !important;        
    fill: #ffffff !important;         
    text-shadow: none !important;     
    opacity: 1 !important;            
    visibility: visible !important;   
    text-indent: 0 !important;        
    font-family: inherit !important;  
}

/* ——— MAP LINK ——— */
.ww-map-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
   /* color: var(--ww-accent, #e67e22) !important; */
    font-weight: 600;
    text-decoration: none;
    margin-left: 10px;
    font-size: 0.9em;
}
.ww-map-link:hover { text-decoration: underline; }

/* ——— RELATED ROOMS ——— */
.ww-related-wrapper {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    width: 100%;
}
.ww-related-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
}
.ww-related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}
.ww-related-card {
    flex: 1 1 30%; 
    min-width: 250px; 
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.ww-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.ww-related-img {
    height: 180px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}
.ww-related-info {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}
.ww-related-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}
.ww-related-info span {
    font-size: 0.85em;
    color: #777;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

/* =========================================
   4. MOBILE MASTER FIX (ULTRA-TIGHT VERSION)
   ========================================= */

@media (max-width: 768px) {

    /* --- PART 1: ULTRA-TIGHT SEARCH BAR --- */
    
    /* 1. Reduce Container Padding (Was 15px) */
    .wwp-availability-bar,
    .wwp-availability-bar-inner {
        padding: 12px 10px !important; /* Tighter edges */
        gap: 0 !important; /* Remove flex gap, use grid gap instead */
        align-items: stretch !important;
    }

    /* 2. Quick Buttons: Tighter to the Date Field */
    .wwp-bar-row.wwp-buttons-row {
        flex-direction: row !important;
        gap: 6px !important;
        margin-bottom: 8px !important; /* Reduced from 15px */
    }
    
    .wwp-qbtn-filter {
        flex: 1; 
        padding: 0 !important;
        height: 34px !important; /* Slightly shorter button */
        font-size: 11px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* 3. Input Grid: Tighter Gaps */
    .wwp-bar-row.wwp-inputs-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important; /* Reduced from 12px */
        width: 100%;
        margin-bottom: 0 !important;
        align-items: end !important;
    }

    /* Grid Positioning (Same as before) */
    .wwp-input-group:nth-child(1) { grid-column: span 2; } /* Date */
    .wwp-input-group:nth-child(2) { grid-column: span 1; } /* Start Time */
    .wwp-input-group:nth-child(3) { grid-column: span 1; } /* End Time */
    
    /* Check Button */
    .wwp-input-group:last-child { 
        grid-column: span 2; 
        margin-top: 4px; /* Pull button closer to inputs */
    }

    /* 4. Shrink Labels and Inputs */
    .wwp-input-group label {
        font-size: 10px !important; /* Tiny, clean labels */
        margin-bottom: 1px !important; /* Almost zero gap between label and input */
        line-height: 1.2 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #888;
    }
    
    .wwp-input-group input, 
    .wwp-input-group select,
    .workways-btn {
        height: 38px !important; /* Compact height */
        font-size: 14px !important;
        padding: 0 8px !important;
        line-height: normal !important;
    }

    /* Hide the "Quick:" text label completely */
    .wwp-label-sm { display: none !important; }


    /* --- PART 2: BOOKING MODAL FIX (Keep these fixes) --- */

    #workways-booking-form .workways-form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    #workways-booking-form .workways-form-row:nth-child(1) { grid-column: span 2; } /* Date */
    #workways-booking-form .workways-form-row:nth-child(4) { grid-column: span 2; } /* People */

    #workways-booking-form .wwp-quick-buttons {
        display: flex;
        gap: 6px;
    }
    #workways-booking-form .wwp-qbtn {
        flex: 1;
        padding: 0 !important;
        font-size: 11px !important;
        height: 36px !important;
        min-width: auto !important;
        justify-content: center;
        display: flex; 
        align-items: center;
    }
    
    .workways-price-box {
        text-align: center !important;
        justify-content: center !important;
    }
}