/* =================================================== */
/* GLOBAL VARIABLES (Set to Occasor Brand Colors)      */
/* =================================================== */
:root {
    --primary-color: #fa5754; /* Primary Action Red */
    --primary-dark: #e54643; /* Primary Dark for Hover */
    --secondary-color: #333; /* Dark text/header color */
    --accent-color: #5c67f2; /* A strong accent color for borders/highlights */
    --light-bg: #f8f9fa; /* Light gray background */
    --border-color: #e9ecef; /* Light border */
    --text-muted: #6c757d; /* Muted text */
}

.address-list {
    max-height: 40vh; /* Set a maximum height (e.g., 40% of the viewport height) */
    overflow-y: auto; /* Enable vertical scrolling */
    padding-right: 15px; /* Add space for the scrollbar */
    margin-bottom: 20px !important; /* Ensure separation from the hr/button below */
}

/* =================================================== */
/* 1. GENERAL & LAYOUT STYLES                          */
/* =================================================== */

h1 {
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.cart-container {
    margin: 0 auto;
    padding: 2.5rem 1rem;
    min-height: 350px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}
.card-body {
    padding: 1rem !important;
}

/* Custom Vendor Card Header (Red/Pink Background) */
.vendor-card-header {
    background-color: #ffe6e6 !important; 
    padding: 1rem 1.5rem; 
    border-radius: 8px 8px 0 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
}
.vendor-header-icon {
    color: var(--primary-color) !important;
}
.text-vendor-highlight {
    color: var(--secondary-color);
}

/* Alert styles for empty cart/guest warning */
.alert-warning, .alert-info {
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 1.1rem;
}
.alert-warning .alert-link {
    color: var(--primary-color);
    font-weight: 700;
}

/* =================================================== */
/* 2. CART ITEM LIST STYLES */
/* =================================================== */

.cart-item {
    padding: 15px 0; 
    border-bottom: 1px solid var(--border-color);
}
.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.package-name a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s;
    text-decoration: none;
}
.package-name a:hover {
    text-decoration: underline !important;
}
.vendor-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.remove-item-btn {
    background-color: transparent;
    border: none;
    padding: .375rem .75rem;
}
.remove-item-btn:hover {
    opacity: 0.8;
}

/* =================================================== */
/* 3. BOOKING DETAILS STYLES */
/* =================================================== */

/* Applies to booking-details-card and address-summary-card */
.booking-details-card, .address-summary-card {
    border: 1px solid var(--border-color); 
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
    background-color: #F4f4f4; /* Light gray background for the card body */
}

.booking-details-header {
    background-color: var(--light-bg); 
    padding: .8rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.15rem;
    font-weight: 700; 
    color: var(--secondary-color);
    border-radius: 8px 8px 0 0;
}

.booking-details-header i {
    color: var(--primary-color); 
    font-size: 1.3rem; 
    margin-right: 10px;
}

.booking-details-card .form-control {
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.booking-details-card .form-label {
    margin-bottom: 0.3rem;
    color: var(--secondary-color);
}
.procced-card {
    background-color: #F4F4F4;
}

/* Address Summary Card Specific Styles (New, Concise Display) */
.address-summary-card .card-body {
    background-color: white !important; /* Make the summary clean white */
}
#currentAddressDisplay {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 10px !important;
}

/* =================================================== */
/* 3.5. ADDRESS SELECTION MODAL STYLES (Focus on List) */
/* =================================================== */

/* Target the list generated by the niceSelect plugin */
.nice-select {
    font-size: .875rem !important;
    margin-bottom: 2px; /* Small spacing between select and error */
    width: 100% !important;
}

#newAddressForm .msg-error {
    /* Display as a block element so it starts on a new line and uses full width */
    display: block; 
    margin-top: 3px; /* Ensure visual space below the niceSelect element */
    line-height: 1.2;
}

.address-actions .edit-address-btn {
    margin-right: 5px; /* Adjust this value (e.g., 5px) to control the gap */
}

.nice-select .option {
    font-size: .875rem !important;
}
.nice-select .list {
    max-height: 250px; /* Set a maximum height for the dropdown options */
    overflow-y: auto !important; /* Enable vertical scrolling when needed */
    /* Ensure the list is positioned correctly above other content */
    z-index: 1060; 
}

.address-item {
    transition: all 0.2s ease;
    border: 1px solid var(--border-color) !important;
    background-color: white;
    position: relative; 
    cursor: pointer; /* Ensures the whole box has pointer cursor */
}
.address-item:hover {
    background-color: var(--light-bg);
}

/* Hide the default radio button */
.address-item input[type="radio"] {
    position: absolute; 
    opacity: 0;
}

/* Style the label to cover the item and inherit pointer */
.address-item label {
    display: block; 
    width: 100%;
    height: 100%;
    cursor: inherit;
}

/* Visually highlight the selected address */
.address-item.border-primary {
    border-width: 2px !important;
    border-color: var(--accent-color) !important; /* Use accent color for focus */
    background-color: #f6f8ff; /* Very light background for selected item */
}
.address-item.border-primary label strong {
    color: var(--secondary-color) !important;
}

/* Badge Color Fix */
.badge.bg-primary {
    /* Default badge (Blue) */
    background-color: var(--accent-color) !important; 
    color: #ffffff !important;
}
.badge.bg-secondary {
    /* Home/Work badges (Grey) */
    background-color: var(--text-muted) !important;
    color: #ffffff !important;
}


/* =================================================== */
/* 4. CART SUMMARY STYLES (Focus on Button)            */
/* =================================================== */

.cart-summary {
    position: sticky;
    top: 100px; /* Adjust based on your header height */
    padding: 0;
}

.summary-details {
    padding: 1rem 1.5rem;
}

.summary-details h5 {
    font-weight: 700;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.summary-details p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--text-muted);
}

.summary-total {
    padding: 1rem 1.5rem;
    border-top: 1px dashed var(--border-color);
}

.summary-total h4 {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
}

#proceedToBookingBtn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 8px; /* Match card border radius */
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.3s;
    pointer-events: auto; /* Default state */
    opacity: 1; /* Default state */
}

#proceedToBookingBtn:hover:not(.disabled) {
    background-color: var(--primary-dark);
}

#proceedToBookingBtn.disabled {
    cursor: not-allowed;
    /* Opacity and pointer-events handled by cart.js for disabling */
}
.badge {
    color: #ffffff !important;
}
.spinner-border {
    vertical-align: middle !important;
    margin-right: 5px;
}

/* =================================================== */
/* 4. ADDRESS MODAL REDESIGN STYLES                    */
/* =================================================== */

/* Grid Layout for Address Cards */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 5px; /* Prevent shadow clipping */
}

/* Address Card Base Style */
.address-card {
    transition: all 0.2s ease-in-out;
    border: 2px solid var(--border-color) !important;
    background-color: #fff;
    position: relative;
    cursor: pointer;
}

.address-card:hover {
    border-color: #ccc !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Selected State (Triggered by hidden radio input) */
.btn-check:checked + .address-card {
    border-color: var(--primary-color) !important;
    background-color: #fff5f5; /* Very light red tint */
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Checkmark Icon */
.selected-checkmark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-check:checked + .address-card .selected-checkmark {
    opacity: 1;
    transform: scale(1);
}

/* Typography Tweaks */
.address-name {
    font-size: 1rem;
    color: var(--secondary-color);
}

.address-text {
    line-height: 1.4;
}

/* Dashed Border Button for "Add New" */
.dashed-border-btn {
    border: 2px dashed var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    transition: all 0.2s;
}

.dashed-border-btn:hover {
    background-color: #fff5f5;
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* Delete Button Positioning Fix */
.delete-address-btn {
    opacity: 0.6;
    transition: opacity 0.2s;
}
.address-card-container:hover .delete-address-btn {
    opacity: 1;
}