/*<--------------------------------------------------->
<!-- Implementacion (section component)             -->
<!----------------------------------------------------->
* Description:
    Requirements section for #implementacion.
    Mobile: exclusive accordions, JS-driven toggle.
    Desktop (min-width: 769px): three open category
    blocks with card grids.
* Dependencies:
    - style.css (custom properties, sectionHeader, .content)
    - implementacion.js
<!--------------------------------------------------->*/

/*###################################################*/
/*...................................................*/
/* Section-scoped category color tokens             */
/*...................................................*/
/*###################################################*/

#implementacion {
    --cat-hu:    hsla(25,  94%, 67%, 1);
    --cat-hu-bg: hsla(25,  80%, 10%, 1);
    --cat-in:    hsla(217, 90%, 81%, 1);
    --cat-in-bg: hsla(217, 60%, 10%, 1);
    --cat-ac:    hsla(197, 72%, 62%, 1);
    --cat-ac-bg: hsla(197, 55%,  9%, 1);
}

/*###################################################*/
/*...................................................*/
/* Section shell                                     */
/*...................................................*/
/*###################################################*/

.implementacion {
    display: flex;
    align-items: center;
    justify-content: center;

    & > .content {
        display: flex;
        flex-direction: column;
    }
}

.implSubtitle {
    max-width: 52rem;
    margin: 1.25rem 0 2.5rem;
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1vw, 1.08rem);
    line-height: 1.7;
    color: hsla(0, 30%, 96%, 0.62);
}

/*###################################################*/
/*...................................................*/
/* Dynamic container & blocks                        */
/*...................................................*/
/*###################################################*/

.implDynamic {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding-bottom: 3rem;

    @media (min-width: 769px) {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* Per-category color resolution */
.implBlock[data-cat="hu"] { --implCatColor: var(--cat-hu); --implCatBg: var(--cat-hu-bg); }
.implBlock[data-cat="in"] { --implCatColor: var(--cat-in); --implCatBg: var(--cat-in-bg); }
.implBlock[data-cat="ac"] { --implCatColor: var(--cat-ac); --implCatBg: var(--cat-ac-bg); }

/* Mobile default: accordion shell */
.implBlock {
    border: 0.5px solid hsla(0, 0%, 100%, .09);
    border-left: 2px solid var(--implCatColor);
    border-radius: 14px;
    background: hsla(0, 0%, 100%, .04);
    transition: background 0.3s ease, border-color 0.3s ease;
    padding-top: 1rem;
    padding-bottom: 1rem;

    &[data-open="true"] {
        border-color: transparent;
        border-left-color: var(--implCatColor);
        background: hsla(0, 0%, 100%, .05);
    }

    @media (min-width: 769px) {
        border: none;
        border-left: 2px solid var(--implCatColor);
        border-radius: 0;
        background: none;
        transition: none;

        &[data-open="true"] {
            background: none;
        }
    }
}

/*###################################################*/
/*...................................................*/
/* Category header / accordion trigger               */
/*...................................................*/
/*###################################################*/

/* Mobile default: interactive */
.implBlockTrigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: none;
    border: none;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    pointer-events: auto;

    @media (min-width: 769px) {
        padding: 0 0 0.85rem 1rem;
        cursor: default;
        pointer-events: none;
    }
}

/* Icon box */
.implCatIconBox {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--implCatBg);
    color: var(--implCatColor);
    border-radius: 8px;
    font-size: 16px;

    @media (min-width: 769px) {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Text meta */
.implCatInfo {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.implCatLabel {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--implCatColor);
    line-height: 1.2;
}

.implCatName {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    color: hsla(0, 0%, 100%, 1);
    line-height: 1.25;
    margin: 0;
}

/* Hidden on mobile, shown on desktop */
.implCatDesc {
    display: none;
    font-family: var(--font-body);
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    line-height: 1.6;
    color: hsla(0, 30%, 96%, 0.5);
    margin: 0.15rem 0 0;

    @media (min-width: 769px) {
        display: block;
    }
}

/* Shown on mobile, hidden on desktop */
.implCatCount {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    color: hsla(0, 30%, 96%, 0.45);

    @media (min-width: 769px) {
        display: none;
    }
}

/* Chevron shown on mobile only */
.implChevron {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 0;
    color: color-mix(in srgb, var(--text) 45%, transparent);
    transition: transform 0.3s ease;

    @media (min-width: 769px) {
        display: none;
    }
}

.implBlock[data-open="true"] .implChevron {
    transform: rotate(180deg);
}

/*###################################################*/
/*...................................................*/
/* Collapsible content area                          */
/*...................................................*/
/*###################################################*/

/* Mobile default: collapsed */
.implBlockContent {
    max-height: 0;
    overflow: hidden;
    padding: 0 0.75rem;
    transition: max-height 0.38s ease;

    .implBlock[data-open="true"] & {
        max-height: 2000px;
        padding: 0 0.75rem 0.75rem;
    }

    @media (min-width: 769px) {
        max-height: none;
        overflow: visible;
        padding: 0 0 0 1rem;
        transition: none;
    }
}

/*###################################################*/
/*...................................................*/
/* Card grid                                         */
/*...................................................*/
/*###################################################*/

/* Mobile default: single column */
.implCards {
    display: grid;
    gap: 7px;

    &.implCards--2,
    &.implCards--3 {
        grid-template-columns: 1fr;
    }

    @media (min-width: 769px) {
        gap: 10px;

        &.implCards--2 { grid-template-columns: repeat(2, 1fr); }
        &.implCards--3 { grid-template-columns: repeat(3, 1fr); }
    }
}

/* Single card */
.implCard {
    padding: 1rem;
    background: hsla(0, 0%, 0%, .3);
    border: none;
    border-radius: 10px;

    @media (min-width: 769px) {
        background: hsla(0, 0%, 100%, .03);
        border: 0.5px solid hsla(0, 0%, 100%, .08);
        border-radius: 12px;
    }
}

.implCardTop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.implCardNum {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: hsla(0, 30%, 96%, 0.3);
    letter-spacing: 0.05em;
    line-height: 1;
    padding-top: 0.2em;
}

.implCardTitle {
    font-family: var(--font-display);
    font-size: clamp(0.88rem, 1vw, 1rem);
    font-weight: 700;
    line-height: 1.3;
    color: hsla(0, 0%, 100%, 1);
    margin: 0 0 0.5rem;
    max-width: calc(100% - 88px);
}

.implCardBody {
    font-family: var(--font-body);
    font-size: clamp(0.78rem, 0.9vw, 0.9rem);
    line-height: 1.65;
    color: hsla(0, 30%, 96%, 0.5);
    margin: 0;
}

/*###################################################*/
/*...................................................*/
/* Badges                                            */
/*...................................................*/
/*###################################################*/

.implBadge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.22em 0.7em;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: nowrap;
    border: 0.5px solid;

    &.implBadge--necesario {
        background: hsla(25, 80%, 14%, 1);
        color: var(--primary-mono);
        border-color: hsla(25, 70%, 28%, 1);
    }

    &.implBadge--preferente {
        background: hsla(217, 45%, 10%, 1);
        color: hsla(217, 90%, 72%, 1);
        border-color: hsla(217, 45%, 22%, 1);
    }

    &.implBadge--sugerencia {
        background: hsla(197, 45%, 11%, 1);
        color: var(--cat-ac);
        border-color: hsla(197, 45%, 23%, 1);
    }

    &.implBadge--opcional {
        background: hsla(217, 55%, 13%, 1);
        color: var(--contrast-mono);
        border-color: hsla(217, 50%, 26%, 1);
    }
}

/*###################################################*/
/*...................................................*/
/* Footer carousel                                   */
/*...................................................*/
/*###################################################*/

.implFooter {
    padding-top: 1.5rem;
    border-top: 0.5px solid hsla(0, 0%, 100%, .07);
}

.implCarouselProgress {
    height: 1.5px;
    background: color-mix(in srgb, var(--primary-mono) 22%, transparent);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.implCarouselBar {
    height: 100%;
    width: 0%;
    background: var(--primary-mono);
    border-radius: 999px;
    will-change: width;
}

.implCarouselSlides {
    min-height: 3.5rem;
}

.implCarouselSlide {
    display: none;

    &.active { display: block; }
}

/* Mobile: smaller font, desktop: larger */
.implCarouselText {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 3.5vw, 1.05rem);
    font-weight: 600;
    line-height: 1.35;
    color: hsla(0, 30%, 96%, 0.78);
    margin: 0;

    @media (min-width: 769px) {
        font-size: clamp(1rem, 1.4vw, 1.35rem);
    }
}

.implCarouselControls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.implCarouselDots {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.implDot {
    width: 26px;
    height: 8px;
    border-radius: 999px;
    border: 0.5px solid hsla(0, 0%, 100%, .2);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, border-color 0.25s ease, width 0.25s ease;

    &.active {
        width: 36px;
        background: var(--primary-mono);
        border-color: var(--primary-mono);
    }
}

.implCarouselNextBtn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0.5px solid hsla(0, 0%, 100%, .2);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;

    &:hover, &:focus-visible {
        border-color: var(--primary-mono);
        background: hsla(25, 80%, 14%, 1);
        color: var(--primary-mono);
        outline: none;
    }
}

/*###################################################*/
/*...................................................*/
/* end Implementacion                                */
/*...................................................*/
/*###################################################*/
