﻿

/* Availability table: moved from TEMPLATE_PROPERTY.aspx */
#CANNES {
    margin-bottom: 1.5rem !important;
}

.availability-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    border: 1px solid #d9e2f1;
    table-layout: auto;
}

    .availability-table thead th {
        background: #338ff7;
        color: #fff;
        text-transform: uppercase;
        font-size: 12px;
        letter-spacing: 0.03em;
        padding: 12px 10px;
        border: 1px solid #2b7bd6;
        white-space: nowrap;
    }

    .availability-table tbody td {
        padding: 10px;
        border: 1px solid #d9e2f1;
        font-size: 14px;
        color: #1f2937;
        vertical-align: middle;
        white-space: nowrap;
        text-align: center;
    }

        .availability-table tbody td:first-child {
            text-align: left;
        }

    .availability-table tbody tr:nth-child(even) {
        background: #f6faff;
    }

    .availability-table tbody tr:hover {
        background: #edf5ff;
    }

    .availability-table .btn {
        min-width: 110px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 400;
        padding: 5px 10px;
    }

    .availability-table .btn-primary,
    .availability-table .btn-outline-primary,
    .availability-table .btn-secondary {
        background: #338ff7;
        border-color: #338ff7;
        color: #fff;
    }

    .availability-table .btn:hover {
        background: #1f72cf;
        border-color: #1f72cf;
        color: #fff;
    }

/* Stacked card layout (one row per field): phones and small tablets only */
@media (max-width: 767px) {
    .availability-table,
    .availability-table tbody,
    .availability-table tr,
    .availability-table td {
        display: block;
        width: 100%;
    }

        .availability-table thead {
            display: none;
        }

        .availability-table tbody tr {
            margin-bottom: 8px;
            border: 1px solid #d9e2f1;
            border-radius: 4px;
            overflow: hidden;
            background: #fff !important;
        }

        .availability-table tbody td {
            border-left: none;
            border-right: none;
            border-top: none;
            border-bottom: 1px solid #e6edf8;
            white-space: normal;
            /* Keep field labels left, but align field values right on stacked layout */
            text-align: right !important;
            display: grid;
            grid-template-columns: 33% 67%;
            gap: 8px;
            align-items: center;
            padding: 7px 8px;
            font-size: 13px;
        }

            .availability-table tbody td:last-child {
                border-bottom: none;
            }

            .availability-table tbody td::before {
                font-weight: 600;
                color: #1f2937;
                text-align: left;
                padding-right: 0;
            }

            .availability-table tbody td:nth-child(1)::before {
                content: "Start";
            }

            .availability-table tbody td:nth-child(2)::before {
                content: "Nights";
            }

            .availability-table tbody td:nth-child(3)::before {
                content: "Price";
            }

        /* Button rows: no pseudo-labels (buttons are self-explanatory) */
        .availability-table tbody td:has(.btn)::before {
            display: none;
            content: none;
        }

        .availability-table tbody td:has(.btn) {
            display: block;
            text-align: center !important;
        }

        /* Stacked layout: natural button width, centred (full width only at ≤430px) */
        .availability-table tbody td:has(.btn) .btn {
            width: fit-content;
            max-width: 100%;
            min-width: 110px;
            display: block;
            margin-left: auto;
            margin-right: auto;
            padding: 8px 10px;
            font-size: 13px;
            white-space: nowrap;
            text-align: center;
            box-sizing: border-box;
        }

        /* Sold periods: empty action cells (no button) — hide on stacked layout */
        .availability-table tbody td:nth-child(n+4):not(:has(.btn)) {
            display: none !important;
        }
}

/* ≤430px: full-width buttons; label + value stay on one line */
@media (max-width: 430px) {
    .availability-table tbody td {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 6px;
    }

        .availability-table tbody td::before {
            margin-bottom: 0;
            white-space: nowrap;
        }

    .availability-table tbody td:has(.btn) .btn {
        width: 100%;
        max-width: none;
        white-space: normal !important;
    }
}
