/* ============================================================
   TripManga — Professional Cookie Consent Banner
   Brand: #038a52 (primary), #1a2b48 (dark), #f47c04 (accent)
   ============================================================ */

/* Overlay */
.tm-cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 43, 72, 0.6);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tm-cookie-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   BANNER (bottom bar)
   ============================================================ */
.tm-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    border-top: 3px solid #038a52;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tm-cookie-banner.active {
    transform: translateY(0);
}

.tm-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.tm-cookie-banner__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(3, 138, 82, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.tm-cookie-banner__content {
    flex: 1;
    min-width: 0;
}

.tm-cookie-banner__title {
    font-size: 15px;
    font-weight: 700;
    color: #1a2b48;
    margin: 0 0 4px;
    line-height: 1.3;
}

.tm-cookie-banner__text {
    font-size: 13px;
    color: #636363;
    line-height: 1.55;
    margin: 0;
}

.tm-cookie-banner__text a {
    color: #f47c04;
    text-decoration: none;
    font-weight: 500;
}

.tm-cookie-banner__text a:hover {
    text-decoration: underline;
}

.tm-cookie-banner__actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.tm-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.tm-cookie-btn:active {
    transform: scale(0.97);
}

.tm-cookie-btn--accept {
    background: #038a52;
    color: #fff;
}

.tm-cookie-btn--accept:hover {
    background: #026b40;
    box-shadow: 0 2px 8px rgba(3, 138, 82, 0.3);
}

.tm-cookie-btn--reject {
    background: #f0f2f5;
    color: #1a2b48;
}

.tm-cookie-btn--reject:hover {
    background: #e2e6ea;
}

.tm-cookie-btn--settings {
    background: transparent;
    color: #038a52;
    border: 1.5px solid #038a52;
    padding: 9px 18px;
}

.tm-cookie-btn--settings:hover {
    background: rgba(3, 138, 82, 0.06);
}

.tm-cookie-btn--save {
    background: #f47c04;
    color: #fff;
}

.tm-cookie-btn--save:hover {
    background: #d96a00;
    box-shadow: 0 2px 8px rgba(244, 124, 4, 0.3);
}


/* ============================================================
   SETTINGS MODAL (preferences panel)
   ============================================================ */
.tm-cookie-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    width: 480px;
    max-width: 100%;
    background: #fff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tm-cookie-modal.active {
    transform: translateX(0);
}

/* Modal header */
.tm-cookie-modal__header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tm-cookie-modal__title {
    font-size: 17px;
    font-weight: 700;
    color: #1a2b48;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tm-cookie-modal__title i {
    color: #038a52;
}

.tm-cookie-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f2f5;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #636363;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.tm-cookie-modal__close:hover {
    background: #e2e6ea;
    color: #1a2b48;
}

/* Modal body (scrollable) */
.tm-cookie-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    overscroll-behavior: contain;
}

.tm-cookie-modal__intro {
    font-size: 13px;
    color: #636363;
    line-height: 1.6;
    margin: 0 0 20px;
}

.tm-cookie-modal__intro a {
    color: #f47c04;
    text-decoration: none;
    font-weight: 500;
}

.tm-cookie-modal__intro a:hover {
    text-decoration: underline;
}

/* Cookie category cards */
.tm-cookie-category {
    background: #f8fafc;
    border: 1px solid #e8ecef;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.tm-cookie-category:hover {
    border-color: #d0d5da;
}

.tm-cookie-category--active {
    border-color: #038a52;
    background: rgba(3, 138, 82, 0.03);
}

.tm-cookie-category__header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.tm-cookie-category__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tm-cookie-category__icon--necessary {
    background: rgba(3, 138, 82, 0.12);
    color: #038a52;
}

.tm-cookie-category__icon--functional {
    background: rgba(26, 43, 72, 0.1);
    color: #1a2b48;
}

.tm-cookie-category__icon--analytics {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tm-cookie-category__icon--marketing {
    background: rgba(244, 124, 4, 0.1);
    color: #f47c04;
}

.tm-cookie-category__info {
    flex: 1;
    min-width: 0;
}

.tm-cookie-category__name {
    font-size: 14px;
    font-weight: 600;
    color: #1a2b48;
    margin: 0 0 2px;
    line-height: 1.3;
}

.tm-cookie-category__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.tm-cookie-category__badge--required {
    background: rgba(3, 138, 82, 0.12);
    color: #038a52;
}

.tm-cookie-category__count {
    font-size: 11.5px;
    color: #8896a4;
    line-height: 1.3;
}

/* Toggle switch */
.tm-cookie-toggle {
    position: relative;
    flex-shrink: 0;
}

.tm-cookie-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tm-cookie-toggle__track {
    display: block;
    width: 44px;
    height: 24px;
    background: #c5cdd5;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s ease;
    position: relative;
}

.tm-cookie-toggle input:checked + .tm-cookie-toggle__track {
    background: #038a52;
}

.tm-cookie-toggle input:disabled + .tm-cookie-toggle__track {
    background: #038a52;
    opacity: 0.7;
    cursor: not-allowed;
}

.tm-cookie-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease;
}

.tm-cookie-toggle input:checked + .tm-cookie-toggle__track::after {
    transform: translateX(20px);
}

/* Expandable details */
.tm-cookie-category__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #8896a4;
    font-size: 12px;
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.tm-cookie-category__expand.expanded {
    transform: rotate(180deg);
}

.tm-cookie-category__expand:hover {
    color: #1a2b48;
}

.tm-cookie-category__details {
    display: none;
    padding: 0 16px 14px;
    border-top: 1px solid #e8ecef;
}

.tm-cookie-category__details.show {
    display: block;
}

.tm-cookie-category__desc {
    font-size: 12.5px;
    color: #636363;
    line-height: 1.6;
    margin: 12px 0 0;
}

/* Cookie table inside details */
.tm-cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 11.5px;
}

.tm-cookie-table th {
    background: #038a52;
    color: #fff;
    font-weight: 600;
    padding: 7px 10px;
    text-align: left;
}

.tm-cookie-table th:first-child {
    border-radius: 6px 0 0 0;
}

.tm-cookie-table th:last-child {
    border-radius: 0 6px 0 0;
}

.tm-cookie-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e8ecef;
    color: #4a5568;
    vertical-align: top;
}

.tm-cookie-table tr:last-child td {
    border-bottom: none;
}

.tm-cookie-table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Modal footer */
.tm-cookie-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid #e8ecef;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.tm-cookie-modal__footer .tm-cookie-btn {
    flex: 1;
}


/* ============================================================
   FLOATING RE-OPEN BUTTON
   ============================================================ */
.tm-cookie-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
    width: 42px;
    height: 42px;
    background: #038a52;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(3, 138, 82, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    visibility: hidden;
}

.tm-cookie-reopen.active {
    opacity: 1;
    visibility: visible;
}

.tm-cookie-reopen:hover {
    background: #026b40;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(3, 138, 82, 0.45);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .tm-cookie-banner__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
        gap: 14px;
    }

    .tm-cookie-banner__icon {
        display: none;
    }

    .tm-cookie-banner__actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .tm-cookie-banner__actions .tm-cookie-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 12.5px;
    }

    .tm-cookie-modal {
        width: 100%;
    }

    .tm-cookie-modal__body {
        padding: 16px 18px;
    }

    .tm-cookie-modal__header {
        padding: 16px 18px;
    }

    .tm-cookie-modal__footer {
        padding: 14px 18px;
        flex-wrap: wrap;
    }

    .tm-cookie-modal__footer .tm-cookie-btn {
        font-size: 12.5px;
        padding: 10px 14px;
    }

    .tm-cookie-category__header {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .tm-cookie-banner__title {
        font-size: 14px;
    }

    .tm-cookie-banner__text {
        font-size: 12px;
    }

    .tm-cookie-banner__actions {
        gap: 8px;
    }

    .tm-cookie-banner__actions .tm-cookie-btn--settings {
        width: 100%;
        order: 3;
    }

    .tm-cookie-modal__footer {
        gap: 8px;
    }

    .tm-cookie-reopen {
        bottom: 14px;
        left: 14px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}
