@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-light: #F4F4F4;
    --text-light: #111;
    --bg-dark: #111;
    --text-dark: #f4f4f4;
    --accent: #693EFF;
    --transition-speed: 0.4s ease-in-out;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg-light);
    font-family: 'Poppins', sans-serif;
    color: var(--text-light);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

header {
    width: 1140px;
    max-width: 90%;
    display: flex;
    justify-content: space-between;
    margin: auto;
    height: 50px;
    align-items: center;
    padding: 20px 0;
}

header .logo {
    font-weight: 700;
    font-size: 1.3rem;
}

header nav a {
    margin-left: 30px;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: color var(--transition-speed);
}

header nav a:hover {
    color: var(--accent);
}

/* carousel */
.carousel {
    position: relative;
    height: 800px;
    overflow: hidden;
    margin-top: -30px;
}

.carousel .list {
    position: absolute;
    width: 1140px;
    max-width: 90%;
    height: 80%;
    left: 50%;
    transform: translateX(-50%);
}

.carousel .list .item {
    position: absolute;
    left: 0%;
    width: 70%;
    height: 100%;
    font-size: 15px;
    transition: all var(--transition-speed);
}

.carousel .list .item:nth-child(n+6) {
    opacity: 0;
}

.carousel .list .item:nth-child(2) {
    z-index: 10;
    transform: translateX(0);
}

.carousel .list .item img {
    width: 60%;
    height: 90%;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-55%);
    object-fit: cover;
    object-position: center top; 
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.5s ease;
    animation: fadeInImg 1.2s ease-in-out forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

@keyframes fadeInImg {
    to {
        opacity: 1;
    }
}

.carousel .list .item .introduce {
    opacity: 0;
    pointer-events: none;
}

.carousel .list .item:nth-child(2) .introduce {
    opacity: 1;
    pointer-events: auto;
    width: 400px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity var(--transition-speed);
}

.introduce .title {
    font-size: 2em;
    font-weight: 500;
    line-height: 1em;
}

.introduce .topic {
    font-size: 3em;
    font-weight: 600;
}

.introduce .des {
    font-size: 0.9em;
    color: #5559;
}

.introduce .seeMore {
    font-family: Poppins;
    margin-top: 1.2em;
    padding: 8px 0;
    border: none;
    border-bottom: 2px solid #555;
    background-color: transparent;
    font-weight: bold;
    letter-spacing: 2px;
    transition: background var(--transition-speed);
}

.introduce .seeMore:hover {
    background: #eee;
    cursor: pointer;
}

.carousel .list .item:nth-child(1) {
    transform: translateX(-100%) translateY(-5%) scale(1.5);
    filter: blur(30px);
    z-index: 11;
    opacity: 0;
    pointer-events: none;
}

.carousel .list .item:nth-child(3) {
    transform: translate(50%, 10%) scale(0.8);
    filter: blur(10px);
    z-index: 9;
}

.carousel .list .item:nth-child(4) {
    transform: translate(90%, 20%) scale(0.5);
    filter: blur(30px);
    z-index: 8;
}

.carousel .list .item:nth-child(5) {
    transform: translate(120%, 30%) scale(0.3);
    filter: blur(40px);
    z-index: 7;
    opacity: 0;
    pointer-events: none;
}

/* detail section */
.detail {
    opacity: 0;
    pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(3),
.carousel.showDetail .list .item:nth-child(4) {
    left: 100%;
    opacity: 0;
    pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) {
    width: 100%;
}

.carousel.showDetail .list .item:nth-child(2) .introduce {
    opacity: 0;
    pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) img {
    right: 50%;
}

.carousel.showDetail .list .item:nth-child(2) .detail {
    opacity: 1;
    width: 50%;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    pointer-events: auto;
}

.detail .title {
    font-size: 3em;
    font-weight: 700;
}

.detail .des {
    font-size: 0.9em;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1em;
}

.specifications {
    display: flex;
    gap: 10px;
    width: 100%;
    border-top: 1px solid #ccc;
    padding-top: 15px;
    flex-wrap: wrap;
}

.specifications div {
    width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.specifications div p:first-child {
    font-weight: bold;
    font-size: 0.8em;
}

.checkout {
    margin-top: 20px;
}

.checkout button {
    font-family: Poppins;
    background-color: transparent;
    border: 1px solid #5555;
    margin-left: 10px;
    padding: 8px 14px;
    letter-spacing: 2px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.checkout button:nth-child(2) {
    background-color: var(--accent);
    color: white;
    border: none;
}

/* arrows & back */
.arrows {
    position: absolute;
    bottom: 10px;
    width: 1140px;
    max-width: 90%;
    display: flex;
    justify-content: space-between;
    left: 50%;
    transform: translateX(-50%);
}

#prev,
#next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-family: monospace;
    border: 1px solid #5555;
    font-size: large;
    cursor: pointer;
    background: white;
}

#back {
    position: absolute;
    z-index: 100;
    bottom: 0%;
    left: 50%;
    transform: translateX(-50%);
    border: none;
    border-bottom: 1px solid #555;
    font-family: Poppins;
    font-weight: bold;
    letter-spacing: 3px;
    background-color: transparent;
    padding: 10px;
    transition: opacity 0.5s;
}

.carousel.showDetail #back {
    opacity: 1;
}

.carousel.showDetail #prev,
.carousel.showDetail #next {
    opacity: 0;
    pointer-events: none;
}

.carousel::before {
    width: 500px;
    height: 300px;
    content: '';
    background-image: linear-gradient(70deg, #DC422A, var(--accent));
    position: absolute;
    z-index: -1;
    border-radius: 20% 30% 80% 10%;
    filter: blur(150px);
    top: 50%;
    left: 50%;
    transform: translate(-10%, -50%);
    transition: 1s;
}

.carousel.showDetail::before {
    transform: translate(-100%, -50%) rotate(90deg);
    filter: blur(130px);
}

/* Responsive */
@media screen and (max-width: 991px) {
    .carousel .list .item {
        width: 90%;
    }

    .carousel.showDetail .list .item:nth-child(2) .detail .title {
        font-size: 2em;
    }

    .specifications {
        overflow-x: auto;
    }
}

@media screen and (max-width: 767px) {
    .carousel {
        height: 600px;
    }

    .carousel .list .item {
        width: 100%;
        font-size: 10px;
    }

    .carousel .list {
        height: 100%;
    }

    .carousel .list .item:nth-child(2) .introduce {
        width: 50%;
    }

    .carousel .list .item img {
        width: 45%;
    }

    .carousel.showDetail .list .item:nth-child(2) .detail {
        backdrop-filter: blur(10px);
        font-size: small;
    }

    .carousel .list .item:nth-child(2) .introduce .des,
    .carousel.showDetail .list .item:nth-child(2) .detail .des {
        height: 100px;
        overflow: auto;
    }

    .carousel.showDetail .list .item:nth-child(2) .detail .checkout {
        display: flex;
        flex-wrap: wrap;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-dark);
        color: var(--text-dark);
    }

    header nav a:hover {
        color: var(--accent);
    }

    .introduce .seeMore:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .checkout button:nth-child(1) {
        color: #eee;
        border-color: #777;
    }

    .carousel .list .item img {
        box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
    }

    #prev,
    #next {
        background: #222;
        color: white;
    }

    #back {
        color: #eee;
    }
}