/**
 * Frontend Banner & Modal Styles for Argusa Cookies
 * Ultra-scoped under #argusa-cookie-root
 */

#argusa-cookie-root {
    position: fixed;
    z-index: 99999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--arg-c-text, #e2e8f0);
    box-sizing: border-box;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#argusa-cookie-root *,
#argusa-cookie-root *::before,
#argusa-cookie-root *::after {
    box-sizing: border-box;
}

/* --- Posiciones del Banner --- */
#argusa-cookie-root.argusa-pos-bottom-floating {
    bottom: 24px;
    right: 24px;
    max-width: 440px;
    width: calc(100% - 48px);
}

#argusa-cookie-root.argusa-pos-bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
}

#argusa-cookie-root.argusa-pos-bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: calc(100% - 48px);
}

/* Responsive móvil */
@media (max-width: 640px) {
    #argusa-cookie-root.argusa-pos-bottom-floating,
    #argusa-cookie-root.argusa-pos-bottom-center {
        bottom: 12px;
        left: 12px;
        right: 12px;
        transform: none;
        width: calc(100% - 24px);
    }
}

/* --- Caja del Banner --- */
.argusa-cookie-box {
    background: var(--arg-c-bg, #121620);
    border: 1px solid var(--arg-c-border, #232a3b);
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 24px;
    backdrop-filter: blur(12px);
    animation: argusaFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#argusa-cookie-root.argusa-pos-bottom-bar .argusa-cookie-box {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 20px 30px;
}

@keyframes argusaFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.argusa-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.argusa-logo-shield {
    color: var(--arg-c-primary, #f5a623);
    display: flex;
    align-items: center;
}

.argusa-banner-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.argusa-banner-body p {
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--arg-c-text, #cbd5e1);
}

.argusa-policy-link a {
    color: var(--arg-c-primary, #f5a623);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.argusa-policy-link a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* --- Botones del Banner --- */
.argusa-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.argusa-btn {
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: none;
}

.argusa-btn-primary {
    background: var(--arg-c-primary, #f5a623);
    color: var(--arg-c-primary-text, #0e1017);
    flex: 1 1 auto;
}

.argusa-btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.argusa-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid var(--arg-c-border, #2d3748);
    flex: 1 1 auto;
}

.argusa-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.argusa-btn-text {
    background: transparent;
    color: #94a3b8;
    padding: 9px 12px;
}

.argusa-btn-text:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

/* --- Modal de Preferencias --- */
.argusa-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100000000;
    animation: argusaFadeIn 0.25s ease forwards;
}

@keyframes argusaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.argusa-modal-container {
    background: var(--arg-c-bg, #121620);
    border: 1px solid var(--arg-c-border, #232a3b);
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.argusa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--arg-c-border, #232a3b);
}

.argusa-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.argusa-modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.argusa-modal-close-btn:hover {
    color: #fff;
}

.argusa-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.argusa-modal-desc {
    margin: 0 0 16px;
    font-size: 13.5px;
    color: #94a3b8;
}

.argusa-categories-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.argusa-category-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--arg-c-border, #232a3b);
    border-radius: 8px;
    padding: 14px 16px;
    transition: background 0.2s;
}

.argusa-category-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.argusa-category-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.argusa-category-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.argusa-category-info strong {
    font-size: 14px;
    color: #f1f5f9;
}

.argusa-tag-required {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.argusa-category-row-body p {
    margin: 8px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: #94a3b8;
}

.argusa-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--arg-c-border, #232a3b);
    display: flex;
    justify-content: flex-end;
}

/* --- Toggles Switch --- */
.argusa-toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.argusa-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.argusa-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: 0.25s;
    border-radius: 22px;
}

.argusa-toggle-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.25s;
    border-radius: 50%;
}

.argusa-toggle-switch input:checked + .argusa-toggle-slider {
    background-color: var(--arg-c-primary, #f5a623);
}

.argusa-toggle-switch input:checked + .argusa-toggle-slider::before {
    transform: translateX(20px);
    background-color: var(--arg-c-primary-text, #0e1017);
}

.argusa-toggle-switch input:disabled + .argusa-toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- Botón Flotante Persistente --- */
.argusa-floating-btn {
    position: fixed;
    bottom: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--arg-c-bg, #121620);
    border: 1px solid var(--arg-c-border, #232a3b);
    color: var(--arg-c-cookie-icon, var(--arg-c-primary, #f5a623));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
                opacity 0.25s ease, 
                background 0.25s ease, 
                color 0.25s ease, 
                box-shadow 0.25s ease,
                left 0.25s ease,
                right 0.25s ease;
    z-index: 9999999;
}

.argusa-floating-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.argusa-floating-btn:hover {
    transform: scale(1.1);
    background: #1a202c;
}

.argusa-floating-btn:hover svg {
    transform: rotate(15deg);
}

.argusa-floating-btn.argusa-float-bottom-left {
    left: 20px;
}

.argusa-floating-btn.argusa-float-bottom-right {
    right: 20px;
}

/* Modo Discreto / Semi-transparente (Opción 3 Inteligente) */
.argusa-floating-btn.argusa-style-discrete {
    opacity: 0.35;
    transform: scale(0.9);
    background: rgba(18, 22, 32, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.argusa-floating-btn.argusa-style-discrete:hover,
.argusa-floating-btn.argusa-style-discrete:focus-visible,
.argusa-floating-btn.argusa-style-discrete.is-active-hover {
    opacity: 1;
    transform: scale(1.08);
    background: var(--arg-c-bg, #121620);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 166, 35, 0.25);
}

/* Modo Pestaña Retraída en el borde lateral */
.argusa-floating-btn.argusa-style-tab.argusa-float-bottom-left {
    left: -14px;
    opacity: 0.5;
    border-radius: 0 24px 24px 0;
}

.argusa-floating-btn.argusa-style-tab.argusa-float-bottom-left:hover {
    left: 16px;
    opacity: 1;
    border-radius: 50%;
}

.argusa-floating-btn.argusa-style-tab.argusa-float-bottom-right {
    right: -14px;
    opacity: 0.5;
    border-radius: 24px 0 0 24px;
}

.argusa-floating-btn.argusa-style-tab.argusa-float-bottom-right:hover {
    right: 16px;
    opacity: 1;
    border-radius: 50%;
}

/* ==========================================================================
   BRICKS BUILDER EDITOR SAFEGUARDS
   Never display or capture clicks inside Bricks Builder editor/iframe
   ========================================================================== */
.brx-body.iframe #argusa-cookie-root,
body[data-builder-window="iframe"] #argusa-cookie-root,
body.bricks-is-builder #argusa-cookie-root {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

