/* KIA Genuine Parts Page Styles - Full Width & Mobile Friendly */

.kia-gp-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 25px 40px 50px;
    font-family: inherit;
    box-sizing: border-box;
}

.kia-gp-header {
    margin-bottom: 30px;
}

.kia-gp-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #05141f;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

/* Mobile Category Nav Bar (Hidden on Desktop) */
.kia-gp-mobile-cat-nav {
    display: none;
}

/* Categorized Parts Grid - 5 Full Width Columns */
.kia-gp-categories-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.kia-gp-cat-column {
    display: flex;
    flex-direction: column;
}

.kia-gp-cat-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.kia-gp-parts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kia-gp-part-item {
    font-size: 0.9rem;
    color: #1f2937;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kia-gp-part-item:hover {
    color: #05141f;
    background-color: #f3f4f6;
}

.kia-gp-part-item.is-active {
    font-weight: 700;
    color: #05141f;
    background-color: #f3f4f6;
}

.kia-gp-part-item.is-active::before {
    content: "→";
    font-weight: bold;
    color: #8b9900;
    font-size: 0.9rem;
}

/* Main Visualizer Area - Joined Borderless Canvas */
.kia-gp-visualizer {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    align-items: start;
    position: relative;
    min-height: 480px;
    width: 100%;
    margin-top: 10px;
}

/* SVG Leader Line Overlay - Accent Color #8b9900 */
.kia-gp-leader-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.kia-gp-leader-path {
    stroke: #8b9900;
    stroke-width: 2.5;
    fill: none;
    opacity: 0;
    transition: stroke-dashoffset 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-in;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 6px rgba(139, 153, 0, 0.35));
}

.kia-gp-leader-path.is-active {
    opacity: 1;
}

.kia-gp-leader-node {
    fill: #8b9900;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Left Part Details - Borderless Joined Section */
.kia-gp-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 2;
    justify-content: space-between;
}

.kia-gp-part-image-wrap {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.kia-gp-part-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.kia-gp-card:hover .kia-gp-part-image {
    transform: scale(1.04);
}

.kia-gp-part-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #05141f;
    margin: 0;
    line-height: 1.25;
}

.kia-gp-part-description {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.55;
    white-space: pre-line;
}

.kia-gp-btn-callback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #05141f;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    margin-top: 6px;
}

.kia-gp-btn-callback:hover {
    background-color: #1a2a36;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 20, 31, 0.2);
    color: #ffffff;
}

/* Right Car Diagram Container - Borderless Joined Stage */
.kia-gp-chassis-stage {
    position: relative;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

.kia-gp-chassis-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Pins on Car Chassis: Layered ABOVE SVG line (z-index: 20) */
.kia-gp-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
    padding: 12px;
    margin: -12px;
    display: none;
}

.kia-gp-pin.is-active {
    display: block;
}

/* Sequential Reveal: Dot pops in after line finishes drawing */
.kia-gp-pin-dot,
.kia-gp-pin-pulse {
    opacity: 0;
    transform: scale(0);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.kia-gp-pin.is-revealed .kia-gp-pin-dot,
.kia-gp-pin.is-revealed .kia-gp-pin-pulse {
    opacity: 1;
    transform: scale(1);
}

/* Accent Color #8b9900 Pin Dot & Pulse */
.kia-gp-pin-dot {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8b9900;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 153, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 22;
}

.kia-gp-pin-pulse {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: rgba(139, 153, 0, 0.5);
    animation: kia-gp-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 21;
}

@keyframes kia-gp-ping {
    75%, 100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1024px) {
    .kia-gp-container {
        padding: 20px 24px 40px;
    }

    .kia-gp-visualizer {
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: auto;
    }

    .kia-gp-chassis-stage {
        min-height: 360px;
        order: 1;
    }

    .kia-gp-card {
        order: 2;
    }

    .kia-gp-leader-svg {
        display: none;
    }
}

@media (max-width: 768px) {
    .kia-gp-container {
        padding: 16px 16px 32px;
    }

    .kia-gp-header {
        margin-bottom: 16px;
    }

    .kia-gp-title {
        font-size: 1.35rem;
        margin-bottom: 12px;
    }

    /* Horizontally Scrollable Category Nav Bar for Mobile */
    .kia-gp-mobile-cat-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 10px;
        margin-bottom: 14px;
        border-bottom: 1px solid #e5e7eb;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .kia-gp-mobile-cat-nav::-webkit-scrollbar {
        display: none;
    }

    .kia-gp-mobile-cat-tab {
        flex: 0 0 auto;
        padding: 7px 14px;
        border-radius: 20px;
        background: #f3f4f6;
        color: #4b5563;
        font-size: 0.85rem;
        font-weight: 600;
        border: 1px solid #e5e7eb;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s ease;
    }

    .kia-gp-mobile-cat-tab:hover {
        background: #e5e7eb;
        color: #05141f;
    }

    .kia-gp-mobile-cat-tab.is-active {
        background: #05141f;
        color: #ffffff;
        border-color: #05141f;
        box-shadow: 0 2px 8px rgba(5, 20, 31, 0.15);
    }

    /* Categories Grid Container on Mobile: Shows ONLY Active Category Column */
    .kia-gp-categories-grid {
        display: block;
        padding-bottom: 12px;
        border-bottom: none;
    }

    .kia-gp-cat-column {
        display: none; /* Hide all category columns on mobile by default */
    }

    .kia-gp-cat-column.is-active-category {
        display: block; /* Show ONLY active category column on mobile */
    }

    .kia-gp-cat-title {
        display: none; /* Title is shown in active tab above */
    }

    .kia-gp-parts-list {
        gap: 4px;
    }

    .kia-gp-part-item {
        font-size: 0.875rem;
        padding: 6px 10px;
        border-radius: 6px;
        background: #f9fafb;
        border: 1px solid #f3f4f6;
        color: #374151;
        line-height: 1.35;
    }

    .kia-gp-part-item:hover {
        background: #f3f4f6;
        color: #05141f;
    }

    .kia-gp-part-item.is-active {
        background: #f3f4f6;
        color: #05141f;
        font-weight: 700;
        border-color: #e5e7eb;
    }

    .kia-gp-part-item.is-active::before {
        color: #8b9900;
        font-size: 0.85rem;
    }

    .kia-gp-visualizer {
        gap: 16px;
    }

    .kia-gp-chassis-stage {
        min-height: 240px;
        padding: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .kia-gp-pin {
        padding: 18px;
        margin: -18px;
    }

    .kia-gp-card {
        padding: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        gap: 12px;
    }

    .kia-gp-part-image-wrap {
        height: 150px;
        background: transparent;
        padding: 0;
        border-radius: 0;
    }

    .kia-gp-part-name {
        font-size: 1.15rem;
    }

    .kia-gp-part-description {
        font-size: 0.825rem;
    }

    .kia-gp-btn-callback {
        width: 100%;
        padding: 13px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}
