/**
 * Section K2 Automatismes - Design avec diagonale inversée
 * Titre, texte, liste de key features et image à gauche avec fond texture métal
 */

/* ============================================================
   STRUCTURE PRINCIPALE
   ============================================================ */

.k2-section {
    position: relative;
    background: var(--color-light);
    min-height: 700px;
    overflow: hidden;
}

/* Texture métallique en overlay */
.k2-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../img/Metal\ scratch\ png\ overlay,\ abstract\ design\ on\ transparent\ background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

.k2-section__container {
    max-width: 1600px;
    margin: 0 auto;
    margin-left: 0px !important;
    margin-top: 1rem;
    margin-bottom: 1rem;
    position: relative;
    min-height: 700px;
    display: flex;
    align-items: stretch;
    z-index: 2;
}

/* ============================================================
   IMAGE (GAUCHE) - PLEINE HAUTEUR AVEC DIAGONALE INVERSÉE
   ============================================================ */

.k2-section__image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    overflow: hidden;
    animation: fadeInLeft 0.8s ease-out 0.3s forwards;
    opacity: 0;
    /* Découpe diagonale sur le côté droit */
    clip-path: polygon(0% 0%, 92% 0%, 100% 100%, 0% 100%);
}

/* Liseré le long de la découpe diagonale */
.k2-section__image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    clip-path: polygon(92% 0%, 91.6% 0%, 99.6% 100%, 100% 100%);
    z-index: 2;
    pointer-events: none;
}

.k2-section__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.k2-section__image-wrapper:hover .k2-section__image {
    transform: scale(1.05);
}

/* ============================================================
   CONTENU (DROITE) - DIV BLANCHE QUI DÉBORDE
   ============================================================ */

.k2-section__content {
    position: relative;
    z-index: 2;
    /* Effet Glassmorphism */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px 0 rgba(3, 6, 7, 0.15),
        inset 0 0 0 1px rgba(227, 177, 52, 0.1);
    padding: 4rem;
    margin: 4rem 4rem 4rem 0;
    max-width: 650px;
    /* Déborde légèrement sur l'image */
    margin-left: auto;
    margin-right: 4rem;
    transform: translateX(-100px);
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

.k2-section__title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 2rem 0;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: -0.06em;
    font-family: var(--font-heading);
}

.k2-section__title .highlight {
    color: var(--color-primary);
}

.k2-section__description {
    font-size: 1.125rem;
    color: var(--color-text);
    line-height: 1.8;
    margin: 0 0 2rem 0;
    font-family: var(--font-primary);
}

/* ============================================================
   KEY FEATURES LIST
   ============================================================ */

.k2-section__features {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
}

.k2-section__feature {
    display: flex;
    align-items: center;
    font-family: var(--font-primary);
    font-size: 1.05rem;
    color: var(--color-text);
    line-height: 1.6;
    animation: fadeInUp 0.6s ease-out backwards;
}

.k2-section__feature:nth-child(1) { animation-delay: 0.4s; }
.k2-section__feature:nth-child(2) { animation-delay: 0.5s; }
.k2-section__feature:nth-child(3) { animation-delay: 0.6s; }
.k2-section__feature:nth-child(4) { animation-delay: 0.7s; }
.k2-section__feature:nth-child(5) { animation-delay: 0.8s; }

.k2-section__feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--color-primary);
    color: var(--color-secondary);
    margin-right: 0.875rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    padding: 7px;
}

.k2-section__feature-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--color-secondary);
}

.k2-section__feature:hover .k2-section__feature-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.k2-section__feature-text {
    flex: 1;
}

/* ============================================================
   LOGO K2
   ============================================================ */

.k2-section__logo {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    transition: opacity 0.3s ease;
}

.k2-section__logo:hover {
    opacity: 0.6;
}

.k2-section__logo-image {
    max-width: 80px;
    height: auto;
    display: block;
}

/* ============================================================
   BOUTON CTA
   ============================================================ */

.k2-section__cta {
    margin-top: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
    opacity: 0;
}

.k2-section__cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-secondary);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.k2-section__cta-button:hover {
    background: var(--color-primary);
    color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   CROIX DÉCORATIVES
   ============================================================ */

.k2-section__cross-left {
    position: absolute;
    top: 7rem;
    left: 15%;
    width: 80px;
    height: 80px;
    z-index: 3;
    pointer-events: none;
}

.k2-section__cross-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 133%;
    background: var(--color-primary);
}

.k2-section__cross-left::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 304%;
    height: 2px;
    background: var(--color-primary);
}

.k2-section__cross-right {
    position: absolute;
    bottom: 5rem;
    right: 7rem;
    width: 80px;
    height: 80px;
    z-index: 3;
    pointer-events: none;
}

.k2-section__cross-right::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 40%;
    transform: translateX(-50%);
    width: 2px;
    height: 208%;
    background: var(--color-primary);
}

.k2-section__cross-right::after {
    content: '';
    position: absolute;
    left: -91px;
    top: 46%;
    transform: translateY(-50%);
    width: 209%;
    height: 2px;
    background: var(--color-primary);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 767px) {
    .k2-section {
        min-height: auto;
        padding: 4rem 1.5rem;
    }

    .k2-section__container {
        min-height: auto;
        flex-direction: column;
    }

    /* Image en arrière-plan sur toute la section */
    .k2-section__image-wrapper {
        position: relative;
        width: 100%;
        height: 300px;
        clip-path: none;
        order: 1;
        margin-bottom: 2rem;
    }

    /* Pas de liseré sur mobile */
    .k2-section__image-wrapper::before {
        display: none;
    }

    /* Contenu sans débordement sur mobile */
    .k2-section__content {
        position: relative;
        margin: 0;
        padding: 2rem 1.5rem;
        max-width: 100%;
        transform: translateX(0);
        order: 2;
    }

    .k2-section__title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .k2-section__description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .k2-section__features {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .k2-section__feature {
        font-size: 0.95rem;
    }

    .k2-section__feature-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        margin-right: 0.625rem;
        padding: 5px;
    }

    .k2-section__logo {
        bottom: 1rem;
        right: 1rem;
    }

    .k2-section__logo-image {
        max-width: 60px;
    }

    .k2-section__cross-left,
    .k2-section__cross-right {
        width: 60px;
        height: 60px;
    }

    .k2-section__cross-left {
        top: 1rem;
        left: 5%;
    }

    .k2-section__cross-right {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ============================================================
   RESPONSIVE - TABLET
   ============================================================ */

@media (min-width: 768px) and (max-width: 1023px) {
    .k2-section {
        min-height: 600px;
    }

    .k2-section__container {
        min-height: 600px;
    }

    .k2-section__image-wrapper {
        width: 50%;
        clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 0% 100%);
    }

    /* Ajuster le liseré pour tablette */
    .k2-section__image-wrapper::before {
        clip-path: polygon(90% 0%, 89.5% 0%, 99.5% 100%, 100% 100%);
    }

    .k2-section__content {
        padding: 3rem;
        margin: 3rem 2rem 3rem 0;
        transform: translateX(-50px);
        max-width: 550px;
    }

    .k2-section__title {
        font-size: 2.5rem;
    }

    .k2-section__description {
        font-size: 1.05rem;
    }

}

/* ============================================================
   RESPONSIVE - LARGE DESKTOP
   ============================================================ */

@media (min-width: 1280px) {
    .k2-section {
        min-height: 800px;
    }

    .k2-section__container {
        max-width: 1800px;
        min-height: 800px;
    }

    .k2-section__image-wrapper {
        width: 58%;
        clip-path: polygon(0% 0%, 94% 0%, 100% 100%, 0% 100%);
    }

    /* Ajuster le liseré pour large desktop */
    .k2-section__image-wrapper::before {
        clip-path: polygon(94% 0%, 93.7% 0%, 99.7% 100%, 100% 100%);
    }

    .k2-section__content {
        padding: 5rem;
        transform: translateX(-120px);
        max-width: 750px;
    }

    .k2-section__title {
        font-size: 3.5rem;
        margin-bottom: 2.5rem;
    }

    .k2-section__description {
        font-size: 1.25rem;
        margin-bottom: 2.5rem;
    }

}
