/* ============================================
   전역 스타일 및 변수 설정
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:wght@700;900&display=swap');

:root {
    /* Brand Colors */
    --color-primary: #FF7A32;
    --color-primary-dark: #E65C00;
    --color-primary-soft: #FFF1E6;
    --color-secondary: #2D6A4F;

    /* Semantic Colors */
    --color-success: #4CAF50;
    --color-error: #F44336;
    --color-warning: #FFC107;

    /* Text Colors */
    --color-text-main: #1A1A1A;
    --color-text-muted: #666666;
    --color-text-white: #FFFFFF;

    /* Background Colors */
    --color-bg-main: #FDFBF9;
    --color-bg-white: #FFFFFF;
    --color-bg-alt: #F8F9FA;
    --color-bg-glass: rgba(255, 255, 255, 0.8);

    /* Borders & Shadows */
    --color-border: #EFEEEC;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: var(--color-bg-main);
    color: var(--color-text-main);
    line-height: 1.7;
    font-size: 16px;
}

/* ============================================
   컨테이너 및 레이아웃
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem;
}

/* ============================================
   헤더 및 히어로 섹션
   ============================================ */
header {
    position: relative;
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url('assets/hero.png');
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 4rem;
    padding: 2rem;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 300;
    max-width: 600px;
    margin: 0.5rem auto;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   탭 네비게이션
   ============================================ */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: calc(var(--radius-lg) - 4px);
    transition: all 0.3s ease;
}

/* ============================================
   헤더 관리자 아이콘 & AI 액션
   ============================================ */
.header-actions {
    position: absolute;
    right: 2rem;
    top: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 100;
}

.ai-quick-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.ai-quick-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    filter: brightness(1.1);
}

.ai-quick-btn:active {
    transform: scale(0.95);
}

.gemini-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid white;
}

.gemini-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.sparkle {
    font-size: 1.1rem;
    animation: twinkle 1.5s infinite alternate;
}

@keyframes twinkle {
    from {
        opacity: 0.5;
        transform: rotate(-10deg) scale(0.9);
    }

    to {
        opacity: 1;
        transform: rotate(10deg) scale(1.1);
    }
}

.admin-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 1.4rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.admin-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) rotate(10deg);
}

@media (max-width: 768px) {
    .header-actions {
        position: relative;
        right: auto;
        top: auto;
        margin-top: 1.5rem;
        justify-content: center;
        width: 100%;
        gap: 0.75rem;
    }

    .ai-quick-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .admin-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}


.tab-btn:hover {
    background: var(--color-bg-main);
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
}

/* ============================================
   탭 컨텐츠 영역
   ============================================ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   관리자 페이지 오버레이 (스타일 클래스 통합)
   ============================================ */
.admin-tab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F8F9FA;
    z-index: 10000;
    overflow-y: auto;
    display: none;
    /* 기본값 제어 */
    animation: fadeIn 0.3s ease;
}

/* ============================================
   카드 스타일
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.card-title::before {
    content: '●';
    color: var(--color-primary);
    font-size: 0.8rem;
}

/* ============================================
   브랜드 스토리 섹션
   ============================================ */
.brand-story {
    padding: 6rem 1rem;
    text-align: center;
    background: var(--bg-white);
}

.brand-story h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.brand-story p {
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 2;
}

/* ============================================
   상품 목록
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-item {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    border: 1px solid var(--color-border);
}

.product-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.product-item.selected {
    border-color: var(--color-primary);
    border-width: 2px;
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.product-image {
    width: 100%;
    height: 140px;
    background: #F9F7F5;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.product-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem 1.25rem;
}

.product-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text-main);
}

.product-description {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ============================================
   스켈레톤 로딩 UI
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.product-item.skeleton-card {
    pointer-events: none;
    cursor: default;
}

.product-item.skeleton-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.skeleton-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text.title {
    height: 1.15rem;
    width: 70%;
    margin-bottom: 0.4rem;
}

.skeleton-text.description {
    height: 0.85rem;
    width: 90%;
    margin-bottom: 0.75rem;
}

.skeleton-text.price {
    height: 1.35rem;
    width: 50%;
}

/* ============================================
   폼 요소
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
    font-size: 1rem;
}

label .required {
    color: var(--color-primary);
    margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    /* transition: all -> box-shadow, border-color 로 최적화하여 렉 방지 */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    -webkit-appearance: none;
    /* iOS 그림자 제거 */
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    /* 터치시 하이라이트 제거 */
    touch-action: manipulation;
    /* 더블탭 확대 방지 및 터치 최적화 */
}

input:active,
input:focus {
    /* 터치 및 포커스 시 즉각 반응 */
    border-color: var(--color-primary);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

/* ============================================
   버튼 스타일
   ============================================ */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--color-text-main);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-success {
    background: var(--color-secondary);
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* ============================================
   주소 입력 영역
   ============================================ */
.address-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.address-group input {
    flex: 1;
}

.address-group .btn {
    white-space: nowrap;
}

/* ============================================
   수량 선택 영역
   ============================================ */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-main);
    border-radius: var(--radius-lg);
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.quantity-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    min-width: 60px;
    text-align: center;
}

/* ============================================
   주문 요약
   ============================================ */
.order-summary {
    background: linear-gradient(135deg, #FFF5EB 0%, #FFE8D6 100%);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-row:last-child {
    border-bottom: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    padding-top: 1rem;
}

/* ============================================
   관리자 패널
   ============================================ */
.admin-login {
    max-width: 400px;
    margin: 4rem auto;
}

.orders-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.orders-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* 레이아웃 고정 */
}

.orders-table th,
.orders-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.orders-table th {
    background: var(--color-bg-main);
    font-weight: 700;
    color: var(--color-text-main);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.orders-table th:hover {
    background: #E8E8E8;
}

.orders-table th.sortable::after {
    content: '\2195';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 0.8rem;
}

.orders-table th.sort-asc::after {
    content: '\25B2';
    opacity: 1;
    color: var(--color-primary);
}

.orders-table th.sort-desc::after {
    content: '\25BC';
    opacity: 1;
    color: var(--color-primary);
}

.orders-table td {
    vertical-align: middle;
}

/* 컬럼별 너비 지정 및 높이 고정 */
.orders-table th,
.orders-table td {
    height: 45px;
    /* 행 높이 고정 */
    white-space: nowrap;
    /* 모든 셀 1줄 유지 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
    width: 90px;
}

/* 입금여부 */
.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    width: 112px;
}

/* 주문일자 */
.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
    width: 90px;
}

/* 주문자 */
.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
    width: 90px;
}

/* 금액 */
.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
    width: 60px;
}

/* 수량 */
.orders-table th:nth-child(6),
.orders-table td:nth-child(6) {
    width: 120px;
    font-size: 0.85rem;
}

/* 연락처 */
.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
    width: 90px;
}

/* 수취인 */
.orders-table th:nth-child(8),
.orders-table td:nth-child(8) {
    width: 130px;
    /* 주소 열 */
}

.orders-table th:nth-child(9),
.orders-table td:nth-child(9) {
    width: 100px;
    /* 주문번호 */
}

.orders-table tr:hover {
    background: var(--color-bg-main);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #FFF3CD;
    color: #997404;
}

.status-paid {
    background: #D1F2EB;
    color: #0C5540;
}

.status-toggle-wrapper {
    cursor: pointer;
    display: inline-flex;
    padding: 2px;
    border-radius: 20px;
    transition: background 0.2s;
}

.status-toggle-wrapper:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================
   유틸리티 클래스
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

/* ============================================
   상품 관리 폼
   ============================================ */
.product-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.image-upload-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    overflow: hidden;
    background: var(--color-bg-main);
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-preview .placeholder {
    color: var(--color-text-muted);
    text-align: center;
    padding: 1rem;
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .card {
        padding: 1.5rem;
    }

    .orders-table {
        overflow-x: auto;
    }

    .orders-table table {
        min-width: 600px;
    }

    .orders-table th,
    .orders-table td {
        padding: 0.5rem 0.75rem;
        /* 행 높이 감소 */
        font-size: 0.85rem;
        /* 폰트 크기 미세 조정 */
    }

    .status-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   로딩 및 애니메이션
   ============================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 140, 66, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* 스켈레톤 애니메이션 */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: var(--radius-lg);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

.skeleton-item {
    height: 300px;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   토스트 메시지
   ============================================ */

.toast-message {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--color-text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 100000;
    transition: bottom 0.3s ease;
    min-width: 250px;
    text-align: center;
}

.toast-message.show {
    bottom: 30px;
}

.toast-message.toast-success {
    background: #4CAF50;
    color: white;
}

.toast-message.toast-error {
    background: #F44336;
    color: white;
}

/* ============================================
   성공 메시지
   ============================================ */
.success-message {
    background: linear-gradient(135deg, #D1F2EB 0%, #A7E9D7 100%);
    color: #0C5540;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.success-message h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.success-message p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ============================================
   알림 메시지
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ============================================
   입력 검증 스타일
   ============================================ */
.input-error {
    border-color: #F44336 !important;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1) !important;
}

.error-message {
    color: #F44336;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
}

.error-message.show {
    display: block;
}

.nudge-message {
    color: #E67E22;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
    font-weight: 500;
}

.nudge-message.show {
    display: block;
}

.input-nudge {
    border-color: #E67E22 !important;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1) !important;
}

.input-success {
    border-color: var(--color-secondary) !important;
}

.alert-info {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    border-left: 5px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.alert-warning {
    background: #FFF3CD;
    color: #997404;
    border-left: 4px solid #FFC107;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

/* ============================================
   클립보드 복사 버튼
   ============================================ */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
}

/* ============================================
   주문 완료 모달
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.modal-header p {
    opacity: 0.95;
    font-size: 1rem;
}

.modal-body {
    padding: 2rem;
}

.modal-info-section {
    background: var(--color-bg-main);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-info-section h3 {
    font-size: 1.1rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.modal-info-row:last-child {
    border-bottom: none;
}

.modal-info-label {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.modal-info-value {
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: right;
}

.modal-account-box {
    background: linear-gradient(135deg, #FFF5EB 0%, #FFE8D6 100%);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
}

.modal-account-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================================
   주문 조회 섹션
   ============================================ */
.order-lookup-section {
    margin-top: 4rem;
    padding-bottom: 4rem;
}

.lookup-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.lookup-result {
    margin-top: 3rem;
}

.order-result-card {
    background: var(--bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.order-result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.order-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.order-result-id {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: monospace;
}

.no-result-msg {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

/* ============================================
   관리자 대시보드 스타일
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.stats-summary {
    display: flex;
    justify-content: space-around;
    padding: 2rem 1rem;
    text-align: center;
    background: #fdfbf9;
    border-radius: var(--radius-lg);
}

.stat-item {
    flex: 1;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.stat-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.modal-footer {
    padding: 0 2rem 2rem 2rem;
}

.modal-close-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .modal-content {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-info-section {
        padding: 1.2rem;
    }

    .modal-account-number {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-footer {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
}

/* ============================================
   관리자 패널 통합 스타일 리뉴얼
   ============================================ */
.admin-tab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-alt);
    /* 부드러운 밝은 회색 배경 */
    z-index: 10000;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-overlay.active {
    display: block;
}

.admin-header {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.admin-header h2 {
    font-size: 1.4rem;
    color: var(--color-text-main);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header h2::before {
    content: '⚙️';
    font-size: 1.2rem;
}

/* 관리자 헤더 버튼들 */
.admin-header .close-admin-btn {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.admin-header .close-admin-btn:hover {
    background: #e9ecef;
    color: var(--color-text-main);
}

#header-logout-btn {
    background: #fff5f5 !important;
    color: #e03131 !important;
    border-color: #ffa8a8 !important;
}

#header-logout-btn:hover {
    background: #ffe3e3 !important;
}

/* 입력 폼 터치 문제 해결을 위한 z-index 보정 및 오버플로우 해제 */
#order-form-section .card {
    position: relative;
    z-index: 10;
    overflow: visible !important;
}

/* 입력 필드 자체도 z-index 부여 및 터치 동작 보정 */
#order-form-section input {
    position: relative;
    z-index: 20;
    -webkit-user-select: text;
    user-select: text;
    touch-action: manipulation;
}

/* 관리자 로그인 화면 */
.admin-login {
    max-width: 420px !important;
    margin: 10vh auto !important;
    padding: 3rem !important;
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    background: white !important;
    border-radius: 24px !important;
}

.admin-login .card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.admin-login .card-title::before {
    display: none;
}

.admin-login .form-group label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.admin-login input {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
    font-size: 1.1rem;
    padding: 1.2rem;
}

.admin-login input:focus {
    background: white;
    border-color: var(--color-primary);
}

.admin-login .btn-primary {
    height: 3.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 16px;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(255, 122, 50, 0.3);
}

/* 탭 네비게이션 개선 */
#admin-panel .tab-navigation {
    background: var(--color-bg-alt);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    gap: 0.2rem;
}

#admin-panel .tab-btn {
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 11px;
    font-size: 0.95rem;
    padding: 0.75rem;
    font-weight: 700;
}

#admin-panel .tab-btn.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 히어로 섹션 보정 */
header {
    z-index: 1;
}

main {
    position: relative;
    z-index: 2;
    background: var(--color-bg-main);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   로딩 스피너
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: all;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   헤더 상단 관리 유틸리티 (매우 작고 투명하게)
   ============================================ */
.header-utility {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.mini-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    /* 14px -> 18px */
    opacity: 0.4;
    /* 0.15 -> 0.4 */
    transition: all 0.3s ease;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    filter: grayscale(0.5);
}

.mini-icon-btn:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .header-utility {
        top: 10px;
        right: 12px;
        gap: 10px;
    }

    .mini-icon-btn {
        font-size: 17px;
        padding: 12px;
        opacity: 0.5;
    }
}

/* ============================================
   AI 주문 퀵 등록 모달 스타일
   ============================================ */
.ai-modal {
    max-width: 600px !important;
}

#ai-text-input {
    width: 100%;
    height: 180px;
    /* 기존보다 크게 조정 */
    padding: 1.2rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    resize: none;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    background: #fdfdfd;
}

#ai-text-input:focus {
    border-color: var(--color-primary);
    background: white;
}

.file-upload-area {
    border: 2px dashed var(--color-border);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #f8fafc;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--color-text-muted);
}

.file-upload-area:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.file-upload-area::before {
    content: '📁';
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

#ai-file-label {
    font-weight: 700;
    font-size: 1rem;
}

.ai-result-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-border);
}

.hidden {
    display: none !important;
}