:root {
    --primary-blue: #0A84FF;
    --bg-top: #1A73E8;
    --bg-bottom: #ffffff;
    --text-gray: #5f6368;
    --line-color: #dadce0;
    --ui-top: 5%;
    --ui-height: 70%;
    --cart-scale: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    overflow-x: clip;
    background-color: #f8f9fa;
}

.bg-hero-gradient {
    background: linear-gradient(135deg, #00113b 0%, #002466 100%);
}

.embossed-nav {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 150;
}

.navbar a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin: 0 20px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar a.active,
.navbar a:hover {
    color: #fff;
}

.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, #002466 0%, rgba(0, 36, 102, 0.6) 50%, transparent 100%);
    z-index: 120;
    pointer-events: none;
    opacity: 0;
    will-change: opacity;
}

.cart-container {
    position: sticky !important;
    top: 0 !important;
    min-height: 100vh !important;
    margin: 0 auto;
    width: 100vw;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
    transform-origin: top center;
    will-change: transform;
}

@media (max-aspect-ratio: 1/1) {
    .cart-container {
        width: 130vw;
        left: 50%;
        margin-left: -15vw;
    }
}

@media (min-aspect-ratio: 1/1) {
    .cart-container {
        width: 75vw;
    }
}

.cart-top {
    width: 100%;
    height: auto;
    z-index: 100;
    position: relative;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.1));
}

.drawers-wrapper {
    position: relative;
    width: 71%;
    height: 0;
    margin-top: -25%;
    margin-bottom: 25%;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.drawer-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    transform-origin: top center;
    transform: translateY(-105%) scale(0.98);
}

.drawer-img {
    width: 100%;
    height: auto;
    margin-top: -14.73%;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.15));
}

.cart-bottom {
    width: 100%;
    height: auto;
    z-index: 10;
    position: relative;
    margin-top: -3px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.1));
}

.drawer-content-ui {
    position: absolute;
    top: var(--ui-top);
    left: 50%;
    height: var(--ui-height);
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    border-radius: 16px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    container-type: inline-size;
    z-index: 10;
}

.fluid-h2 {
    font-size: clamp(0.75rem, 7cqw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    word-break: keep-all;
    flex-shrink: 0;
    /* 절대 압축되지 않음 — 항상 전체 표시 */
}

.fluid-h3 {
    font-size: clamp(0.8rem, 5.5cqw, 1.8rem);
    font-weight: 700;
    word-break: keep-all;
    flex-shrink: 0;
}

.fluid-p {
    font-size: clamp(0.65rem, 3.2cqw, 1rem);
    line-height: 1.5;
    overflow: hidden;
}

.fluid-sm {
    font-size: clamp(0.6rem, 2.5cqw, 0.85rem);
}

.fluid-padding {
    padding: 6cqw;
}

.fluid-gap {
    gap: 3cqw;
}

/* overflow 감지는 JS adjustCardContent()가 담당 */

.drawer-layer.active .drawer-content-ui {
    opacity: 1;
    pointer-events: auto;
}

.drawer-layer.push-in {
    opacity: 0.3;
}

.sidebar {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 110;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .sidebar {
        right: auto;
        left: 50%;
        bottom: 30px;
        top: auto;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 20px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(10px);
        padding: 10px 20px;
        border-radius: 30px;
        box-shadow: 0 10px 30px rgba(0, 10, 30, 0.15);
    }

    .sidebar .nav-text {
        display: none;
    }
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    cursor: pointer;
    width: 100%;
}

.nav-text {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.nav-item.active .nav-text {
    color: var(--primary-blue);
}

.nav-icon {
    width: 36px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-item.active .nav-icon {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.slide {
    flex: 0 0 100%;
    display: flex;
    flex-direction: row;
    height: 100%;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-prev {
    left: 5px;
}

.btn-next {
    right: 5px;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* ── Touch-friendly button targets ── */
button:not(.slider-btn) {
    min-height: 44px;
}

/* ── Mobile card responsive adjustments ── */

@media (max-width: 768px) {
    .drawer-content-ui {
        aspect-ratio: unset;
        width: 86%;
    }

    .card-desc p {
        display: none !important;
    }

    .card-desc h1,
    .card-desc h2,
    .card-desc h3 {
        display: block;
    }

    /* 카드 내부 글씨 전체 축소 */
    .fluid-h2 {
        font-size: clamp(0.6rem, 5cqw, 1.2rem);
    }

    .fluid-h3 {
        font-size: clamp(0.6rem, 4cqw, 1rem);
    }

    .fluid-p {
        font-size: clamp(0.55rem, 2.5cqw, 0.8rem);
    }

    .fluid-sm {
        font-size: clamp(0.5rem, 2cqw, 0.7rem);
    }

    .fluid-padding {
        padding: clamp(0.5rem, 3cqw, 1rem);
    }

    .fluid-gap {
        gap: clamp(0.3rem, 1.5cqw, 0.6rem);
    }

    /* 카드 내 버튼 축소 */
    button:not(.slider-btn):not(#hamburger-btn) {
        min-height: 32px;
        font-size: 0.7rem;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
}