/* =============================================================================
   Thailand Retreats — Cookie Consent Banner & Modal
   ============================================================================= */

/* ── Banner ──────────────────────────────────────────────────────────────── */
#tr-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #2c2c2c;
    color: #f0f0f0;
    padding: 16px 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    line-height: 1.5;
}

.tr-cookie-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
}

#tr-cookie-banner p {
    margin: 0;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 400px;
    flex: 1 1 400px;
    color: #f0f0f0;
}

.tr-cookie-policy-link,
.tr-cookie-policy-link:visited {
    color: #7dc9f0;
    text-decoration: underline;
}

.tr-cookie-buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

#tr-cookie-banner .tr-cookie-btn {
    display: inline-block;
    white-space: nowrap;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 16px;
    margin: 0;
    text-decoration: none;
    background: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#tr-cookie-banner #tr-cookie-accept-all {
    background-color: #007fc4;
    border-color: #007fc4;
    color: #fff;
}

#tr-cookie-banner #tr-cookie-accept-all:hover,
#tr-cookie-banner #tr-cookie-accept-all:focus {
    background-color: #005f96;
    border-color: #005f96;
    color: #fff;
}

#tr-cookie-banner #tr-cookie-reject-all {
    background-color: transparent;
    border-color: #aaa;
    color: #f0f0f0;
}

#tr-cookie-banner #tr-cookie-reject-all:hover,
#tr-cookie-banner #tr-cookie-reject-all:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

#tr-cookie-banner #tr-cookie-manage {
    border-color: transparent;
    color: #7dc9f0;
    text-decoration: underline;
    padding: 8px 6px;
}

/* ── Modal z-index — sit above site nav ──────────────────────────────────── */
#trCookieModal.modal { z-index: 100000; }
#trCookieModal + .modal-backdrop { z-index: 99999; }

/* ── Modal footer buttons — fully standalone, no Bootstrap dependency ─────── */
.tr-modal-btn {
    display: inline-block;
    white-space: nowrap;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 16px;
    margin: 0;
    text-decoration: none;
    background: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tr-modal-btn-primary {
    background-color: #007fc4;
    border-color: #007fc4;
    color: #fff;
}

.tr-modal-btn-primary:hover,
.tr-modal-btn-primary:focus {
    background-color: #005f96;
    border-color: #005f96;
    color: #fff;
}

.tr-modal-btn-default {
    background-color: #fff;
    border-color: #ccc;
    color: #333;
}

.tr-modal-btn-default:hover,
.tr-modal-btn-default:focus {
    background-color: #e8e8e8;
    border-color: #adadad;
    color: #333;
}

.tr-modal-btn-link {
    border-color: transparent;
    background-color: transparent;
    color: #007fc4;
    text-decoration: underline;
}

.tr-modal-btn-link:hover,
.tr-modal-btn-link:focus {
    color: #005f96;
    background-color: transparent;
}

/* ── Modal — category rows ────────────────────────────────────────────────── */
.tr-cookie-category {
    margin-bottom: 10px;
}

.tr-cookie-category-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 6px;
}

.tr-cookie-category-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.tr-cookie-table {
    font-size: 12px;
    margin-bottom: 0;
}

.tr-cookie-table th {
    background-color: #f5f5f5;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.tr-cookie-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.tr-cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.tr-cookie-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
}

.tr-cookie-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    -webkit-transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
}

.tr-cookie-toggle input:checked + .tr-cookie-slider {
    background-color: #007fc4;
}

.tr-cookie-toggle input:checked + .tr-cookie-slider::before {
    -webkit-transform: translateX(22px);
    transform: translateX(22px);
}

.tr-cookie-toggle input:focus + .tr-cookie-slider {
    box-shadow: 0 0 0 2px rgba(0, 127, 196, 0.4);
}

/* ── Footer link ──────────────────────────────────────────────────────────── */
#tr-cookie-manage-link {
    cursor: pointer;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .tr-cookie-inner {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: flex-start;
    }

    .tr-cookie-buttons {
        width: 100%;
    }

    .tr-cookie-btn {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        text-align: center;
    }
}
