/* ============================================================
   DeLucio 360 — Styles
   ============================================================ */

/* ── Wrapper & layout ─────────────────────────────────────── */
.dl360-wrapper {
    position: relative;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    font-family: inherit;
}

.dl360-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 4vw, 2.75rem);
}

/* --dl360-chart-scale: 1 = 100% (set inline from PHP / Elementor / shortcode) */
.dl360-chart-col {
    flex: 0 1 min(calc(520px * var(--dl360-chart-scale, 1)), calc(48% * var(--dl360-chart-scale, 1)));
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.dl360-detail-col {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 440px;
}

/* Stacked “slides” — same pulse keyframes / delays as node highlights.
   Grid overlap: row height follows the tallest item so long copy is not clipped. */
.dl360-detail-stack {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-items: start;
}

.dl360-detail-item {
    grid-area: 1 / 1;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    /* Must stay in sync with .dl360-node-inner::before — same name/duration/delay.
       Plateau width must stay < 100%/n (n=6) or multiple slides show at once. */
    animation: dl360-hl-pulse var(--pulse-dur, 8s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
    animation-fill-mode: both;
    text-align: left;
    align-self: start;
}

/* Detail column — match Nuestros Servicios typography (Elementor post 4232) */
.dl360-detail-col {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-weight: var(--e-global-typography-text-font-weight);
    text-align: left;
}

.dl360-detail-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0 0 0.85rem;
    padding: 0;
    text-align: left;
    font-weight: 400;
    line-height: 1.05;
    color: #000000;
    width: 100%;
}

/* Large numeral — above the heading, left-aligned */
.dl360-detail-num {
    display: block;
    font-family: "Helvetica", "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(52px, 9vw, 86px);
    font-weight: 200;
    line-height: 0.9;
    color: #000000;
}

/* Service name — Cormorant Garamond like section headings */
.dl360-detail-title-text {
    display: block;
    width: 100%;
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: clamp(32px, 4.5vw, 46px);
    font-weight: 400;
    line-height: 1.15;
    color: #000000;
    letter-spacing: 0.01em;
    text-align: left;
}

.dl360-detail-desc {
    margin: 0;
    padding: 0;
    text-align: left;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-weight: var(--e-global-typography-text-font-weight);
    font-size: 1rem;
    line-height: 1.65;
    color: #000000;
}

.dl360-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

/* ── Connecting lines ──────────────────────────────────────── */
/* Note: stroke attributes are set inline in the SVG for reliable cross-browser rendering */
.dl360-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* ── Center circle ──────────────────────────────────────────── */
.dl360-center {
    position: absolute;
    width: 28%;
    height: 28%;
    top:  36%;
    left: 36%;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #c5d4e0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Rotating arrow SVG — sits over the full center circle */
.dl360-arrows-svg {
    position: absolute;
    inset: -8%;                       /* slightly larger than circle so arrows sit on rim */
    width: 116%;
    height: 116%;
    animation: dl360-ccw linear infinite;
    fill: #4a7096;
    pointer-events: none;
}

@keyframes dl360-ccw {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* Custom logo image inside center */
.dl360-logo-img {
    /* 24% padding gives clear breathing room from the rotating arrow ring */
    padding: 24%;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
}

.dl360-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 3;
}

/* Text logo inside center */
.dl360-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    z-index: 3;
    pointer-events: none;
    user-select: none;
}

.dl360-logo-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dl360-logo-dot {
    display: inline-block;
    width: 12%;         /* relative to center circle */
    height: 12%;
    min-width: 8px;
    min-height: 8px;
    max-width: 14px;
    max-height: 14px;
    border-radius: 50%;
    background: #1c3f5e;
    flex-shrink: 0;
}

.dl360-logo-brand {
    font-size: clamp(7px, 1.4vw, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #1c3f5e;
    white-space: nowrap;
}

.dl360-logo-sub {
    font-size: clamp(9px, 1.8vw, 17px);
    font-weight: 400;
    color: #4a7096;
    letter-spacing: 0.04em;
}

/* ── Outer nodes ────────────────────────────────────────────── */
.dl360-node {
    position: absolute;
    width: 22%;
    height: 22%;
    cursor: pointer;
    z-index: 2;
}

/* Clockwise positions (6 nodes, 60° apart, radius ≈ 36%) */
.dl360-node-1 { left: 39%;   top:  3%;  }
.dl360-node-2 { left: 70.2%; top: 21%;  }
.dl360-node-3 { left: 70.2%; top: 57%;  }
.dl360-node-4 { left: 39%;   top: 75%;  }
.dl360-node-5 { left:  7.8%; top: 57%;  }
.dl360-node-6 { left:  7.8%; top: 21%;  }

/* Outer darker ring */
.dl360-node-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #b0c4d4;
    padding: 8%;
    transition: background 0.3s ease;
}

/* Inner white circle — background is always solid white, never animated.
   The highlight is done by a ::before overlay so ring colour cannot bleed through. */
.dl360-node-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #d0dde7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;   /* required so ::before is positioned within this circle */
    overflow: hidden;     /* clips ::before to the circle shape */
}

/* Highlight overlay — ONLY opacity is animated (100% browser-safe).
   The colour comes from --hl-color set as an inline style on .dl360-container,
   which CSS inheritance passes down to this pseudo-element automatically.
   Because we never animate background, the ring colour can never bleed through. */
.dl360-node-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hl-color, #c5d9e8);
    opacity: 0;
    animation: dl360-hl-pulse var(--pulse-dur, 8s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
    animation-fill-mode: both;
    pointer-events: none;
    z-index: 0;
}

/* Narrow peak (< ~16.7% width) so six staggered nodes never stack. Curve starts
   early in the cycle so the first highlight + detail text appear soon after load. */
@keyframes dl360-hl-pulse {
    0%,  2% { opacity: 0; }
    5%,  11% { opacity: 1; }
    14%, 100% { opacity: 0; }
}

/* Icon — sits above the ::before highlight overlay via z-index */
.dl360-icon {
    width: 55%;
    height: 55%;
    color: #4a7096;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.dl360-icon svg {
    width: 100%;
    height: 100%;
}

.dl360-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Hover — only the ring darkens; .dl360-node-inner is never touched */
.dl360-node:hover .dl360-node-ring {
    background: #7ea8c4;
}

.dl360-node:focus {
    outline: none;
}

.dl360-node:focus-visible .dl360-node-ring {
    outline: 3px solid #4a7096;
    outline-offset: 3px;
}

/* Full-screen popup only on small screens (wide layouts use the side column) */
@media (min-width: 768px) {
    .dl360-overlay {
        display: none !important;
    }
}

/* ── Popup overlay ──────────────────────────────────────────── */
.dl360-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 40, 60, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dl360-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Popup box */
.dl360-popup {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px 36px;
    max-width: 420px;
    width: 90%;
    position: relative;
    text-align: center;
    transform: translateY(18px) scale(0.96);
    transition: transform 0.25s ease;
}

.dl360-overlay.is-open .dl360-popup {
    transform: translateY(0) scale(1);
}

/* Close button */
.dl360-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #7a9ab5;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.dl360-close:hover {
    color: #1c3f5e;
}

/* Popup icon — light tinted background, original icon colour */
.dl360-popup-icon-wrap {
    width: 72px;
    height: 72px;
    background: rgba(74, 112, 150, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #4a7096;
}

.dl360-popup-icon-wrap svg {
    width: 42px;
    height: 42px;
}

.dl360-popup-icon-wrap img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

/* Popup text */
.dl360-popup-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: #1c3f5e;
}

.dl360-popup-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #4a6070;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .dl360-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .dl360-chart-col {
        flex: 1 1 auto;
        max-width: min(520px, 100%);
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    .dl360-detail-col {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .dl360-detail-stack {
        max-width: 36rem;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .dl360-wrapper {
        max-width: 100%;
    }
    .dl360-popup {
        padding: 32px 24px 28px;
    }
}
