/* ========================================
   Product Page Styles
   Extracted from product.html inline styles
   ======================================== */

.product-hero {
    background: #fff;
    /* 배경 이미지 제거, 흰색 배경 */
    width: 100%;
    height: auto;
    /* 높이 자동 조정 */
    padding: 60px 0;
    /* 상하 패딩 */
}

.product-hero-container {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.product-hero-search-title {
    color: var(--Foundation-black, #000);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 36px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: -1.44px;
    margin: 80px 0 0 0;
    /* 상단 간격 80px 추가 */
}

.product-tabs-container2 {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.product-hero-text {
    /* padding-top: 100px; */
    display: flex;
    width: 350px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.product-hero-title {
    color: var(--Foundation-white, #FFF);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 60px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: -2.4px;
    margin: 0;
}

.product-hero-subtitle {
    color: var(--Foundation-white, #FFF);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 26px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 0;
}

.product-list-section {
    display: flex;
    justify-content: center;
    margin: 0 auto 160px auto;
}

.product-list-container {
    width: 1340px;
    max-width: 100%;
    min-height: 300px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0;
}

.product-search-container {
    display: flex;
    width: 380px;
    padding: 16px 20px;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.product-search-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    color: var(--Foundation-Grey-G100, #8C8C8C);
    font-family: "Noto Sans KR";
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.8px;
}

.product-search-input::placeholder {
    color: var(--Foundation-Grey-G100, #8C8C8C);
}

.product-search-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-title {
    display: none;
}

.product-tabs-container {
    width: 100%;
    min-height: 360px;

    box-sizing: border-box;
}

.product-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.product-tab {
    border: 1px solid var(--Foundation-Grey-G75, #ADADAD);
    background: var(--Foundation-white, #FFF);
    display: flex;
    padding: 12px 24px;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-tab:hover,
.product-tab.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.product-tab[data-filter="hospital"].active {
    background: #00358E;
    /* 파랑 */
    color: #fff;
    border-color: #00358E;
}

/* 약국 전용 탭 활성화시 빨강 배경 */
.product-tab[data-filter="pharmacy"].active {
    background: #9B2246;
    /* 빨강 */
    color: #fff;
    border-color: #9B2246;
}

/* 병원 전용 탭 호버 효과 */
.product-tab[data-filter="hospital"]:hover {
    background: #002366;
    /* 더 진한 파랑 */
    color: #fff;
    border-color: #002366;
}

/* 약국 전용 탭 호버 효과 */
.product-tab[data-filter="pharmacy"]:hover {
    background: #7A1B36;
    /* 더 진한 빨강 */
    color: #fff;
    border-color: #7A1B36;
}

.product-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 2fr;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
}

.product-header-item {
    color: var(--Foundation-black, #000);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.72px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-list {
    display: flex;
    flex-direction: column;
}

.product-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 2fr;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

/* a 태그가 있어도 그리드 레이아웃 유지 (SEO/접근성 보존) */
.product-item > a {
    display: contents;
}

.product-item:hover {
    background: #f8f9fa;
}

.product-name {
    color: var(--Foundation-black, #000);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.72px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image-placeholder {
    width: 200px;
    height: 200px;
    background: #ddd;
    border-radius: 8px;
}

.product-ingredients,
.product-effects {
    color: var(--Foundation-black, #000);
    text-align: center;
    font-family: "Noto Sans KR";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.72px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 30px 20px;
    border-top: 1px solid #eee;
}

.pagination-btn {
    padding: 12px 24px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    font-family: "Noto Sans KR";
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #999;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    font-family: "Noto Sans KR";
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    background: #f8f9fa;
    border-color: #999;
}

.pagination-number.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

@media (max-width: 768px) {
    .product-hero {
        padding: 40px 0;
        /* 모바일 패딩 조정 */
    }

    .product-hero-search-title {
        display: none !important;
        /* 모바일에서 숨김 - .mobile-search-title이 대신 표시됨 */
    }

    .product-tabs-container2 {
        flex-direction: column;
        /* 모바일: 세로 */
        gap: 20px;
        align-items: stretch;
        display: flex;
        flex-direction: column-reverse;
        margin: 0 auto;
        max-width: 100%;

    }

    .product-hero-text {
        width: 280px;
    }

    .product-hero-title {
        font-size: 40px;
        letter-spacing: -1.6px;
    }

    .product-hero-subtitle {
        font-size: 20px;
    }

    .product-search-wrapper {
        width: 100%;
    }

    .mobile-search-title {
        display: block !important;
        font-family: "Noto Sans KR";
        font-size: 24px;
        /* 18px -> 24px */
        font-style: normal;
        font-weight: 700;
        line-height: normal;
        letter-spacing: -0.96px;
        color: var(--Foundation-black, #000);
        margin: 0 0 12px 0;
        padding: 0 4px;
        text-align: center;
        /* left -> center */
    }

    .product-list-section {
        margin: 0 !important;
        /* 좌우 마진 제거 */
        padding: 1px 16px 70px 16px !important;
        /* 상단 여백 1px, 하단 패딩 70px */
    }

    .product-list-container {
        width: 100% !important;
        max-width: 100% !important;
        align-items: stretch !important;
        /* 전체 너비 사용 */
        padding: 0 !important;
    }

    .product-search-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        /* input과 버튼 사이 간격 추가 */
        padding: 8px 12px !important;
        /* 패딩 조정 (16px -> 8px) */
    }

    .product-search-input {
        flex: 1 !important;
        min-width: 0 !important;
        /* flexbox에서 너비 제한 해제 */
        font-size: 16px !important;
        /* 모바일에서 텍스트 크기 조정 */
    }

    .search_btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        width: 44px !important;
        /* 버튼 고정 너비 */
        height: 44px !important;
        /* 버튼 고정 높이 */
        padding: 0 !important;
        margin-left: 8px !important;
        /* input과의 간격 */
    }

    .product-tabs-container {
        width: 100% !important;
    }

    .product-tabs {
        display: flex !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 0px !important;
        margin: 0 auto 0 0 !important;
    }

    /* 영어: 모바일에서 product-tabs Grid 레이아웃 */
    html[lang="en"] body .product-tabs,
    html[lang="en"] .product-tabs-container .product-tabs {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
        align-items: flex-start !important;
        padding: 0px !important;
        margin: 0 auto 0 0 !important;
    }

    .product-tab {
        border: 1px solid var(--Foundation-Grey-G75, #ADADAD) !important;
        background: var(--Foundation-white, #FFF) !important;
        display: flex !important;
        white-space: nowrap;
        /* 줄바꿈 방지 */
        margin: 0;
        /* 마진 제거 */
        flex-shrink: 0;
        /* 축소 방지 */
        padding: 10px 16px !important;
        align-items: center !important;
        gap: 4px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        flex: 1 !important;
        min-width: 0 !important;
        justify-content: center !important;
        font-size: 12px !important;
        text-align: center !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .product-tab:hover,
    .product-tab.active {
        background: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
    }

    /* 모바일용 병원 전용 탭 */
    .product-tab[data-filter="hospital"].active {
        background: #00358E !important;
        color: #fff !important;
        border-color: #00358E !important;
    }

    /* 모바일용 약국 전용 탭 */
    .product-tab[data-filter="pharmacy"].active {
        background: #9B2246 !important;
        color: #fff !important;
        border-color: #9B2246 !important;
    }

    .product-list-header {
        display: none !important;
    }

    .product-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        /* gap 줄이기 */
        padding: 0 !important;
        /* 패딩 제거 */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .product-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        /* 중앙 정렬 */
        justify-content: flex-start !important;
        width: 100% !important;
        /* 전체 너비 사용 */
        box-sizing: border-box !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .product-ingredients {
        display: none !important;
    }

    .product-item.hidden {
        display: none !important;
    }

    /* a 태그가 있어도 그리드/플렉스 레이아웃 유지 */
    .product-item > a {
        display: contents;
    }

    .product-name {
        width: 100% !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        text-align: center !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        order: 2 !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
    }

    .product-image {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .product-image img {
        width: 100% !important;
        max-width: 120px !important;
        height: auto !important;
        object-fit: cover !important;
    }

    .product-image-placeholder {
        width: 120px !important;
        height: 120px !important;
        border-radius: 8px !important;
    }

    .product-ingredients,
    .product-effects {
        font-size: 13px !important;
        text-align: center !important;
        line-height: 1.4 !important;
        padding: 0 !important;
        margin: 0 !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
    }

    .product-effects {
        order: 3 !important;
        margin-top: 0 !important;
    }

    .product-ingredients {
        color: #666 !important;
        margin-bottom: 5px !important;
    }

    .product-effects {
        color: #333 !important;
        font-weight: 500 !important;
    }

    .product-pagination {
        padding: 30px 20px !important;
    }
}

/* ========== 영어별 레이아웃 조정 ========== */

/* 영어/일본어: word-break: keep-all 제거 (긴 단어가 화면에서 잘리가는 문제 방지) */
html[lang="en"] *,
html[lang="ja"] * {
    word-break: normal;
}

/* 영어/일본어: 모바일에서 긴 제품명 줄바꿈 처리 */
html[lang="en"] .product-name,
html[lang="ja"] .product-name {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* 영어/일본어: 모바일에서 제품 카드 오버플로우 방지 */
@media (max-width: 768px) {
    html[lang="en"] .product-item,
    html[lang="ja"] .product-item {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    html[lang="en"] .product-name,
    html[lang="ja"] .product-name {
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
}

/* 데스크톱: hidden 클래스 제품 숨김 */
@media (min-width: 769px) {
    .product-list .product-item.hidden {
        display: none !important;
    }
}
