/* ==========================================================================
   53 Real Ingredients Page
   파일명: common_ingredient.css
   ========================================================================== */

/* ─── 공통 ───────────────────────────────────────── */
.ck-ingredients-page {
    width: 100%;
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    color: #451400;
    box-sizing: border-box;
}

/* 그리드는 중앙 max-width 제한 */
.ingredients-grid-section {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}
/* Hero 내부 콘텐츠 중앙 정렬 (배경은 full-width) */
.ingredients-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── 1. HERO ─────────────────────────────────────── */
.ingredients-hero {
    text-align: center;
    padding: 80px 20px 50px;
    background-color: #f2f2f2;
    border-bottom: 1px solid #d4cbc7;
    width: 100%;
    max-width: 100%;
}
.ingredients-hero .hero-title {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 60px;
    line-height: 1.0;
    color: #451400;
    text-transform: uppercase;
    margin: 0 0 24px;
    letter-spacing: -0.5px;
}
.ingredients-hero .hero-description {
    max-width: 680px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: #786259;
}

/* ─── 2. 그룹 배너 ────────────────────────────────── */
.ingredients-groups-banner-container {
    width: 100%;
    margin-bottom: 10px;
}

.groups-banner {
    width: 100%;
    background-color: #f2f2f2;
    border-bottom: 1px solid #d4cbc7;
    box-sizing: border-box;
    position: relative;
}
.groups-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 헤더 행 */
.banner-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 101px;
    box-sizing: border-box;
    cursor: pointer;
}
.banner-title {
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #451400;
    text-align: center;
    user-select: none;
}
.details-toggle-container {
    display: flex;
    align-items: center;
}
.details-toggle {
    position: relative;
    width: 28px;
    height: 28px;
    background-color: #451400;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.details-toggle .icon-v,
.details-toggle .icon-h {
    position: absolute;
    background-color: #fff;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.details-toggle .icon-h { width: 12px; height: 2px; }
.details-toggle .icon-v { width: 2px;  height: 12px; }
/* 펼침 상태 → x 모양 */
.details-toggle.details-toggle-rotate { transform: rotate(45deg); }

/* ── 캐러셀 래퍼 ── */
.groups-carousel-wrap {
    display: none;
    align-items: flex-start;
    padding: 10px 0 24px;
    position: relative;
}
.groups-banner.expanded .groups-carousel-wrap {
    display: flex;
}

/* 슬라이드 트랙: 가로 스크롤 (모든 그룹이 한 줄에) */
.groups-track {
    flex: 1;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.groups-track::-webkit-scrollbar { display: none; }

/* 모든 그룹을 가로 한 줄로 */
.groups-track-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-width: max-content;
}

/* 개별 그룹 슬라이드 */
.group-slide {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 30px 0 0;
    position: relative;
}
/* 그룹 사이 여백 (구분선 없음) */
.group-slide + .group-slide {
    padding-left: 30px;
}

.group-title-row {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #786259;
    margin-bottom: 16px;
    padding-left: 10px;
}

/* 메뉴 아이템 행 */
.group-items-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0;
}

/* 개별 레시피 아이템 */
.recipe-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 90px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 4px;
    position: relative;
}
/* hover: 흰 원형 배경 */
.recipe-item:hover .recipe-icon-wrap {
    background-color: #fff;
    border-radius: 50%;
}
.recipe-item:hover .recipe-name {
    color: #451400;
    font-weight: 700;
}
/* 선택 상태 */
.recipe-item.is-active .recipe-icon-wrap {
    background-color: #fff;
    border-radius: 50%;
}
.recipe-item.is-active .recipe-name {
    color: #451400;
    font-weight: 700;
}


.recipe-icon-wrap {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}
.recipe-item .recipe-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.recipe-item .recipe-icon-placeholder {
    width: 64px;
    height: 64px;
}
.recipe-item .recipe-name {
    margin-top: 6px;
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    font-size: 11px;
    color: #786259;
    text-align: center;
    line-height: 1.3;
    transition: color 0.15s ease, font-weight 0.15s ease;
}

/* ── 좌/우 화살표 ── */
.nav-icon-container {
    width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 30px 0 0;
    align-self: flex-start;
}
.nav-icon {
    position: relative;
    width: 24px;
    height: 24px;
}
.button-icon {
    position: absolute;
    width: 10px;
    height: 2px;
    background-color: #451400;
}
.next-icon-1 { top: 6px;  left: 4px; transform: rotate(45deg); }
.next-icon-2 { top: 14px; left: 4px; transform: rotate(-45deg); }
.prev-icon-1 { top: 6px;  left: 8px; transform: rotate(135deg); }
.prev-icon-2 { top: 14px; left: 8px; transform: rotate(-135deg); }
.nav-icon-container:hover .button-icon { background-color: #786259; }

/* ─── 3. 재료 그리드 ──────────────────────────────── */
.ingredients-grid-section { padding: 40px 0 100px; }

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 50px 20px;
}
.ingredient-tile {
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}
.ingredient-tile:hover {
    transform: translateY(-4px);
}
/* hover/selected 시 아이콘 영역만 원형 회색 배경 */
.ingredient-tile:hover .tile-icon,
.ingredient-tile.is-selected .tile-icon {
    background-color: #f2f2f2;
    border-radius: 50%;
}
.ingredient-tile:hover .tile-name,
.ingredient-tile.is-selected .tile-name {
    color: #786259;
}

.ingredient-tile .tile-icon {
    width: 130px;
    height: 130px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ingredient-tile .tile-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ingredient-tile .tile-icon-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f7f2ed;
    border-radius: 50%;
}
.ingredient-tile .tile-name {
    margin-top: 10px;
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #451400;
    line-height: 1.2;
}

/* ─── 4. 슬라이드 패널 ────────────────────────────── */
.ingredient-panel-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.2);
    z-index: 9998;
}
.ingredient-panel {
    position: fixed;
    top: 0; right: 0;
    width: 100%; max-width: 550px; height: 100%;
    background-color: #fff;
    box-shadow: 0 0 8px 0 rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.ingredient-panel.is-open { transform: translateX(0); }

/* 닫기 버튼 */
.panel-close {
    position: absolute;
    top: 16px; right: 24px;
    width: 28px; height: 28px;
    background: transparent; border: 0; border-radius: 50%;
    cursor: pointer; z-index: 3;
    transform: rotate(45deg); padding: 0;
}
.panel-close .close-h,
.panel-close .close-v {
    position: absolute;
    background-color: #fff;
    top: 50%; left: 50%;
}
.panel-close .close-h { width: 18px; height: 2px; transform: translate(-50%,-50%); }
.panel-close .close-v { width: 2px; height: 18px; transform: translate(-50%,-50%); }

/* 패널 헤더 */
.panel-header {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    height: 240px;
    background-color: #786259;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.panel-header-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}
.panel-header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #000;
    opacity: 0.5;
    z-index: 2;
}
.panel-title-row {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}
.arrow-container {
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 10%;
    min-width: 50px;
}
.arrow-bg {
    position: relative;
    height: 28px; width: 28px;
    background-color: #fff;
    border-radius: 50%;
    margin: 0 auto;
}
.arrow-container.left  .arrow-bg { left: 8px; }
.arrow-container.right .arrow-bg { right: 8px; }
.left-arrow, .right-arrow {
    position: absolute;
    width: 11px; height: 11px;
    border-width: 2px 2px 0 0;
    border-style: solid;
    border-color: #451400;
    top: 50%;
}
.left-arrow  { left: 50%; transform: translate(-30%,-50%) rotate(225deg); }
.right-arrow { left: 50%; transform: translate(-70%,-50%) rotate(45deg); }

.panel-title {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 34px;
    text-transform: uppercase;
    letter-spacing: -0.6px;
    margin: 0;
    flex: 1;
    text-align: center;
    line-height: 1.1;
}

/* 패널 본문 */
.panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 25px;
    color: #451400;
    font-size: 16px;
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background-color: #fff; }
.panel-body::-webkit-scrollbar-thumb { background-color: #d4cbc7; border-radius: 20px; }

.panel-description {
    line-height: 25px;
    padding-bottom: 40px;
    margin: 0;
    color: #451400;
    white-space: pre-line;
}
.recipes-title {
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2.25px;
    text-transform: uppercase;
    color: #451400;
}
.recipes-grid {
    display: flex;
    flex-wrap: wrap;
    padding-bottom: 40px;
    gap: 10px 0;
}
.recipe-card {
    margin-top: 20px;
    width: 33.33%;
    text-align: center;
    padding: 0 5px;
    box-sizing: border-box;
}
.recipe-card .recipe-icon {
    height: 110px; width: 110px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recipe-card .recipe-icon img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}
.recipe-card .recipe-name {
    margin-top: 6px;
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    color: #786259;
    font-size: 15px;
    text-transform: uppercase;
    line-height: 1.2;
}

/* ─── 반응형 ─────────────────────────────────────── */
@media screen and (max-width: 1023px) {
    .ingredients-grid { grid-template-columns: repeat(4, 1fr); gap: 40px 16px; }
    .ingredients-hero .hero-title { font-size: 48px; }
}
@media screen and (max-width: 767px) {
    .ingredients-hero { padding: 50px 20px 30px; }
    .ingredients-hero .hero-title { font-size: 36px; }
    .ingredients-grid { grid-template-columns: repeat(3, 1fr); gap: 30px 10px; }
    .ingredient-tile .tile-icon { width: 90px; height: 90px; }
    .ingredient-tile .tile-name { font-size: 14px; }
    .ingredient-panel { max-width: 100%; }
    .panel-title { font-size: 28px; }
    .recipe-card { width: 50%; }
    .recipe-item { width: 80px; }
    .recipe-item .recipe-icon { width: 64px; height: 64px; }
}
@media screen and (max-width: 480px) {
    .ingredients-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── 레시피 펼침 섹션 ──────────────────────────────── */
.recipe-detail-section {
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #d4cbc7;
}
.recipe-detail-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    align-items: flex-start;
    gap: 40px;
    box-sizing: border-box;
}
.recipe-detail-ingredients {
    flex: 1;
}
.recipe-detail-title {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #451400;
    margin: 0 0 30px;
    text-transform: uppercase;
}
.recipe-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 0;
}
.recipe-detail-card {
    width: 20%;
    text-align: center;
    padding: 0 8px;
    box-sizing: border-box;
}
.recipe-detail-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.15s ease;
}
.recipe-detail-card:hover .recipe-detail-icon {
    background-color: #f2f2f2;
}
.recipe-detail-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.recipe-detail-name {
    margin-top: 8px;
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: #451400;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}
/* 영양정보 박스 */
.recipe-detail-nutrition {
    flex: 0 0 220px;
}
.nutrition-box {
    background-color: #f7f4f2;
    border-radius: 4px;
    padding: 24px 20px;
    text-align: center;
}
.nutrition-box-title {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #451400;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nutrition-box-sub {
    font-size: 12px;
    color: #786259;
    margin-top: 4px;
}
.nutrition-box-cal {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #451400;
    margin: 12px 0;
    line-height: 1;
}
.nutrition-box-macros {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
}
.nutrition-macro {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.macro-val {
    font-family: "Trade Gothic LT Bold", "Helvetica Neue", Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
}
.macro-val.fat     { color: #a31c1e; }
.macro-val.protein { color: #829323; }
.macro-val.carbs   { color: #d49b1c; }
.macro-label {
    font-size: 12px;
    color: #786259;
    margin-top: 2px;
}

@media screen and (max-width: 767px) {
    .recipe-detail-inner { flex-direction: column; }
    .recipe-detail-nutrition { flex: none; width: 100%; }
    .recipe-detail-card { width: 33.33%; }
}

/* recipe-detail-card hover/선택 시 */
.recipe-detail-card:hover .recipe-detail-name,
.recipe-detail-card.is-selected .recipe-detail-name { color: #786259; }

.recipe-detail-card:hover .recipe-detail-icon,
.recipe-detail-card.is-selected .recipe-detail-icon {
    background-color: #f2f2f2;
}

/* ─── 배너 선택 삼각형 포인터 (원본과 동일 구조) ──────── */
/* 삼각형 포인터 래퍼: groups-banner 하단에 absolute */
.banner-pointer-wrap {
    position: absolute;
    bottom: -40px;   /* 배너 border-bottom 아래로 삼각형이 튀어나옴 */
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    z-index: 10;
}

/* 테두리용 삼각형 */
.banner-pointer {
    position: absolute;
    top: 0;
    width: 0; height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-top: 40px solid #d4cbc7;
    transform: translateX(-50%);
}
/* 배너 배경색 덮는 내부 삼각형 (1px 작게 → 테두리 더 얇게) */
.banner-pointer::after {
    content: '';
    position: absolute;
    top: -41px;
    left: -39px;
    width: 0; height: 0;
    border-left: 39px solid transparent;
    border-right: 39px solid transparent;
    border-top: 39px solid #f2f2f2;
}

.panel-description {
    white-space: pre-line;
}