.layout-btn.active {
    background-color: #f3f4f6;
    color: #1f2937;
}
.layout-toolbar {
    background: white;
    padding: 0.1rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    gap: 0.05rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.header-toolbar {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.1rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    gap: 0.05rem;
    backdrop-filter: blur(8px);
    justify-content: space-between;
    position: relative;
}
.header-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    color: #6b7280;
    transition: all 0.2s ease;
    position: relative;
}
.header-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}
.header-btn.active {
    background-color: #f3f4f6;
    color: #1f2937;
}
.header-btn.exit {
    margin-left: auto;
    color: #ef4444;
}
.header-btn.exit:hover {
    background-color: #fee2e2;
    color: #dc2626;
}
.layout-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    color: #6b7280;
    transition: all 0.2s ease;
    position: relative;
}
.layout-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}
.list-view .product-item {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 70px;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    overflow: visible;
}
.list-view .product-item:hover {
    background-color: #f3f4f6;
    transform: translateX(4px);
}
.list-view .product-image {
    width: 52px;
    height: 52px;
    padding-bottom: 0;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.list-view .product-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 0.75rem;
    min-width: 0;
}
.list-view .product-title {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    line-height: 1.3;
    font-size: 0.875rem;
    margin: auto 0;
}
.list-view .product-price {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    flex-shrink: 0;
    margin: auto 0;
}
.list-view .cp-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
    margin: auto 0;
}
.list-view .cp-icon {
    width: 20px;
    height: 20px;
    border-radius: 10px;
}
.list-view .cp-name {
    font-size: 0.75rem;
    color: #6b7280;
}
.photo-view .product-item {
    position: relative;
}
.photo-view .product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 0.8rem;
}
.photo-view .product-edit-icon {
    color: white;
}
.bottom-toast {
    position: fixed;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 40;
    width: 80%;
    max-width: 500px;
    text-align: center;
    line-height: 1.5;
    display: none;
}
.bottom-toast.show {
    display: block;
}
.bottom-toast .product-edit-icon {
    color: white;
    margin-right: 0.75rem;
}
.price-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.3rem;
    padding-left: 0.3rem;
    border-left: 1px solid #e5e7eb;
    position: relative;
}
.price-toggle label {
    font-size: 0.75rem;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    transition: all 0.2s ease;
}
.price-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.price-toggle input[type="checkbox"]:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}
.price-toggle input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 0.25rem;
    height: 0.5rem;
    border: solid white;
    border-width: 0 2px 2px 0;
}
.price-toggle input[type="checkbox"]:hover {
    border-color: #0ea5e9;
}
.price-toggle input[type="checkbox"]:checked + label {
    color: #0ea5e9;
}
.price-toggle label:hover {
    color: #0ea5e9;
}

/* 정렬 체크박스 특별 스타일 */
.price-toggle input[type="checkbox"]:checked + label i {
    color: #0ea5e9;
    transform: scale(1.1);
}

.price-toggle label i {
    transition: all 0.2s ease;
}

.price-toggle input[type="checkbox"]:checked + label i {
    transform: rotate(45deg);
}

/* 정렬 체크박스 숨기기 */
.price-toggle input[type="checkbox"]#sortToggle {
    display: none;
}

.price-toggle label[for="sortToggle"] {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.price-toggle label[for="sortToggle"]:hover {
    background-color: #f3f4f6;
}

.profile-container {
    position: relative;
}
.edit-icon {
    position: absolute;
    top: -3px;
    left: -3px;
    background: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 10;
    border: 2px solid #e5e7eb;
}
.edit-icon:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.edit-mode .edit-icon {
    display: none;
}
.edit-mode .edit-mode-icon {
    display: inline-flex;
}
.edit-mode-icon {
    display: none;
    margin-right: 0.5rem;
    vertical-align: middle;
    color: inherit;
}
.edit-mode-icon i {
    color: inherit;
}
.header-toolbar {
    display: none;
}
.edit-mode .header-toolbar {
    display: flex;
}
.layout-toolbar {
    display: none;
}
.edit-mode .layout-toolbar {
    display: flex;
}
.profile-edit-icon {
    display: none;
}
.edit-mode .profile-edit-icon {
    display: block;
}
.product-edit-icon {
    display: none;
    margin-right: 0.5rem;
    color: #6b7280;
}
.edit-mode .product-edit-icon {
    display: inline-flex;
}
.edit-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.2rem 0.3rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    backdrop-filter: blur(8px);
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.edit-button + .edit-button {
    right: 4rem;
}
.edit-button:hover {
    background: rgba(255, 255, 255, 1);
    color: #1f2937;
}
.edit-mode .edit-button {
    display: none;
}
/* 팝업 관련 스타일 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}
.popup-container {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.popup-overlay.active .popup-container {
    transform: translateY(0);
}
.popup-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.popup-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}
.popup-close {
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
}
.popup-close:hover {
    color: #1f2937;
}
.popup-content {
    padding: 1rem;
    color: #4b5563;
}
.popup-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.popup-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.popup-button.primary {
    background: #0ea5e9;
    color: white;
}
.popup-button.primary:hover {
    background: #0284c7;
}
.popup-button.secondary {
    background: #f3f4f6;
    color: #4b5563;
}
.popup-button.secondary:hover {
    background: #e5e7eb;
}

/* 상품 아이템 컨테이너 스타일 */
#product-grid .product-item,
#product-photo .product-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* 삭제 버튼 스타일 수정 */
.delete-product-btn {
    display: none;
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    z-index: 30;
    background-color: white;
    padding: 0.25rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.delete-product-btn:hover {
    background-color: #fee2e2;
    transform: scale(1.05);
}

.delete-product-btn i {
    color: #ef4444;
    width: 1rem;
    height: 1rem;
}

.edit-mode .delete-product-btn {
    display: block;
}

/* 상품 카드 컨테이너 */
.relative {
    position: relative;
}

/* 상품 추가 버튼 스타일 */
.add-product-btn {
    display: none;
    background-color: #0ea5e9;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.add-product-btn:hover {
    background-color: #0284c7;
}
.edit-mode .add-product-btn {
    display: inline-flex;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-message {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dark .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.dark .loading-spinner {
    border: 3px solid #2d3748;
    border-top: 3px solid #3498db;
}

/* 툴팁 스타일 */
.header-btn::after, .layout-btn::after, .price-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.header-btn:hover::after, .layout-btn:hover::after, .price-toggle:hover::after {
    opacity: 1;
    visibility: visible;
    animation: tooltipFadeOut 2s forwards;
}

@keyframes tooltipFadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    80% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* 첫 번째 요소의 툴팁 위치 조정 */
.layout-toolbar > .layout-btn:first-child::after,
.layout-toolbar > .price-toggle:first-child::after {
    left: 0;
    transform: none;
}

/* 마지막 요소의 툴팁 위치 조정 */
.layout-toolbar > .layout-btn:last-child::after,
.layout-toolbar > .price-toggle:last-child::after {
    left: auto;
    right: 0;
    transform: none;
}

/* 편집 모드 통계 정보 스타일 */
.edit-mode-stats {
    display: none;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
    text-align: center;
    padding: 0.25rem;
    background-color: transparent;
    border-radius: 0.375rem;
    height: 1.5rem;
}

.edit-mode .edit-mode-stats {
    display: block;
}

/* 그리드 뷰에서 상품 아이템 컨테이너 스타일 */
#product-grid .product-item {
    margin-bottom: 0;
    position: relative;
    border-radius: 0.75rem;
    overflow: visible;
}

/* 리스트 뷰에서 상품 아이템 컨테이너 스타일 */
#product-list .product-item {
    margin-bottom: 0;
}

/* 포토 뷰에서 상품 아이템 컨테이너 스타일 */
#product-photo .product-item {
    margin-bottom: 0;
    position: relative;
    border-radius: 0.75rem;
    overflow: visible;
}

/* 에디트 모드일 때 상품 아이템 컨테이너 스타일 */
.edit-mode #product-grid .product-item,
.edit-mode #product-list .product-item,
.edit-mode #product-photo .product-item {
    margin-bottom: 1rem;
}

/* 편집 모드에서 가로 스크롤 방지 */
.edit-mode {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 상품 이미지 기본 스타일 */
.product-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 그리드 뷰 상품 이미지 */
#product-grid .product-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* 사진 뷰 상품 이미지 */
#product-photo .product-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* 리스트 뷰 상품 이미지 */
.list-view .product-image {
    width: 52px;
    height: 52px;
    padding-bottom: 0;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

/* 정렬 모드 스타일 */
.sortable {
    cursor: move;
}

.sortable-ghost {
    opacity: 0.5;
    background: #f3f4f6;
}

.sortable .product-item {
    cursor: move;
}

.sortable .product-item:hover {
    background-color: #f3f4f6;
}

/* 정렬 모드일 때 상품 클릭 비활성화 */
.sortable .product-item {
    pointer-events: none;
}

/* 정렬 완료 버튼 스타일 */
.sort-complete-btn {
    position: fixed;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.complete-btn {
    background: #0ea5e9;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.complete-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.complete-btn:active {
    transform: translateY(0);
}

/* 정렬 모드 안내 메시지 스타일 */
.sort-guide-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInOut 2s ease-in-out forwards;
}

.guide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.guide-content p {
    font-size: 0.875rem;
    line-height: 1.5;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 정렬 모드에서 툴바 숨기기 */
.sortable .header-toolbar,
.sortable .layout-toolbar {
    display: none !important;
}

/* 정렬 모드에서 삭제 버튼과 편집 모드 버튼 숨기기 */
.sortable .delete-product-btn,
.sortable .edit-button,
.sortable .edit-mode-icon,
.sortable .product-edit-icon,
.sortable .profile-edit-icon {
    display: none !important;
}

/* 정렬 모드에서 커미션과 클릭 데이터 숨기기 */
.sortable .edit-mode-stats {
    display: none !important;
}

/* 기본 레이아웃 스타일 */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    font-family: "IBM Plex Sans KR", "SUIT", "sans-serif";
}

body {
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
    width: 100%;
    position: relative;
    bottom: 0;
}

/* Font Awesome 폰트 설정 */
:root {
    --fa-font-solid: normal 900 1em / 1 "Font Awesome 6 Solid";
    --fa-font-regular: normal 400 1em / 1 "Font Awesome 6 Regular";
    --fa-font-light: normal 300 1em / 1 "Font Awesome 6 Light";
    --fa-font-thin: normal 100 1em / 1 "Font Awesome 6 Thin";
    --fa-font-duotone: normal 900 1em / 1 "Font Awesome 6 Duotone";
    --fa-font-sharp-solid: normal 900 1em / 1 "Font Awesome 6 Sharp";
    --fa-font-brands: normal 400 1em / 1 "Font Awesome 6 Brands";
}

