/* ===== CARD STYLES ===== */
.card.h-100 {
    transition: box-shadow 0.2s, transform 0.2s;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card.h-100:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px) scale(1.02);
}

.card-img-top {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    object-fit: cover;
    height: 180px;
}

/* ===== LAYOUT COMPONENTS ===== */
.filter-bar {
    background: #f8f9fa;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 1.5rem;
    padding: 2.5rem 1.5rem;
    display: inline-block;
}

/* ===== NAVIGATION ===== */
.navbar-brand {
    letter-spacing: 2px;
}

/* ===== TYPOGRAPHY ===== */
.display-4 {
    font-weight: 800;
    letter-spacing: 1px;
}

/* ===== BUTTONS AND BADGES ===== */
.badge.bg-danger {
    font-size: 0.9rem;
    padding: 0.5em 0.8em;
    border-radius: 0.7em;
}

.btn-success,
.btn-outline-dark {
    border-radius: 2rem;
}

/* ===== BACKGROUND ===== */
body {
    /*background: #4a6982;*/
    /*background: linear-gradient(0deg,rgba(74, 105, 130, 1) 0%, rgba(163, 184, 168, 1) 50%, rgba(255, 255, 230, 1) 100%);*/
}

/* ===== FLOATING BUTTONS ===== */
.floating-btn,
.floating-chat-btn {
    position: fixed;
    bottom: 2rem;
    z-index: 1050;
    color: #fff;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    font-size: 1.7rem;
    border: none;
    transition: background 0.2s;
    text-decoration: none;
}

.floating-btn {
    right: 2rem;
    background: #198754;
}

.floating-btn:hover {
    background: #157347;
    color: #fff;
}

.floating-chat-btn {
    left: 2rem;
    background: #0d6efd;
}

.floating-chat-btn:hover {
    background: #0b5ed7;
    color: #fff;
}

/* ===== MODAL SCROLL FIXES ===== */
/* Override Bootstrap modal behavior to allow scrolling */
.modal {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Allow body scrolling when modal is open */
.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Ensure modal backdrop doesn't block scrolling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Modal dialog positioning and scrolling */
.modal-dialog {
    margin: 1.75rem auto;
    pointer-events: auto;
    position: relative;
    width: auto;
}

.modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 1rem;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-dialog-centered.modal-dialog-scrollable {
    height: auto;
    min-height: calc(100% - 3.5rem);
}

.modal-dialog-centered.modal-dialog-scrollable .modal-content {
    max-height: none;
}

/* Modal content styling */
.modal-content {
    pointer-events: auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    outline: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Modal body specific heights for different modals */
.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Specific height controls for content-heavy modals */
#cartModal .modal-body,
#checkoutModal .modal-body,
#ordersModal .modal-body,
#viewAppointmentsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#productDetailsModal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

/* Custom scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Modal header and footer positioning */
.modal-header,
.modal-footer {
    flex-shrink: 0;
    padding: 1rem;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.5rem - 1px);
    border-top-right-radius: calc(0.5rem - 1px);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.5rem - 1px);
    border-bottom-left-radius: calc(0.5rem - 1px);
}

/* Ensure floating buttons work with modals */
.floating-btn,
.floating-chat-btn {
    z-index: 1055;
}

/* Responsive modal adjustments */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .modal-dialog-scrollable .modal-body {
        max-height: calc(100vh - 140px);
    }
    
    #cartModal .modal-body,
    #checkoutModal .modal-body,
    #ordersModal .modal-body,
    #viewAppointmentsModal .modal-body {
        max-height: 60vh;
    }
    
    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
    }
}

@media (min-width: 992px) {
    .modal-lg {
        max-width: 800px;
    }
}

/* Animation improvements */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Loading spinner for modals */
.modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.modal-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Form elements in modals */
.modal .form-control,
.modal .form-select {
    margin-bottom: 0.5rem;
}

.modal .row {
    margin-left: 0;
    margin-right: 0;
}

/* Cart items specific styling */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

/* Product grid in modals */
.modal .product-grid {
    max-height: none;
}

/* Ensure modal z-index hierarchy */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Fix for nested modals if needed */
.modal + .modal {
    z-index: 1060;
}

.modal + .modal .modal-backdrop {
    z-index: 1050;
}

