/* ═══════════════════════════════════════════════
   panel & cookie & newsletter
═══════════════════════════════════════════════ */
:root {
    --navy: #131921;
    --nav: #232f3e;
    --orange: #febd69;
    --cta: #ff9900;
    --cta-h: #e47911;
    --red: #cc0c39;
    --green: #007600;
    --blue: #007185;
    --bg-page: #eaeded;
    --bg-white: #ffffff;
    --bg-light: #f3f3f3;
    --tx-dark: #0f1111;
    --tx-mid: #565959;
    --tx-muted: #8f9191;
    --bd: #dddddd;
    --rad: 6px;
    --rad-lg: 10px;
    --sh: 0 2px 8px rgba(0, 0, 0, .12);
    --sh-md: 0 4px 18px rgba(0, 0, 0, .16);
    --tr: .2s ease;
    --tr-slow: 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ═══════════════════════════════════════════════
   Appearance — Toggle Button
═══════════════════════════════════════════════ */
#ap-toggle-btn {
    position: fixed;
    left: 15px;
    bottom: 15px;
    width: 48px;
    height: 48px;
    color: var(--bg-white);
    background: var(--nav);
    border: 2px solid var(--bg-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    transition: transform 0.3s ease;
    z-index: 99999;
}

#ap-toggle-btn:hover {
    transform: scale(1.1);
}

#ap-toggle-btn i {
    animation: spin 1s infinite linear;
}

/* ═══════════════════════════════════════════════
   Appearance — Panel
═══════════════════════════════════════════════ */
#ap-panel {
    position: fixed;
    bottom: -520px;
    left: 10px;
    width: 270px;
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    transition: bottom 0.4s cubic-bezier(.4, 0, .2, 1);
    z-index: 99999;
    overflow: hidden;
}

#ap-panel.open {
    bottom: 72px;
}

/* Panel Header */
#ap-panel .ap-header {
    color: var(--bg-white);
    background: #232F3E;
    padding: 0 14px;
    height: 44px;
    line-height: 44px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ap-panel .ap-header i {
    font-size: 14px;
    opacity: .85;
}

/* Panel Body */
#ap-panel .ap-body {
    padding: 14px;
}

/* Section Label */
.ap-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
    margin: 12px 0 5px;
}

.ap-label:first-child {
    margin-top: 0;
}

/* Divider */
.ap-divider {
    border: none;
    border-top: 1px solid var(--bd, #eee);
    margin: 12px 0;
}

/* ═══════════════════════════════════════════════
   Font Select
═══════════════════════════════════════════════ */
#ap-font-select {
    width: 100%;
    height: 40px;
    padding: 0 32px 0 25px;
    border: 1px solid var(--bd, #dde1e7);
    border-radius: 8px;
    font-size: 13px;
    color: var(--tx-dark);
    background-color: var(--bg-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ap-font-select:hover {
    border-color: var(--navy, #01305A);
}

#ap-font-select:focus {
    outline: none;
    border-color: var(--navy, #01305A);
    box-shadow: 0 0 0 3px rgba(1, 48, 90, 0.12);
}

/* ═══════════════════════════════════════════════
   Color Picker & HEX Input
═══════════════════════════════════════════════ */
#ap-color-picker {
    width: 100%;
    height: 46px;
    padding: 2px;
    border: 1px solid var(--bd, #dde1e7);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

#ap-hex-input {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--bd, #dde1e7);
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    text-transform: uppercase;
    margin-top: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ap-hex-input:focus {
    outline: none;
    border-color: var(--navy, #01305A);
    box-shadow: 0 0 0 3px rgba(1, 48, 90, 0.12);
}

/* ═══════════════════════════════════════════════
   Preset Colors Grid
═══════════════════════════════════════════════ */
#ap-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 4px 0;
}

.ap-preset {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--bg-white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
}

.ap-preset:hover {
    transform: scale(1.18);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.ap-preset.selected::after {
    content: "✔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   Tool Buttons Row
═══════════════════════════════════════════════ */
.ap-tools {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ap-tools .ap-btn {
    flex: 1;
}

/* ═══════════════════════════════════════════════
   Shared Button Style
═══════════════════════════════════════════════ */
.ap-btn {
    height: 38px;
    line-height: 1;
    padding: 0 10px;
    background: linear-gradient(180deg, #fff 0%, #eaecef 100%);
    border: 1px solid #b0b7c3;
    border-bottom-color: #8d9099;
    border-radius: 6px;
    box-shadow: rgba(255, 255, 255, .7) 0 1px 0 inset, 0 1px 3px rgba(0, 0, 0, .08);
    color: #3a3a3a;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    user-select: none;
    transition: background 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ap-btn:hover {
    background: linear-gradient(180deg, #f5f7fa 0%, #e2e5e9 100%);
    color: #000;
    box-shadow: rgba(255, 255, 255, .7) 0 1px 0 inset, 0 2px 6px rgba(0, 0, 0, .12);
}

.ap-btn:active {
    background: linear-gradient(180deg, #e8eaed 0%, #d8dade 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1);
}

.ap-btn:focus {
    outline: none;
    border-color: #0c3267;
    box-shadow: 0 0 0 3px rgba(12, 50, 103, .18);
}

/* ═══════════════════════════════════════════════
   Newsletter & Cookie Box
═══════════════════════════════════════════════ */
#newsletterPopup {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

#newsletterPopup.active {
    opacity: 1;
    visibility: visible;
}

#newsletterPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

#newsletterPopup .row {
    width: 750px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

#newsletterPopup .row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.newsletter-content {
    padding: 30px 25px;
    background: var(--bd);
    color: var(--nav);
    text-align: center;
    position: relative;
    transform: none;
}

.newsletter-icon {
    font-size: 45px;
    margin-bottom: 15px;
    color: var(--nav);
    text-shadow: 0 2px 5px #ffffff;
    animation: iconBounce 1s infinite alternate;
}

.newsletter-content h2 {
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: bold;
}

.newsletter-content p {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--tx-mid);
}

.newsletter-input-group {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.newsletter-input-group input[type="email"] {
    height: 50px;
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    z-index: 9999;
}

.newsletter-button-group {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.newsletter-button-group button:first-child {
    background: var(--cta);
    color: var(--bg-white);
}

.newsletter-button-group button {
    flex: 1;
    height: 50px;
    padding: 12px 18px;
    border: none;
    background: #3a3a3a;
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    z-index: 9999;
}

.newsletter-button-group button:hover {
    background: #0e4b69;
}

.newsletter-content .by_subscribe {
    display: flex;
    justify-content: center;
}

.newsletter-content .by_subscribe p {
    z-index: 9999999;
    display: flex;
    float: left;
}

.newsletter-content .by_subscribe a {
    z-index: 9999999;
    display: flex;
    margin-left: 8px;
    float: right;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--red);
    transition: color 0.3s ease;
    z-index: 9999;
}

.close-popup:hover {
    color: #e74c3c;
}

/* ─────────────────────────────────────────
   COOKIE BOX – Premium Glass Style
───────────────────────────────────────── */
#cookie-box {
    width: 680px;
    max-width: calc(100% - 24px);
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 140px);
    opacity: 0;
    z-index: 9999;
    visibility: hidden;
    pointer-events: none;
    transition: all .55s cubic-bezier(.22, 1, .36, 1);
}

#cookie-box.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cookie-inner {
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 22px;
    padding: 22px 26px 22px 52px;
    display: flex;
    align-items: center;
    gap: 22px;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, .08),
        0 30px 80px rgba(0, 0, 0, .06);
    position: relative;
    overflow: hidden;
}

.cookie-inner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--cta), #ff7a18);
}

.cookie-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, rgba(255, 153, 0, .12), rgba(255, 153, 0, .05));
    border: 1px solid rgba(255, 153, 0, .2);
    animation: floatIcon 2.5s ease-in-out infinite alternate;
}

@keyframes floatIcon {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-4px);
    }
}

.cookie-content {
    flex: 1;
}

.cookie-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--nav);
}

.cookie-content p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.7;
}

.cookie-content a {
    color: var(--cta);
    font-weight: 600;
    text-decoration: none;
    position: relative;
}

.cookie-content a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--cta);
    transform: scaleX(.4);
    transition: .3s;
}

.cookie-content a:hover::after {
    transform: scaleX(1);
}

.cookie-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all .3s ease;
    white-space: nowrap;
}

.cookie-btn.accept {
    background: linear-gradient(135deg, #ff9900, #ff7a18);
    color: #fff;
    box-shadow: 0 10px 30px rgba(255, 153, 0, .35);
}

.cookie-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(255, 153, 0, .45);
}

.cookie-btn.decline {
    background: #f3f4f6;
    color: #4b5563;
}

.cookie-btn.decline:hover {
    background: #e5e7eb;
}

.cookie-close {
    position: absolute;
    top: 25px;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: rgba(255, 255, 255, 0.95);
    width: 25px;
    height: 25px;
    line-height: 23px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.cookie-close:hover {
    background: #ff7a18;
    color: white;
    box-shadow: 0 6px 16px rgba(255, 122, 24, 0.35);
    border-color: #ff7a18;
}

.cookie-close:focus-visible {
    outline: 2px solid #ff7a18;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .cookie-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 32px 20px 20px 20px;
    }

    .cookie-close {
        top: 14px;
        left: auto;
        right: 14px;
        transform: none;
        font-size: 20px;
        border-radius: 50%;
    }

    .cookie-buttons {
        width: 100%;
        margin-top: 10px;
    }

    .cookie-btn {
        flex: 1;
        text-align: center;
    }

    .cookie-content {
        margin-top: 8px;
    }
}