/* Location Card - Optimized Layout */
.location-card {
    display: flex !important;
    gap: 16px !important;
    padding: 20px !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Image Section - Compact & Fixed Size */
.location-image-wrapper {
    flex-shrink: 0 !important;
    width: 120px !important;
    height: 120px !important;
}

.location-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
}

.location-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 48px !important;
    font-weight: bold !important;
    border-radius: 8px !important;
}

/* Content Section */
.location-content {
    flex: 1 !important;
    display: flex !important;
    gap: 20px !important;
    min-width: 0 !important;
}

/* Info Section - Left Side */
.location-info-section {
    flex: 0 0 300px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.location-name {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 4px 0 !important;
}

.location-distance-badge {
    display: inline-block !important;
    background: #e3f2fd !important;
    color: #1976d2 !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    width: fit-content !important;
    margin-bottom: 4px !important;
}

.location-address,
.location-phone {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.5 !important;
}

.location-phone a {
    color: #666 !important;
    text-decoration: none !important;
}

.location-phone a:hover {
    color: #1976d2 !important;
    text-decoration: underline !important;
}

.location-icon {
    flex-shrink: 0 !important;
    font-size: 14px !important;
}

/* Action Buttons */
.location-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 8px !important;
    flex-wrap: wrap !important;
}

.location-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    border: 1px solid !important;
}

.location-website-btn {
    background: #1976d2 !important;
    color: white !important;
    border-color: #1976d2 !important;
}

.location-website-btn:hover {
    background: #1565c0 !important;
    border-color: #1565c0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3) !important;
}

.location-directions-btn {
    background: white !important;
    color: #1976d2 !important;
    border-color: #1976d2 !important;
}

.location-directions-btn:hover {
    background: #e3f2fd !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2) !important;
}

.btn-icon {
    font-size: 16px !important;
}

.location-status {
    display: inline-block !important;
    padding: 6px 12px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 8px !important;
    width: fit-content !important;
}

.location-status.open {
    background: #4caf50 !important;
    color: white !important;
}

.location-status.closed {
    background: #f44336 !important;
    color: white !important;
}

/* Time Slots Section - Right Side */
.location-timeslots-section {
    flex: 1 !important;
    min-width: 200px !important;
    max-width: 450px !important;
}

.location-timeslots-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.location-timeslots-date {
    font-size: 13px !important;
    color: #666 !important;
    font-weight: normal !important;
}

/* FLEXIBLE GRID - Auto-adjusts based on content */
.location-timeslots-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
}

/* 4 slots or more - use 2x2 grid */
.location-timeslots-grid:has(.location-time-slot:nth-child(4)) {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* 3 slots - show in single row if space allows, otherwise stack */
.location-timeslots-grid:has(.location-time-slot:nth-child(3)):not(:has(.location-time-slot:nth-child(4))) {
    grid-template-columns: repeat(2, 1fr) !important;
}

.location-time-slot {
    padding: 12px 8px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: white !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
}

.location-time-slot:hover {
    border-color: #2196f3 !important;
    background: #e3f2fd !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3) !important;
}

.location-time-slot.selected {
    background: #2196f3 !important;
    color: white !important;
    border-color: #2196f3 !important;
}

/* View More Link */
.view-more-link-container {
    text-align: center !important;
    margin-top: 8px !important;
}

.view-more-link {
    color: #2196f3 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    border: 1px solid #2196f3 !important;
    transition: all 0.2s !important;
}

.view-more-link:hover {
    background: #2196f3 !important;
    color: white !important;
    transform: translateY(-2px) !important;
}

/* Tomorrow Section */
.location-timeslots-tomorrow {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid #e0e0e0 !important;
}

/* Responsive - Stack on smaller screens */
@media (max-width: 1024px) {
    .location-card {
        flex-direction: column !important;
    }
    
    .location-content {
        flex-direction: column !important;
    }
    
    .location-info-section {
        flex: 1 !important;
    }
    
    .location-timeslots-section {
        max-width: 100% !important;
    }
    
    /* 4 columns on tablet when stacked */
    .location-timeslots-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        grid-template-rows: auto !important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .location-image-wrapper {
        width: 100px !important;
        height: 100px !important;
    }
    
    .location-timeslots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    
    .location-time-slot {
        font-size: 13px !important;
        padding: 10px 6px !important;
    }
    
    .location-actions {
        flex-direction: column !important;
    }
    
    .location-action-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}
/* Main Container Layout */
.next-open-main-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.next-open-map-container {
    flex: 0 0 40%;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.next-open-locations-container {
    flex: 1;
    min-width: 0;
}

/* Map Styling */
.next-open-map {
    height: 600px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Location List - Clean List View */
.next-open-locations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Updated Location Card - List Style */
.location-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

.location-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-color: #2196F3;
}

/* Location Image - Fixed size on left */
.location-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-image-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 64px;
    font-weight: 700;
}

/* Location Content Area */
.location-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 20px;
}

/* Location Info Section */
.location-info-section {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
}

.location-card h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.location-address {
    color: #666;
    font-size: 14px;
    margin: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.location-address-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.location-phone {
    color: #666;
    font-size: 14px;
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.location-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.location-distance {
    background: #FF9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.location-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.location-status.open {
    background: #4CAF50;
    color: white;
}

.location-status.closed {
    background: #f44336;
    color: white;
}

/* Time Slots Section - Expanded Grid */
.location-timeslots-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.location-timeslots-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.location-timeslots-date {
    color: #666;
    font-size: 13px;
    font-weight: normal;
}

.location-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    max-width: 100%;
}

/* Wrapper to handle overflow on very small screens */
.location-timeslots-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.location-time-slot {
    padding: 6px 4px;
    border: 1.5px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 60px;
    max-width: 85px;
}

.location-time-slot:hover {
    border-color: #2196F3;
    background: #E3F2FD;
    transform: translateY(-1px);
}

.location-time-slot.selected {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* Tomorrow's slots styling */
.location-timeslots-tomorrow {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.tomorrow-label {
    font-size: 14px;
    font-weight: 600;
    color: #FF9800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Book Button */
.location-book-btn {
    width: 100%;
    max-width: 200px;
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.location-book-btn:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.location-book-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* View More Link */
.view-more-link-container {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.view-more-link {
    display: inline-block;
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 14px;
    border: 1.5px solid #2196F3;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.view-more-link:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-1px);
}

/* Modal Styles */
.next-open-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.next-open-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.next-open-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.next-open-modal-close:hover,
.next-open-modal-close:focus {
    color: #000;
}

.next-open-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3338;
    font-size: 24px;
}

.all-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.modal-slot {
    cursor: pointer !important;
}

/* Responsive modal */
@media (max-width: 768px) {
    .next-open-modal-content {
        margin: 10% 5%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .all-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}

/* No locations message */
.no-locations {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Loading Spinner */
.next-open-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1200px) {
    .next-open-main-container {
        flex-direction: column;
    }
    
    .next-open-map-container {
        flex: 1;
        position: relative;
    }
    
    .next-open-map {
        height: 400px;
    }
}

@media (max-width: 968px) {
    .location-card {
        flex-direction: column;
    }
    
    .location-image,
    .location-image-placeholder {
        width: 100%;
        height: 200px;
    }
    
    .location-content {
        flex-direction: column;
    }
    
    .location-info-section {
        flex: 1;
    }
    
    /* Keep 4 columns even on tablets */
}

@media (max-width: 640px) {
    .location-timeslots-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
    
    .location-time-slot {
        font-size: 10px;
        padding: 5px 2px;
        min-width: 55px;
    }
    
    .location-book-btn {
        max-width: 100%;
    }
}

/* Other existing styles */
.next-open-booking-widget {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.next-open-step {
    display: none;
}

.next-open-step.active {
    display: block;
}

.next-open-back-btn {
    background-color: #757575;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
}

.next-open-booking-summary {
    background-color: #E8F5E9;
    border-left: 4px solid #4CAF50;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.next-open-form .form-field {
    margin-bottom: 20px;
}

.next-open-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.next-open-form input,
.next-open-form select,
.next-open-form textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.next-open-form textarea {
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: #4CAF50;
    color: white;
    font-size: 48px;
    line-height: 80px;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.next-open-error {
    background-color: #FFEBEE;
    border-left: 4px solid #f44336;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 4px;
    color: #C62828;
}

.next-open-location-controls {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.next-open-use-location {
    background-color: #2196F3 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 16px;
}

.location-status {
    color: #4CAF50;
    font-size: 14px;
    font-weight: 500;
}
