/* ===========================
   NutriTable - Main Stylesheet
   =========================== */

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ===========================
   Navigation - Desktop Dropdown
   =========================== */
.nav-dropdown {
    opacity: 0;
    visibility: hidden;
    /* 닫힐 때만 지연을 두어 대각선 이동 중 잠깐 벗어나도 닫히지 않게 함 */
    transition: opacity 0.15s ease, visibility 0s linear 0.25s;
    z-index: 100;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* 상단 메뉴 링크 (회색 필 컨테이너 안의 탭) */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    color: #42474f;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
    background-color: #e6e8ea;
    color: #191c1e;
}

/* 현재 메뉴: 파란 채움 */
.nav-link.is-active,
.nav-item:hover > .nav-link.is-active {
    background-color: #0f4c81;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* 하위메뉴 표시 화살표 */
.nav-chevron { transition: transform 0.2s ease; opacity: 0.7; }
.nav-item:hover .nav-chevron,
.nav-item:focus-within .nav-chevron { transform: rotate(180deg); }

/* 관리자 버튼(아웃라인) 활성 */
.nav-admin-btn.is-active { background-color: rgba(15, 76, 129, 0.1); border-color: #0f4c81; }

/* 하위메뉴 카드 */
.nav-dd-card {
    background: #fff;
    border: 1px solid rgba(194, 199, 209, 0.6);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10);
    gap: 0.125rem;
    overflow: hidden;
}

/* 카드 제목 줄 */
.nav-dd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #eceef0;
}
.nav-dd-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 12px;
    font-weight: 700;
    color: #00355f;
}
.nav-dd-badge {
    display: none;
    padding: 0 0.375rem;
    border-radius: 9999px;
    background: #00355f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}
.nav-item.is-current-menu .nav-dd-badge { display: inline-block; }

/* 항목: 점 + 텍스트 + hover 시 화살표 */
.nav-dd-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 13px;
    color: #191c1e;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-dd-item::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: transparent;
    transition: background-color 0.15s ease;
}
.nav-dd-item::after {
    content: '';
    margin-left: auto;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23727780'%3E%3Cpath d='M10 6L8.59 7.41L13.17 12L8.59 16.59L10 18L16 12L10 6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.nav-dd-item:hover {
    background-color: #eceef0;
    color: #00355f;
}
.nav-dd-item:hover::before { background: #00355f; }
.nav-dd-item:hover::after { opacity: 1; }

/* 현재 페이지 항목 */
.nav-dd-item.is-current {
    background-color: #f2f4f6;
    color: #00355f;
    font-weight: 600;
}
.nav-dd-item.is-current::before { background: #00355f; }
.nav-dd-item.is-current:hover { background-color: rgba(196, 220, 255, 0.4); }
.nav-dd-item.is-current::after { display: none; }

/* 아이콘이 있는 항목(관리자 메뉴)은 점/화살표 없이 */
.nav-dd-item--icon::before,
.nav-dd-item--icon::after { display: none; }
.nav-dd-item--icon { font-weight: 500; }

.nav-dd-label {
    padding: 0.25rem 0.75rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #727780;
}

/* ===========================
   Navigation - Mobile Accordion
   =========================== */
.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-accordion-item.active .mobile-accordion-content {
    max-height: 500px;
}

.mobile-accordion-item.active .chevron-icon {
    transform: rotate(180deg);
}

/* ===========================
   Card Aspect Ratio
   =========================== */
.aspect-card {
    position: relative;
    aspect-ratio: 4 / 5;
}

@media (max-width: 768px) {
    .aspect-card {
        aspect-ratio: 1 / 1; /* Slightly more square on mobile */
        min-height: 300px;
    }
}

/* 상품 상세 팝업 */
.tab-button { color: #94a3b8; font-weight: 500; border-bottom: 2px solid transparent; transition: color 0.15s ease; }
.tab-button:hover { color: #475569; }
.tab-button.active { color: #0f4c81; font-weight: 700; border-bottom-color: #0f4c81; }
.tab-button .tab-dot { display: none; }
.tab-button.active .tab-dot { display: inline-block; }
.tab-panel.hidden { display: none; }
.tab-panel:not(.hidden) { display: block; }

/* 얇은 스크롤바 (팝업 본문) */
.thin-scroll { scrollbar-width: thin; scrollbar-color: #c2c7d1 transparent; }
.thin-scroll::-webkit-scrollbar { width: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #c2c7d1; border-radius: 3px; }

/* 관리자 페이지네이션 */
.admin-pagination a { border: 1px solid #e5e7eb; background: #fff; color: #9ca3af; }
.admin-pagination a:hover { color: #374151; border-color: #d1d5db; background: #fff; }
.admin-pagination a.bg-primary-container { background: #0a2540; border-color: #0a2540; color: #fff; }
