/**
 * Alamarte Cookie Consent Pro - Styles
 * @package     Alamarte.Plugin
 * @subpackage  System.CookieConsent
 * @author      Andrés Restrepo <info@alamarte.com>
 * @copyright   Copyright (C) 2026 ALAMARTE Ingeniería
 * @license     GNU General Public License version 3 or later
 */

.acc-banner {
    position: fixed;
    left: 0;
    right: 0;
    background-color: var(--acc-bg-color, #1a1a2e);
    color: var(--acc-text-color, #ffffff);
    z-index: var(--acc-zindex, 999999);
    padding: 1rem;
    box-sizing: border-box;
    font-family: var(--acc-font-family, inherit);
    font-size: var(--acc-text-font-size-desktop, 16px);
    font-weight: var(--acc-text-font-weight, 400);
    font-style: var(--acc-text-font-style, normal);
    text-decoration: var(--acc-text-text-decoration, none);
    line-height: var(--acc-text-line-height, 1.5);
    letter-spacing: var(--acc-text-letter-spacing, 0);
    text-transform: var(--acc-text-transform, none);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.acc-hidden {
    display: none !important;
}

.acc-banner-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}


.acc-position-bottom-bar .acc-banner-inner,
.acc-position-top-bar .acc-banner-inner {
    max-width: var(--acc-width, 100%);
}

.acc-position-bottom-bar {
    bottom: 0;
}

.acc-position-top-bar {
    top: 0;
}

.acc-position-modal-center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: min(var(--acc-container-width, 600px), calc(100% - 40px));
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}

.acc-position-modal-center .acc-banner-inner {
    text-align: center;
}

.acc-position-corner-left,
.acc-position-corner-right {
    bottom: 20px;
    width: var(--acc-container-width, 350px);
    max-width: calc(100% - 40px);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}

.acc-position-corner-left {
    left: 20px;
    right: auto;
}

.acc-position-corner-right {
    right: 20px;
    left: auto;
}

.acc-header {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
}

.acc-title {
    margin: 0 0 0.5rem;
    font-size: var(--acc-title-font-size-desktop, 20px);
    font-weight: var(--acc-title-font-weight, 600);
    font-style: var(--acc-title-font-style, normal);
    text-decoration: var(--acc-title-text-decoration, none);
    line-height: var(--acc-title-line-height, 1.2);
    letter-spacing: var(--acc-title-letter-spacing, 0);
    text-transform: var(--acc-title-text-transform, none);
    color: var(--acc-text-color, #ffffff);
    text-align: center;
    width: 100%;
}

.acc-icon {
    font-size: var(--acc-cookie-icon-size-desktop, 48px);
    margin: 0.5rem 0;
    color: var(--acc-cookie-icon-color, #f4a460);
    line-height: 1;
}

.acc-cookie-icon-above-center .acc-icon,
.acc-cookie-icon-above-left .acc-icon,
.acc-cookie-icon-above-right .acc-icon {
    display: block;
    width: 100%;
}

.acc-cookie-icon-above-center .acc-icon { text-align: center; }
.acc-cookie-icon-above-left .acc-icon { text-align: left; }
.acc-cookie-icon-above-right .acc-icon { text-align: right; }

.acc-cookie-icon-title-left,
.acc-cookie-icon-title-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.acc-cookie-icon-title-left .acc-icon,
.acc-cookie-icon-title-right .acc-icon {
    flex: 0 0 auto;
    margin: 0 0 0.5rem;
}

.acc-cookie-icon-title-left .acc-title,
.acc-cookie-icon-title-right .acc-title {
    width: auto;
    flex: 0 1 auto;
}

.acc-cookie-icon-title-right .acc-title { order: 1; }
.acc-cookie-icon-title-right .acc-icon { order: 2; }

.acc-icon svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    animation: acc-cookie-wobble 1s ease-in-out;
}

@keyframes acc-cookie-wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.acc-description {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.acc-text {
    margin: 0 0 0.5rem;
    font: inherit;
    color: inherit;
}

.acc-text strong,
.acc-text b {
    font-weight: 700;
}

.acc-text p:last-child {
    margin-bottom: 0;
}

.acc-privacy {
    width: 100%;
    text-align: center;
    margin: 0.35rem 0 0.65rem;
}

.acc-settings-open .acc-privacy {
    margin-top: 0.4rem;
    margin-bottom: 1.1rem;
}

.acc-privacy-context {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.acc-privacy-context-text {
    min-width: 0;
}

.acc-privacy-context-text > :first-child {
    margin-top: 0;
}

.acc-privacy-context-text > :last-child {
    margin-bottom: 0;
}

.acc-privacy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--acc-privacy-btn-text, #ffffff);
    background-color: var(--acc-privacy-btn-bg, #252671);
    text-decoration: var(--acc-button-text-decoration, none);
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 0.28rem 0.72rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.acc-privacy-link:hover,
.acc-privacy-link:focus-visible {
    color: var(--acc-privacy-btn-hover-text, #252671);
    background-color: var(--acc-privacy-btn-hover-bg, #ffffff);
    border-color: currentColor;
    text-decoration: var(--acc-button-text-decoration, none);
}

.acc-privacy-link:active {
    transform: scale(0.98);
}

.acc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
}

.acc-buttons-gdpr {
    max-width: 520px;
}

.acc-buttons-gdpr .acc-btn-reject,
.acc-buttons-gdpr .acc-btn-accept {
    flex: 1 1 0;
    min-width: 140px;
}

.acc-settings-entry {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 0 0.5rem;
}

.acc-settings-entry .acc-btn-settings {
    flex: 1 0 100%;
    width: 100%;
}

.acc-btn,
.acc-manage,
.acc-privacy-link,
.acc-status {
    font-family: var(--acc-button-font-family, var(--acc-font-family, inherit));
    font-size: var(--acc-button-font-size-desktop, 16px);
    font-weight: var(--acc-button-font-weight, 500);
    font-style: var(--acc-button-font-style, normal);
    line-height: var(--acc-button-line-height, 1.3);
    letter-spacing: var(--acc-button-letter-spacing, 0);
    text-transform: var(--acc-button-text-transform, none);
}

.acc-btn,
.acc-manage,
.acc-privacy-link {
    text-decoration: var(--acc-button-text-decoration, none);
}

.acc-btn,
.acc-manage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
}

.acc-btn {
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
}

.acc-btn:active,
.acc-manage:active {
    transform: scale(0.98);
}

.acc-btn:focus-visible,
.acc-manage:focus-visible,
.acc-privacy-link:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.acc-btn-accept {
    background-color: var(--acc-btn-accept-bg, #4CAF50);
    color: var(--acc-btn-accept-text, #ffffff);
}

.acc-btn-accept:hover,
.acc-btn-accept:focus-visible {
    background-color: var(--acc-btn-accept-hover-bg, #4CAF50);
    color: var(--acc-btn-accept-hover-text, #ffffff);
}

.acc-btn-reject {
    background-color: var(--acc-btn-reject-bg, #f44336);
    color: var(--acc-btn-reject-text, #ffffff);
}

.acc-btn-reject:hover,
.acc-btn-reject:focus-visible {
    background-color: var(--acc-btn-reject-hover-bg, #f44336);
    color: var(--acc-btn-reject-hover-text, #ffffff);
}

.acc-btn-settings,
.acc-btn-save {
    background-color: var(--acc-btn-settings-bg, #607D8B);
    color: var(--acc-btn-settings-text, #ffffff);
}

.acc-btn-settings:hover,
.acc-btn-settings:focus-visible,
.acc-btn-save:hover,
.acc-btn-save:focus-visible {
    background-color: var(--acc-btn-settings-hover-bg, #607D8B);
    color: var(--acc-btn-settings-hover-text, #ffffff);
}

.acc-btn-save {
    width: 100%;
    margin-top: 1rem;
}

.acc-button-icon,
.acc-privacy-link-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: currentColor;
}

.acc-button-icon svg,
.acc-privacy-link-icon svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.acc-button-icon-size-normal {
    font-size: 1.1em;
}

.acc-button-icon-size-medium {
    font-size: 1.3em;
}

.acc-button-icon-size-large {
    font-size: 1.5em;
}

.acc-gdpr-panel {
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 1rem;
}

.acc-gdpr-panel[hidden] {
    display: none !important;
}

.acc-settings-open .acc-header,
.acc-settings-open .acc-description,
.acc-settings-open .acc-settings-entry {
    display: none !important;
}

.acc-settings-open .acc-gdpr-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.acc-settings-open .acc-banner-inner {
    justify-content: flex-start;
    padding-top: 1.35rem;
}

.acc-category {
    margin-bottom: 0.75rem;
}

.acc-category-heading,
.acc-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.acc-category-name {
    font-weight: var(--acc-category-name-weight, 600);
}

.acc-category-label {
    cursor: pointer;
}

.acc-category-label-readonly {
    cursor: default;
}

.acc-category-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.acc-category-label-readonly input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 1;
}

.acc-category-name-necessary {
    font-weight: 700;
}

.acc-category-heading,
.acc-category-label,
.acc-category-desc {
    font-size: 1em;
    line-height: inherit;
}

.acc-category-desc {
    margin: 0.25rem 0 0 1.75rem;
    opacity: 0.85;
}

.acc-status {
    position: fixed;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    z-index: var(--acc-zindex, 999999);
    max-width: min(420px, calc(100vw - 32px));
    padding: 0.65rem 0.9rem;
    color: var(--acc-text-color, #ffffff);
    background-color: var(--acc-bg-color, #1a1a2e);
    border: 1px solid currentColor;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.acc-manage {
    position: fixed;
    z-index: var(--acc-zindex, 999999);
    max-width: min(280px, calc(100vw - 32px));
    padding: 0.55rem 0.8rem;
    background-color: var(--acc-manage-btn-bg, #607D8B);
    color: var(--acc-manage-btn-text, #ffffff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.acc-manage-bottom-left,
.acc-manage-top-left {
    left: 16px;
    right: auto;
}

.acc-manage-bottom-center,
.acc-manage-top-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.acc-manage-bottom-right,
.acc-manage-top-right {
    left: auto;
    right: 16px;
}

.acc-manage-bottom-left,
.acc-manage-bottom-center,
.acc-manage-bottom-right {
    top: auto;
    bottom: 16px;
}

.acc-manage-top-left,
.acc-manage-top-center,
.acc-manage-top-right {
    top: 16px;
    bottom: auto;
}

.acc-manage-bottom-center:active,
.acc-manage-top-center:active {
    transform: translateX(-50%) scale(0.98);
}

.acc-manage:hover,
.acc-manage:focus-visible {
    background-color: var(--acc-manage-btn-hover-bg, #607D8B);
    color: var(--acc-manage-btn-hover-text, #ffffff);
}

.acc-settings-close {
    display: none;
    position: absolute;
    top: 6px;
    right: 8px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--acc-text-color, #ffffff);
    background: transparent;
    font: inherit;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.acc-settings-open .acc-settings-close {
    display: inline-flex;
}

.acc-settings-close:hover,
.acc-settings-close:focus-visible {
    background-color: rgba(255, 255, 255, 0.14);
}

.acc-settings-close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

.acc-test-mode-badge {
    position: absolute;
    top: 5px;
    left: 10px;
    right: auto;
    background-color: #ff9800;
    color: #000000;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 1;
}

@media (max-width: 768px) {
    .acc-banner {
        padding: 0.85rem;
        font-size: var(--acc-text-font-size-mobile, 16px);
    }

    .acc-title {
        font-size: var(--acc-title-font-size-mobile, 20px);
    }

    .acc-icon {
        font-size: var(--acc-cookie-icon-size-mobile, 48px);
    }

    .acc-btn,
    .acc-manage,
    .acc-privacy-link,
    .acc-status {
        font-size: var(--acc-button-font-size-mobile, 16px);
    }

    .acc-banner-inner {
        text-align: center;
    }

    .acc-buttons {
        justify-content: center;
        width: 100%;
    }

    .acc-btn {
        flex: 1 1 140px;
        min-width: 0;
        white-space: normal;
    }

    .acc-position-corner-left,
    .acc-position-corner-right {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .acc-manage {
        max-width: calc(100vw - 20px);
    }

    .acc-manage-bottom-left,
    .acc-manage-top-left {
        left: 10px;
    }

    .acc-manage-bottom-right,
    .acc-manage-top-right {
        right: 10px;
    }

    .acc-manage-bottom-left,
    .acc-manage-bottom-center,
    .acc-manage-bottom-right {
        bottom: 10px;
    }

    .acc-manage-top-left,
    .acc-manage-top-center,
    .acc-manage-top-right {
        top: 10px;
    }

    .acc-status {
        bottom: 70px;
        max-width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .acc-banner,
    .acc-btn,
    .acc-manage,
    .acc-icon svg {
        transition: none;
        animation: none;
    }
}

@media print {
    .acc-banner,
    .acc-manage,
    .acc-status {
        display: none !important;
    }
}
