/* styles.css (기존 스타일에 취소 버튼 스타일 추가) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nanum Pen Script', cursive, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 사이드바 */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    background-color: white;
    border-right: 2px solid #ddd;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: left 0.4s ease;
    z-index: 100;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    overflow-y: scroll;
    scroll-behavior: smooth;
}

.sidebar.active {
    left: 0;
}

.sidebar-section {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    background-color: #fff;
    text-align: center;
}

.sidebar-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.login-box {
    border: 2px solid #333;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-box:hover {
    background-color: #f0f0f0;
}

.option-list {
    list-style: none;
    text-align: left;
}

.option-list li {
    padding: 10px;
    font-size: 18px;
    border-bottom: 1px solid #eee;
}

.option-list li:last-child {
    border-bottom: none;
}

/* 메뉴 버튼 */
.menu-button {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 50;
    transition: background-color 0.3s;
}

.menu-button:hover {
    background-color: white;
}

.menu-button span {
    width: 30px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
}

/* 오버레이 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 90;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 메인 컨텐츠 */
.main-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 카드 섹션 */
.cards-section {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background-color: #f5f5f5;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background-color: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
    position: relative; /* 중요: 취소 버튼 절대 위치를 위한 기준 */
}

/* 취소 버튼 (빨간 X) */
.cancel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.12s ease, opacity 0.12s ease;
    z-index: 10;
}

.cancel-btn:hover {
    transform: scale(1.06);
    opacity: 0.95;
}

.cancel-btn:active {
    transform: scale(0.98);
}

/* 카드 내부 요소들 */
.title-box {
    border: 2px solid #333;
    padding: 0;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    background-color: #fff;
    overflow: hidden;
}

.title-box h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: normal;
}

.title-box p {
    font-size: 20px;
    font-weight: normal;
}

.title-box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.info-box {
    border: 2px solid #333;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    text-align: center;
    background-color: #fff;
    font-size: 18px;
}

.description-box {
    border: 2px solid #333;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    background-color: #fff;
    font-size: 18px;
}

/* 이하 기존 스타일 그대로 유지... (생략하지 않고 전체 포함했음) */

/* 인증 모달 스타일 */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-modal-content {
    background-color: white;
    border: 3px solid #333;
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.auth-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.auth-modal-close:hover {
    color: #666;
}

.auth-modal h2 {
    font-size: 28px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 15px;
    font-size: 18px;
    border: 2px solid #333;
    border-radius: 8px;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
}

.auth-form input:focus {
    outline: none;
    border-color: #27AE60;
}

.auth-form textarea {
    padding: 15px;
    font-size: 18px;
    border: 2px solid #333;
    border-radius: 8px;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
    resize: vertical;
    min-height: 100px;
}

.auth-form textarea:focus {
    outline: none;
    border-color: #27AE60;
}

.file-input {
    padding: 10px !important;
    cursor: pointer;
}

.image-preview {
    width: 100%;
    max-height: 200px;
    border: 2px dashed #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f9f9f9;
    min-height: 150px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.image-preview:empty::before {
    content: '이미지 미리보기';
    color: #999;
    font-size: 16px;
}

.auth-btn {
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
}

.auth-btn:hover {
    background-color: #27AE60;
    color: white;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 16px;
}

.auth-links a {
    color: #27AE60;
    text-decoration: none;
    cursor: pointer;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-form p {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 제품 상세 모달 스타일 */
.detail-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-image-box {
    width: 100%;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.detail-image-box img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    display: block;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-price-box,
.detail-description-box,
.detail-seller-box {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
}

.detail-label {
    font-weight: bold;
    font-size: 20px;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 24px;
    color: #27AE60;
    font-weight: bold;
}

.detail-description-box p {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.detail-seller-box span:last-child {
    font-size: 18px;
    color: #555;
}

.purchase-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #27AE60;
    color: white;
}

.quantity-selector input {
    width: 80px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: none;
    background: transparent;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
}

.purchase-btn {
    background-color: #27AE60;
    color: white;
    font-size: 22px;
}

.purchase-btn:hover {
    background-color: #229954;
}

/* Select Group 스타일 */
.select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.select-group label {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.privacy-select {
    padding: 15px;
    font-size: 18px;
    border: 2px solid #333;
    border-radius: 8px;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.privacy-select:focus {
    outline: none;
    border-color: #27AE60;
}

.privacy-select:hover {
    border-color: #27AE60;
}

.privacy-select option {
    padding: 10px;
    font-size: 18px;
}

.privacy-select option[value=""] {
    color: #999;
}

/* 제품 등록용 사이즈 입력 스타일 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #333;
}

.product-size-input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #333;
    border-radius: 8px;
    font-family: 'Nanum Pen Script', cursive, sans-serif;
}

    .music-player {
        border: 2px solid #333;
        border-radius: 8px;
        padding: 20px;
        margin: 15px 0;
        background-color: #fff;
        text-align: center;
    }

    .music-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 20px;
        font-weight: bold;
        border: 2px solid #333;
        border-radius: 8px;
        background-color: white;
        cursor: pointer;
        transition: all 0.3s;
        font-family: 'Nanum Pen Script', cursive, sans-serif;
        margin-bottom: 10px;
    }

    .music-btn:hover {
        background-color: #27AE60;
        color: white;
    }

    .music-btn:active {
        transform: scale(0.98);
    }

    .now-playing {
        font-size: 16px;
        color: #666;
        margin-top: 10px;
        min-height: 20px;
        word-break: break-all;
        font-family: 'Nanum Pen Script', cursive, sans-serif;
    }

    .music-controls {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }

    .control-btn {
        flex: 1;
        padding: 12px;
        font-size: 18px;
        font-weight: bold;
        border: 2px solid #333;
        border-radius: 8px;
        background-color: white;
        cursor: pointer;
        transition: all 0.3s;
        font-family: 'Nanum Pen Script', cursive, sans-serif;
    }

    .control-btn:hover {
        background-color: #f0f0f0;
    }

/* 반응형 */
@media (max-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .auth-modal-content {
        padding: 30px 20px;
    }
    
    .detail-modal-content {
        padding: 30px 15px;
        max-height: 85vh;
    }
    
    .detail-image-box img {
        max-height: 250px;
    }
}

/* 스크롤바 스타일 */
.detail-modal-content::-webkit-scrollbar {
    width: 8px;
}

.detail-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.detail-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.detail-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
