/* Native disclosures share the existing consent controls at every viewport. */
.tigcookie-category > summary {
    display: flex;
    list-style: none;
    cursor: pointer;
}
.tigcookie-category > summary::-webkit-details-marker { display: none; }
.tigcookie-category > summary::marker { content: ""; }
.tigcookie-category > summary h3 { flex: 1; min-width: 0; }
.tigcookie-category > summary:focus-visible {
    outline: 2px solid #d4006c;
    outline-offset: 3px;
    border-radius: 5px;
}
.tigcookie-category-chevron {
    width: 5px;
    height: 5px;
    margin: -3px 3px 0 4px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    flex: 0 0 5px;
}
.tigcookie-category[open] > summary .tigcookie-category-chevron {
    margin-top: 3px;
    transform: rotate(225deg);
}

/* Short toggle labels ("Sí"/"No") are mobile-only; hidden everywhere else. */
.tigcookie-radio-text-short { display: none; }

/* Desktop reference: white compact card, Nappy pink actions and a soft badge. */
@media (min-width: 768px) {
    #tigcookiesoverlay {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    #tigcookiealert {
        box-sizing: border-box;
        height: 100dvh;
        padding: 22px;
    }
    #tigcookiealert .tigcookie-backdrop { background: rgba(0, 0, 0, .65); }
    .tigcookieConfPanel { width: 472px; max-width: calc(100vw - 44px); }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-main {
        box-sizing: border-box;
        width: 472px;
        max-width: 100%;
        max-height: calc(100dvh - 44px);
        border: 0;
        border-radius: 26px;
        background: #fff;
        color: #465971;
        font-family: var(--font-brand, "Quicksand"), sans-serif;
        box-shadow: 0 18px 32px rgba(0, 0, 0, .13);
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-header {
        flex: 0 0 auto;
        padding: 25px 26px 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-title {
        margin: 0 0 8px;
        color: #465971;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.4;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-content {
        flex: 0 1 auto;
        min-height: 0;
        max-height: none;
        padding: 0 26px;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #d4dbe2 transparent;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) :is(.tigcookie-description, .tigcookie-category-desc) {
        margin: 0;
        color: #586b83;
        font-size: 11.5px;
        font-weight: 400;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) :is(.tigcookie-description, .tigcookie-category-desc) p {
        margin: 0 0 8px;
        color: inherit;
        font: inherit;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) :is(.tigcookie-description, .tigcookie-category-desc) a {
        color: #d4006c;
        font-size: inherit;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-separator {
        height: 1px;
        margin: 0;
        background: #edf0f2;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-description + .tigcookie-separator {
        margin-top: 14px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category { margin: 0; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-header {
        gap: 8px;
        min-height: 40px;
        margin: 0;
        padding: 10px 0;
        box-sizing: border-box;
        color: #465971;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-header h3 {
        margin: 0;
        color: inherit;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.45;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-body { padding: 1px 0 13px; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-badge-always {
        padding: 3px 9px;
        border-radius: 999px;
        background: #fde3ef;
        color: #d4006c;
        font-size: 9px;
        font-weight: 600;
        line-height: 1.5;
        white-space: nowrap;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-group {
        display: inline-flex;
        gap: 0;
        margin: 8px 0 0;
        padding: 2px;
        border-radius: 999px;
        background: #f7f8fa;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio { position: relative; margin: 0; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-circle { display: none; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 25px;
        min-width: 59px;
        padding: 5px 12px;
        border-radius: 999px;
        box-sizing: border-box;
        color: #465971;
        font-size: 10px;
        line-height: 1.4;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio input:checked ~ .tigcookie-radio-label {
        background: #d4006c;
        color: #fff;
        font-weight: 700;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio input:focus-visible ~ .tigcookie-radio-label {
        outline: 2px solid #d4006c;
        outline-offset: 2px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-confirm-row { margin: 10px 0 2px; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn {
        font-family: inherit;
        font-size: 11.5px;
        line-height: 1.4;
        border-radius: 999px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-confirm {
        padding: 5px 0;
        background: transparent;
        color: #d4006c;
        font-size: 11px;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-actions {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 9px;
        padding: 0 26px 24px;
        border: 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-actions .tigcookie-btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 40px;
        padding: 10px 16px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-primary {
        border: 1px solid #d4006c;
        background: #d4006c;
        color: #fff;
        font-weight: 700;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-primary:hover { background: #b7005d; border-color: #b7005d; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-secondary {
        border: 1px solid #e9ecef;
        background: #fff;
        color: #465971;
        font-weight: 600;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-secondary:hover { color: #d4006c; border-color: #d4006c; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn:focus-visible { outline: 2px solid #d4006c; outline-offset: 3px; }
    .fancybox-wrap:has(.tigcookieConfPanel) .fancybox-skin { border-radius: 26px; background: transparent; }
    .fancybox-inner:has(.tigcookieConfPanel) { overflow: visible !important; }
}

/* Mobile: full-width bottom sheet, collapsible categories (like desktop),
   neutral description texts, Sí/No toggles and stacked pill actions. Uses dvh
   so the actions clear the mobile browser toolbar (e.g. Chrome address bar). */
@media (max-width: 767px) {
    /* Anchor the initial banner to the bottom as a sheet. dvh keeps the sheet
       (and its buttons) above the browser chrome. */
    #tigcookiesoverlay { height: 100vh; height: 100dvh; align-items: flex-end; }
    #tigcookiealert { height: 100vh; height: 100dvh; align-items: flex-end; }
    #tigcookiealert .tigcookie-backdrop { background: rgba(0, 0, 0, .55); }

    /* Bottom-anchor the reopened config panel served through fancybox and lift
       it above the browser toolbar (vh - dvh ≈ toolbar height). */
    .fancybox-wrap:has(.tigcookieConfPanel) {
        top: auto !important;
        bottom: 0 !important;
        bottom: calc(100vh - 100dvh) !important;
        left: 0 !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .fancybox-wrap:has(.tigcookieConfPanel) .fancybox-skin,
    .fancybox-inner:has(.tigcookieConfPanel) {
        width: 100% !important;
        background: transparent;
    }
    .fancybox-inner:has(.tigcookieConfPanel) { overflow: visible !important; }
    .tigcookieConfPanel { width: 100% !important; max-width: 100% !important; padding: 0; }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-main {
        position: relative;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        border: 0;
        border-radius: 22px 22px 0 0;
        background: #fff;
        color: #465971;
        font-family: var(--font-brand, "Quicksand"), sans-serif;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .16);
        overflow: hidden;
    }
    /* Grab handle at the top of the sheet. */
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-main::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: #e4e8ee;
        z-index: 2;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-header {
        flex: 0 0 auto;
        padding: 22px 20px 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-title {
        margin: 0 0 6px;
        color: #465971;
        font-size: 19px;
        font-weight: 700;
        line-height: 1.35;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-content {
        flex: 0 1 auto;
        min-height: 0;
        max-height: none;
        padding: 8px 20px 4px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) :is(.tigcookie-description, .tigcookie-category-desc) {
        margin: 0;
        color: #586b83;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-description p {
        margin: 0 0 6px;
        color: inherit;
        font: inherit;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-description a,
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-policy-link {
        display: inline-block;
        margin-top: 4px;
        color: #d4006c;
        font-size: 13px;
        font-weight: 700;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-separator {
        height: 1px;
        margin: 14px 0;
        background: #eef1f4;
    }

    /* Collapsible categories (same behaviour as desktop): closed by default,
       tap the header to reveal the description and the Sí/No toggle inside. */
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category { margin: 0; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category > summary {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        margin: 0;
        padding: 6px 0;
        cursor: pointer;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category > summary h3 {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
        color: #465971;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-chevron {
        flex: 0 0 auto;
        width: 7px;
        height: 7px;
        margin: -3px 2px 0 6px;
        color: #9aa6b6;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category[open] > summary .tigcookie-category-chevron {
        margin-top: 3px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-body {
        margin: 0;
        padding: 0 0 12px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-category-desc {
        margin: 0 0 10px;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-badge-always {
        flex: 0 0 auto;
        padding: 4px 12px;
        border-radius: 999px;
        background: #fde3ef;
        color: #d4006c;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.4;
        white-space: nowrap;
    }

    /* Sí/No segmented toggle shown inside the expanded body. */
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-group {
        display: inline-flex;
        gap: 0;
        align-items: center;
        margin: 0;
        padding: 2px;
        border-radius: 999px;
        background: #f4f5f7;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio {
        position: relative;
        margin: 0;
        gap: 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-circle { display: none; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 54px;
        padding: 7px 16px;
        border-radius: 999px;
        box-sizing: border-box;
        color: #6b7a8d;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio input:checked ~ .tigcookie-radio-label {
        background: #d4006c;
        color: #fff;
        font-weight: 700;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio input:focus-visible ~ .tigcookie-radio-label {
        outline: 2px solid #d4006c;
        outline-offset: 2px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-text-full {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-radio-text-short { display: inline; }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-confirm-row {
        justify-content: flex-start;
        margin: 14px 0 4px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-confirm {
        padding: 4px 0;
        background: transparent;
        color: #d4006c;
        font-size: 13px;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-actions {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 10px;
        padding: 8px 20px calc(18px + env(safe-area-inset-bottom, 0px));
        border: 0;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn {
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        border-radius: 999px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-modal-actions .tigcookie-btn {
        flex: 0 0 auto;
        width: 100%;
        min-height: 48px;
        padding: 13px 20px;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-primary {
        border: 1px solid #d4006c;
        background: #d4006c;
        color: #fff;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-primary:hover { background: #b7005d; border-color: #b7005d; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-secondary {
        border: 1px solid #e4e8ee;
        background: #fff;
        color: #465971;
        font-weight: 600;
    }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn-secondary:hover { color: #d4006c; border-color: #d4006c; }
    :is(#tigcookiealert, .tigcookieConfPanel) .tigcookie-btn:focus-visible { outline: 2px solid #d4006c; outline-offset: 3px; }
}
