/* ==========================================================================
   ADU Home Visual Builder & Dynamic Blocks
   ========================================================================== */

/* ---------- Dynamic Carousel Styles ---------- */
.adu-carousel-section {
    position: relative;
}

.adu-carousel-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    user-select: none;
}

.adu-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.adu-carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 5.5s ease, visibility 0.85s;
    transform: scale(1.03);
    z-index: 1;
}

.adu-carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.adu-carousel-viewport[data-transition="slide"] .adu-carousel-track {
    display: flex;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.adu-carousel-viewport[data-transition="slide"] .adu-carousel-slide {
    position: relative;
    flex: 0 0 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
}

.adu-carousel-h-sm { min-height: 300px; height: 320px; }
.adu-carousel-h-md { min-height: 400px; height: 460px; }
.adu-carousel-h-lg { min-height: 480px; height: 600px; }
.adu-carousel-h-full { min-height: 76vh; height: 84vh; }

@media (max-width: 767px) {
    .adu-carousel-h-sm { min-height: 250px; height: 270px; }
    .adu-carousel-h-md { min-height: 340px; height: 370px; }
    .adu-carousel-h-lg { min-height: 420px; height: 460px; }
    .adu-carousel-h-full { min-height: 70vh; height: 76vh; }
}

.adu-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.adu-carousel-arrow:hover {
    background: rgba(14, 116, 144, 0.9);
    transform: translateY(-50%) scale(1.06);
}

.adu-carousel-arrow.is-prev { left: 1rem; }
.adu-carousel-arrow.is-next { right: 1rem; }

@media (max-width: 640px) {
    .adu-carousel-arrow {
        width: 38px;
        height: 38px;
    }
    .adu-carousel-arrow.is-prev { left: 0.6rem; }
    .adu-carousel-arrow.is-next { right: 0.6rem; }
}

.adu-carousel-dots {
    position: absolute;
    bottom: 1.15rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.adu-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.adu-carousel-dot.is-active {
    width: 24px;
    background: #f97316;
}

/* Card-Strip Horizontal Carousel */
.adu-cardstrip-scroller {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 116, 144, 0.35) transparent;
}

.adu-cardstrip-scroller::-webkit-scrollbar {
    height: 6px;
}

.adu-cardstrip-scroller::-webkit-scrollbar-thumb {
    background: rgba(14, 116, 144, 0.35);
    border-radius: 999px;
}

.adu-cardstrip-item {
    flex: 0 0 84%;
    scroll-snap-align: start;
}

@media (min-width: 640px) {
    .adu-cardstrip-item { flex: 0 0 calc(50% - 0.625rem); }
}

@media (min-width: 1024px) {
    .adu-cardstrip-item { flex: 0 0 calc(33.333% - 0.85rem); }
}

/* ---------- Dynamic Card Animations & Styles ---------- */
.adu-fade-in {
    animation: aduFadeUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ==========================================================================
   EDITOR MODE CHROME (Visible ONLY when Admin activates Edit Mode)
   ========================================================================== */

body.adu-edit-mode {
    padding-top: 0 !important;
    padding-bottom: 48px !important;
}

#adu-hb-spacer {
    display: none;
    height: 56px;
    width: 100%;
}

body.adu-edit-mode #adu-hb-spacer {
    display: block;
}

body.adu-edit-mode #header,
body.adu-edit-mode .adu-site-header {
    top: 56px !important;
}

/* Top Floating Studio Dock */
#adu-hb-dock.hidden {
    display: none !important;
}

#adu-hb-dock {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    height: 56px;
    background: linear-gradient(90deg, #0b1324, #0f172a 55%, #082f49);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 12px 35px rgba(2, 6, 23, 0.28);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 0.75rem;
    font-family: "Inter", system-ui, sans-serif;
}

#adu-hb-dock.is-preview {
    height: 52px;
    top: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 1.5rem);
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 0 0.75rem 0 1rem;
}

.adu-hb-dock-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.adu-hb-dock-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}
.adu-hb-dock-scroll::-webkit-scrollbar { display: none; }

.adu-hb-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.26);
    border: 1px solid rgba(34, 211, 238, 0.35);
    font-size: 0.78rem;
    font-weight: 700;
    color: #a5f3fc;
    white-space: nowrap;
}

.adu-hb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 36px;
    padding: 0 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.adu-hb-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.adu-hb-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.adu-hb-btn-primary {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-color: rgba(34, 211, 238, 0.4);
    color: #fff;
}

.adu-hb-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.adu-hb-btn-publish {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: rgba(253, 186, 116, 0.45);
    color: #fff;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
}

.adu-hb-btn-publish:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb923c, #f97316);
}

.adu-hb-btn-publish.has-dirty::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #fef08a;
    animation: aduPulseDot 1.4s infinite;
}

@keyframes aduPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.45); opacity: 0.65; }
}

.adu-hb-btn-danger {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.adu-hb-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

/* Section Editing Frame & Floating Bar */
body.adu-edit-mode [data-adu-section] {
    position: relative;
    outline: 2px dashed transparent;
    outline-offset: -4px;
    transition: outline-color 0.2s ease;
}

body.adu-edit-mode [data-adu-section]:hover,
body.adu-edit-mode [data-adu-section].is-selected {
    outline-color: rgba(8, 145, 178, 0.72);
}

body.adu-edit-mode [data-adu-section].is-hidden-section {
    opacity: 0.45;
    filter: grayscale(0.45);
}

.adu-hb-section-bar {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 85;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.32);
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.92;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-adu-section]:hover > .adu-hb-section-bar,
[data-adu-section].is-selected > .adu-hb-section-bar {
    opacity: 1;
}

@media (max-width: 640px) {
    .adu-hb-section-bar {
        top: 8px;
        right: 8px;
        max-width: calc(100vw - 16px);
        overflow-x: auto;
    }
}

.adu-hb-section-tag {
    font-family: "Inter", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #67e8f9;
    padding: 0 0.55rem;
    white-space: nowrap;
}

.adu-hb-mini-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.adu-hb-mini-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.adu-hb-mini-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.adu-hb-mini-btn.is-accent {
    background: rgba(8, 145, 178, 0.35);
    color: #a5f3fc;
}

.adu-hb-mini-btn.is-accent:hover {
    background: #0891b2;
    color: #fff;
}

.adu-hb-mini-btn.is-danger:hover {
    background: #ef4444;
    color: #fff;
}

/* Inline "+ Adicionar Bloco Aqui" Divider */
.adu-hb-insert-slot {
    position: relative;
    z-index: 45;
    height: 18px;
    margin: -9px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.adu-hb-insert-slot::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    height: 2px;
    background: rgba(8, 145, 178, 0.22);
    border-radius: 999px;
    transition: background 0.2s ease, height 0.2s ease;
}

.adu-hb-insert-slot:hover::before,
.adu-hb-insert-slot.is-top-slot::before {
    background: rgba(8, 145, 178, 0.65);
}

.adu-hb-insert-slot.is-top-slot {
    height: 44px;
    margin: 0;
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.96), rgba(248, 250, 252, 0.85));
    border-bottom: 1px dashed rgba(8, 145, 178, 0.28);
}

.adu-hb-insert-pill {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(8, 145, 178, 0.4);
    background: #ffffff;
    color: #0e7490;
    font-family: "Inter", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    opacity: 0.72;
    transform: scale(0.95);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.adu-hb-insert-slot:hover .adu-hb-insert-pill,
.adu-hb-insert-slot.is-top-slot .adu-hb-insert-pill {
    opacity: 1;
    transform: scale(1);
    background: #0e7490;
    color: #fff;
}

/* Editable Card Controls & Drag-and-Drop */
body.adu-edit-mode [data-adu-card] {
    position: relative;
    cursor: grab;
    outline: 2px solid transparent;
    transition: transform 0.18s ease, outline-color 0.18s ease, opacity 0.18s ease;
}

body.adu-edit-mode [data-adu-card]:hover {
    outline-color: rgba(249, 115, 22, 0.75);
}

body.adu-edit-mode [data-adu-card].is-dragging {
    opacity: 0.42;
    transform: scale(0.97);
}

body.adu-edit-mode [data-adu-card].is-drag-over {
    outline: 3px dashed #f97316 !important;
    outline-offset: 3px;
}

.adu-hb-card-bar {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.25);
    opacity: 0;
    transition: opacity 0.16s ease;
}

[data-adu-card]:hover > .adu-hb-card-bar,
[data-adu-card]:focus-within > .adu-hb-card-bar {
    opacity: 1;
}

@media (hover: none) {
    .adu-hb-card-bar {
        opacity: 0.94;
    }
}

.adu-hb-card-bar button {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #f8fafc;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.adu-hb-card-bar button:hover {
    background: rgba(255, 255, 255, 0.18);
}

.adu-hb-card-bar button.is-edit {
    background: #0891b2;
}

.adu-hb-card-bar button.is-del:hover {
    background: #ef4444;
}

.adu-hb-add-card-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 150px;
    padding: 1.25rem;
    border-radius: 1.5rem;
    border: 2px dashed rgba(8, 145, 178, 0.45);
    background: rgba(236, 254, 255, 0.55);
    color: #0e7490;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.adu-hb-add-card-tile:hover {
    background: rgba(207, 250, 254, 0.85);
    border-color: #0e7490;
    transform: translateY(-2px);
}

.adu-hb-add-card-tile.is-dark {
    border-color: rgba(165, 243, 252, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #cffafe;
}

.adu-hb-add-card-tile.is-dark:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ---------- Slide-Over Inspector & Layers Drawer ---------- */
#adu-hb-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 960;
    background: rgba(2, 6, 23, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#adu-hb-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

#adu-hb-drawer {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    z-index: 970;
    width: min(440px, 100vw);
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -20px 0 60px rgba(2, 6, 23, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(104%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: "Inter", system-ui, sans-serif;
}

#adu-hb-drawer.is-open {
    transform: translateX(0);
}

.adu-hb-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #ecfeff);
}

.adu-hb-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.15rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.adu-hb-drawer-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.adu-hb-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adu-hb-input,
.adu-hb-select,
.adu-hb-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 0.86rem;
    font-family: "Inter", sans-serif;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.adu-hb-input:focus,
.adu-hb-select:focus,
.adu-hb-textarea:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14);
}

.adu-hb-icon-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.4rem;
    max-height: 185px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #f8fafc;
}

.adu-hb-icon-opt {
    height: 38px;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    background: #fff;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.14s ease;
}

.adu-hb-icon-opt:hover {
    border-color: #bae6fd;
    color: #0e7490;
}

.adu-hb-icon-opt.is-selected {
    background: #0e7490;
    color: #fff;
    border-color: #083344;
}

.adu-hb-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.adu-hb-swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.adu-hb-swatch.is-selected {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #0f172a;
}

/* Modal (Block Picker & Admin Login) */
#adu-hb-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 980;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#adu-hb-modal-backdrop.is-open {
    display: flex;
}

.adu-hb-modal {
    width: min(760px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.35);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    font-family: "Inter", system-ui, sans-serif;
}

.adu-hb-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.85rem;
}

.adu-hb-template-card {
    text-align: left;
    padding: 1rem;
    border-radius: 1.15rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.adu-hb-template-card:hover {
    border-color: #0891b2;
    background: #ecfeff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(8, 145, 178, 0.12);
}

/* Toast Notification */
#adu-hb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 24px);
    z-index: 995;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.3);
    border: 1px solid rgba(56, 189, 248, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

#adu-hb-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Layers Row */
.adu-hb-layer-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: grab;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.adu-hb-layer-row:hover {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.adu-hb-layer-row.is-drag-over {
    border: 2px dashed #f97316;
    background: #fff7ed;
}
