/**
 * Storefront cookie consent — card banner + preferences panel.
 */

#j2p-storefront-cookie-root .js-cookie-consent.cookie-consent,
#j2p-storefront-cookie-root .cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 10000000001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: 0 max(1rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

#j2p-storefront-cookie-root .cookie-consent__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 1;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

#j2p-storefront-cookie-root .cookie-consent__wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(36rem, 100%);
    margin: 0 auto;
    pointer-events: none;
}

#j2p-storefront-cookie-root .cookie-consent__panel,
#j2p-storefront-cookie-root .cookie-consent .cookie-consent__btn,
#j2p-storefront-cookie-root .cookie-consent .cookie-consent__agree {
    pointer-events: auto;
}

#j2p-storefront-cookie-root .cookie-consent__panel {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.14);
    max-height: min(85vh, 32rem);
    overflow-y: auto;
}

/* —— Banner body —— */
#j2p-storefront-cookie-root .cookie-consent__body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem 0;
}

#j2p-storefront-cookie-root .cookie-consent__body--prefs {
    padding-bottom: 0.25rem;
}

#j2p-storefront-cookie-root .cookie-consent__icon-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: rgba(var(--color-primary-rgb, 59, 130, 246), 0.1);
    color: var(--color-primary, #3b82f6) !important;
    font-size: 1.15rem;
}

#j2p-storefront-cookie-root .cookie-consent__copy {
    flex: 1 1 auto;
    min-width: 0;
}

#j2p-storefront-cookie-root .cookie-consent__heading {
    margin: 0 0 0.4rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-dark, #0f172a) !important;
    letter-spacing: -0.01em;
}

#j2p-storefront-cookie-root .cookie-consent__subtext {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(15, 23, 42, 0.65) !important;
}

#j2p-storefront-cookie-root .cookie-consent__message,
#j2p-storefront-cookie-root .cookie-consent__message p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.55 !important;
    font-weight: 400 !important;
    color: rgba(15, 23, 42, 0.78) !important;
}

#j2p-storefront-cookie-root .cookie-consent__message a {
    color: var(--color-primary, #3b82f6) !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

/* —— Footer actions —— */
#j2p-storefront-cookie-root .cookie-consent__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.35rem 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
    margin-top: 1rem;
    background: rgba(248, 250, 252, 0.6);
}

#j2p-storefront-cookie-root .cookie-consent__footer--prefs {
    margin-top: 0;
}

#j2p-storefront-cookie-root .cookie-consent__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#j2p-storefront-cookie-root .cookie-consent__btn--primary {
    background: var(--color-primary, #3b82f6) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#j2p-storefront-cookie-root .cookie-consent__btn--primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 59, 130, 246), 0.35);
}

#j2p-storefront-cookie-root .cookie-consent__btn--outline {
    background: #fff !important;
    color: var(--color-dark, #0f172a) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

#j2p-storefront-cookie-root .cookie-consent__btn--outline:hover {
    background: rgba(15, 23, 42, 0.03) !important;
    border-color: rgba(15, 23, 42, 0.22) !important;
}

#j2p-storefront-cookie-root .cookie-consent__btn--text {
    background: transparent !important;
    color: rgba(15, 23, 42, 0.65) !important;
    border-color: transparent !important;
    min-height: 2.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#j2p-storefront-cookie-root .cookie-consent__btn--text:hover {
    color: var(--color-dark, #0f172a) !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

#j2p-storefront-cookie-root .cookie-consent .cookie-consent__agree {
    min-height: 2.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

/* —— Preferences —— */
#j2p-storefront-cookie-root .cookie-consent__categories {
    list-style: none;
    margin: 0;
    padding: 0 1.35rem;
}

#j2p-storefront-cookie-root .cookie-consent__category {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

#j2p-storefront-cookie-root .cookie-consent__category:last-child {
    border-bottom: none;
}

#j2p-storefront-cookie-root .cookie-consent__category-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#j2p-storefront-cookie-root label.cookie-consent__category-main {
    cursor: pointer;
}

#j2p-storefront-cookie-root .cookie-consent__category-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-dark, #0f172a) !important;
}

#j2p-storefront-cookie-root .cookie-consent__category-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary, #3b82f6) !important;
    background: rgba(var(--color-primary-rgb, 59, 130, 246), 0.1);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
}

#j2p-storefront-cookie-root .cookie-consent__category-desc {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(15, 23, 42, 0.58) !important;
}

#j2p-storefront-cookie-root .cookie-consent__toggle {
    position: relative;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 1.5rem;
}

#j2p-storefront-cookie-root .cookie-consent__toggle-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

#j2p-storefront-cookie-root .cookie-consent__toggle-track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    transition: background 0.15s ease;
}

#j2p-storefront-cookie-root .cookie-consent__toggle-track::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

#j2p-storefront-cookie-root .cookie-consent__toggle-input:checked + .cookie-consent__toggle-track {
    background: var(--color-primary, #3b82f6);
}

#j2p-storefront-cookie-root .cookie-consent__toggle-input:checked + .cookie-consent__toggle-track::after {
    transform: translateX(1.25rem);
}

#j2p-storefront-cookie-root .cookie-consent--customize-open .cookie-consent__panel {
    max-height: min(90vh, 36rem);
}

@media only screen and (max-width: 540px) {
    #j2p-storefront-cookie-root .cookie-consent {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    #j2p-storefront-cookie-root .cookie-consent__body {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1.1rem 1.1rem 0;
    }

    #j2p-storefront-cookie-root .cookie-consent__icon-wrap {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    #j2p-storefront-cookie-root .cookie-consent__footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 0.85rem 1.1rem 1.1rem;
    }

    #j2p-storefront-cookie-root .cookie-consent__footer .cookie-consent__btn {
        width: 100%;
    }

    #j2p-storefront-cookie-root .cookie-consent__footer--banner .cookie-consent__btn--text {
        order: 3;
    }

    #j2p-storefront-cookie-root .cookie-consent__categories {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #j2p-storefront-cookie-root .cookie-consent__btn,
    #j2p-storefront-cookie-root .cookie-consent__toggle-track,
    #j2p-storefront-cookie-root .cookie-consent__toggle-track::after,
    #j2p-storefront-cookie-root .cookie-consent__backdrop {
        transition: none;
    }
}
