/* Booking Page Styles */

.booking-container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Dashboard Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
    border-top: 4px solid var(--primary-color, #d32f2f);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 10px 0;
}

.product-price {
    font-size: 1.1rem;
    color: var(--primary-color, #d32f2f);
    font-weight: bold;
}

.product-stock {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Selection Matrix */
.matrix-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 80px;
    /* Space for sticky footer */
}

.booking-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on small screens */
}

.booking-table th,
.booking-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.booking-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.booking-table td:first-child,
.booking-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: #fff;
    /* Sticky col background */
    z-index: 1;
    border-right: 2px solid #f0f0f0;
}

.booking-table th:first-child {
    background: #f8f9fa;
}

.member-name {
    font-weight: bold;
    font-size: 1rem;
}

.checkbox-cell {
    cursor: pointer;
}

.checkbox-cell input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color, #d32f2f);
    cursor: pointer;
}

/* Sticky Footer */
.booking-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.total-section {
    font-size: 1.2rem;
    font-weight: bold;
}

.total-price {
    color: var(--primary-color, #d32f2f);
    font-size: 1.5rem;
    margin-left: 10px;
}

.checkout-btn {
    background: var(--primary-color, #d32f2f);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.checkout-btn:hover:not(:disabled) {
    background: #b71c1c;
}

@media (max-width: 768px) {
    .booking-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .checkout-btn {
        width: 100%;
    }
}

/* Family List Styles */
.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.family-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.family-card h4 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.family-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.empty-family {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.empty-family .btn-secondary {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #eee;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
}

.empty-family .btn-secondary:hover {
    background: #ddd;
}

/* Print Styles for Bill */
@media print {

    /* Hide non-essential elements */
    .navbar,
    .booking-footer,
    .btn,
    .pay-btn,
    .payment-methods,
    #pay-later-link,
    #checkout-btn,
    .booking-tabs,
    .page-header p,
    .service-action,
    .checkout-btn,
    footer,
    /* Assuming there is a footer tag in base layout */
    .no-print {
        display: none !important;
    }

    /* Reset Layout for Print */
    body,
    .booking-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
        background: white;
    }

    .booking-container {
        padding: 20px;
    }

    /* Improve Typography for Print */
    h1,
    h2,
    h3 {
        color: #000;
    }

    /* Force background graphics (if user enables it, otherwise ensures high contrast) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Card styling removal for cleaner print */
    .card,
    .gp-card,
    .service-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    /* Specific Print Header */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    /* Ensure Total is Visible */
    #order-total {
        color: #000 !important;
    }
}

.print-header {
    display: none;
    /* Hidden on screen */
}