main {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

/* 매트릭스 래퍼 스타일 */
.matrix-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-right: 30px;
    perspective: 1000px;
}

/* 무드 선택기 스타일 */
.mood-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.mood-dropdown {
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    min-width: 150px;
}

.mood-dropdown:hover {
    border-color: #5a6fd8;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.mood-dropdown:focus {
    border-color: #5a6fd8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 종류 선택기 스타일 */
.category-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.category-dropdown {
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    min-width: 150px;
}

.category-dropdown:hover {
    border-color: #5a6fd8;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.category-dropdown:focus {
    border-color: #5a6fd8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.matrix-selector {
    display: flex;
    gap: 30px;
}

.color-matrix-container {
    position: relative;
    width: 600px;
    height: 600px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #ddd;
    margin-right: 30px;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    transform: rotateX(0deg) rotateY(0deg);
}

/*정육면체의 면 역할들 */
.matrix-cube {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
}

.face-all {
    transform: rotateY(0deg) translateZ(300px);
}

.face-lips {
    transform: rotateY(90deg) translateZ(300px);
}

.face-eyeshadow {
    transform: rotateX(90deg) translateZ(300px);
}

.face-blush {
    transform: rotateX(-90deg) translateZ(300px);
}

/*.matrix-cube에 적용하여 정육면체 자체를 회전*/
.matrix-cube.show-all {
    transform: rotateY(0deg);
}

.matrix-cube.show-lips {
    transform: rotateY(-90deg);
}

.matrix-cube.show-eyeshadow {
    transform: rotateX(-90deg);
}

.matrix-cube.show-blush {
    transform: rotateX(90deg);
}

.axis-label.all-label.top-label {
    transform: translate(-50%, -50%);
}

.quadrant-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    z-index: 1;
}

.quadrant {
    border: 1px dashed rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.axis-label {
    position: absolute;
    font-weight: bold;
    color: #777;
    font-size: 0.9em;
    z-index: 5;
}

.top-label {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.bottom-label {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.left-label {
    left: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.right-label {
    right: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}


.makeup-products-container {
    position: absolute;
    background: linear-gradient(to bottom right, #f8f0ff, #e0efff, #ffe0f0, #fff8e0);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.product-circle {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.7em;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
    z-index: 2;
}

.product-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 1);
}

.product-circle.selected {
    outline: 3px solid mediumpurple;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.6);
    transform: scale(1.2);
    animation: twinkle 1s infinite ease-in-out;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* 무드 구역 스타일 */
.mood-zone {
    position: absolute;
    border: 2px dashed #666;
    border-radius: 10px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.mood-zone:hover {
    opacity: 0.5;
}

.mood-zone.active {
    opacity: 0.7;
    border-color: #ff6b6b;
    border-width: 3px;
}

.mood-selection-area {
    position: absolute;
    border: 2px dashed #8a2be2;
    background-color: rgba(138, 43, 226, 0.1);
    cursor: grab;
    z-index: 10;
    min-width: 50px;
    min-height: 50px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border 0.1s ease, background-color 0.1s ease;
}

.mood-selection-area:active {
    cursor: grabbing;
}

.mood-label {
    background-color: rgba(138, 43, 226, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8em;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0.6;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.resizer {
    width: 12px;
    height: 12px;
    background-color: #8a2be2;
    border: 1px solid white;
    position: absolute;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 4;
}

.resizer.top-left-resizer {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.resizer.top-right-resizer {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.resizer.bottom-left-resizer {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.resizer.bottom-right-resizer {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}


.selected-products-display {
    width: 350px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    box-sizing: border-box;
}

.selected-products-display h2 {
    color: #4a4a4a;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.selected-products-display ul {
    list-style: none;
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.selected-products-display li {
    background-color: #f9f9f9;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.selected-products-display li:hover {
    transform: translateY(-5px);
    background-color: #eef;
    cursor: pointer;
}

.selected-products-display li .product-color-swatch {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.selected-products-display li span {
    font-weight: 500;
    color: #555;

}

.selected-products-display li span:first-of-type {
    flex-grow: 1;
}

.selected-products-display li .product-category {
    font-size: 0.85em;
    color: #888;
    background-color: #eee;
    padding: 3px 8px;
    border-radius: 5px;
    text-align: right;
}

.hidden {
    display: none !important;
}

.like-filter-toggle {
    margin: 15px;
    display: flex;
    align-items: center;
}

.toggle-checkbox {
    display: none;
    /* 실제 체크박스는 숨김 */
}

.toggle-label {
    cursor: pointer;
    background-color: #ccc;
    padding: 8px 15px;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-label .toggle-text {
    font-size: 14px;
    color: white;
}

/* 체크됐을 때 스타일 */
.toggle-checkbox:checked+.toggle-label {
    background-color: #8A2BE2;
    /* 보라색 계열 */
}

/* 모바일 터치 최적화 */
@media (max-width: 768px) {
    /* 터치 영역 최적화 */
    .mood-dropdown,
    .category-dropdown {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .recommendation-button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* 터치 스크롤 최적화 */
    .selected-products-display {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* 터치 하이라이트 제거 */
    .product-card,
    .recommendation-button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

@media (max-width: 900px) {
    main {
        flex-direction: column;
        align-items: center;
    }

    .matrix-wrapper {
        margin-right: 0;
        margin-bottom: 30px;
    }

    .color-matrix-container {
        width: 90vw;
        height: 90vw;
        max-width: 500px;
        max-height: 500px;
    }

    .selected-products-display {
        width: 90vw;
        max-width: 600px;
    }
    
    .matrix-selector {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .mood-selector,
    .category-selector {
        padding: 12px 16px;
    }
    
    .mood-dropdown,
    .category-dropdown {
        min-width: 200px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    main {
        padding: 20px 15px;
    }
    
    .matrix-wrapper {
        margin-bottom: 20px;
        gap: 15px;
    }
    
    .color-matrix-container {
        width: 95vw;
        height: 95vw;
        max-width: 450px;
        max-height: 450px;
    }
    
    .selected-products-display {
        width: 95vw;
        max-width: 500px;
        padding: 15px;
    }
    
    .mood-dropdown,
    .category-dropdown {
        min-width: 180px;
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .recommendation-slot {
        margin-bottom: 20px;
    }
    
    .recommendation-slot h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .product-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .product-card img {
        width: 60px;
        height: 60px;
    }
    
    .product-info .brand {
        font-size: 0.9em;
    }
    
    .product-info .name {
        font-size: 0.85em;
    }
    
    .product-info .price {
        font-size: 0.8em;
    }
    
    .button-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .recommendation-button {
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    main {
        padding: 15px 10px;
    }
    
    .matrix-wrapper {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .color-matrix-container {
        width: 98vw;
        height: 98vw;
        max-width: 400px;
        max-height: 400px;
    }
    
    .selected-products-display {
        width: 98vw;
        max-width: 450px;
        padding: 12px;
    }
    
    .mood-dropdown,
    .category-dropdown {
        min-width: 160px;
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .recommendation-slot {
        margin-bottom: 15px;
    }
    
    .recommendation-slot h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .product-card {
        padding: 10px;
        margin-bottom: 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .product-card img {
        width: 70px;
        height: 70px;
        margin-bottom: 8px;
    }
    
    .product-info {
        margin-bottom: 8px;
    }
    
    .button-container {
        gap: 6px;
    }
    
    .recommendation-button {
        padding: 6px 10px;
        font-size: 0.75em;
    }
}

@media (max-width: 360px) {
    .color-matrix-container {
        width: 100vw;
        height: 100vw;
        max-width: 350px;
        max-height: 350px;
    }
    
    .selected-products-display {
        width: 100vw;
        max-width: 400px;
        padding: 10px;
    }
    
    .mood-dropdown,
    .category-dropdown {
        min-width: 140px;
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .product-card {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .product-card img {
        width: 60px;
        height: 60px;
    }
    
    .recommendation-button {
        padding: 5px 8px;
        font-size: 0.7em;
    }
}