/* ========== Product Center Pages CSS ========== */

/* ===== Common wrapper (matches existing site .wrap pattern) ===== */
.n_product > .main,
.product_tabs > .main,
.n_product_detail > .main,
.product_description > .main,
.product_sub_items > .main,
.related_products > .main,
#product_inquiry > .main { width: calc(100% - 160px); margin: 0 auto; }

/* ===== Tabs Bar ===== */
.product_tabs { background: #fff; border-bottom: 1px solid #eee; padding: 24px 0 0; margin-bottom: 30px; }
.product_tabs .main { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.product_tabs_nav { display: flex; flex-wrap: wrap; gap: 0; }
.product_tabs_nav a {
    display: inline-block; padding: 10px 24px; font-size: 15px; color: #555;
    text-decoration: none; border-bottom: 2px solid transparent; transition: all 0.3s; white-space: nowrap;
}
.product_tabs_nav a:hover { color: #018843; border-bottom-color: #018843; }
.product_tabs_nav a.active { color: #018843; border-bottom-color: #018843; font-weight: bold; }
.product_tabs .sitemp { padding: 0 0 10px; margin: 0 0 0 auto; flex-shrink: 0; }
.product_tabs .sitemp .site { white-space: nowrap; }

/* ===== Category Title ===== */
.product_cat_title { margin-bottom: 30px; padding-top: 8px; }
.product_cat_title h1 { font-size: 28px; color: #222; font-weight: 700; margin: 0 0 12px; line-height: 1.2; }
.product_cat_title hr { border: none; border-top: 2px solid #018843; width: 60px; margin: 0; }

/* ===== Product Grid (4-col) ===== */
.product_grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; margin-bottom: 40px; }
.product_card {
    background: #fff; border: 1px solid #eee; border-radius: 8px;
    overflow: hidden; transition: all 0.35s;
}
.product_card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.12); transform: translateY(-4px); border-color: #ddd; }
.product_card a { display: block; text-decoration: none; color: inherit; }
.product_card_img { position: relative; width: 100%; padding-top: 100%; overflow: hidden; background: #f9f9f9; }
.product_card_img img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; transition: transform 0.4s; padding: 12px; box-sizing: border-box;
}
.product_card:hover .product_card_img img { transform: scale(1.05); }
.product_card_name {
    text-align: center; font-size: 15px; color: #333; padding: 14px 12px;
    margin: 0; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Pagination ===== */
.product_pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 0 50px; }
.product_pagination a, .product_pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 10px; font-size: 14px;
    color: #555; border: 1px solid #ddd; border-radius: 50%;
    text-decoration: none; transition: all 0.3s; font-family: Arial, sans-serif;
}
.product_pagination a:hover { color: #018843; border-color: #018843; }
.product_pagination .current { background: #018843; color: #fff; border-color: #018843; }
.product_pagination .disabled { background: #f5f5f5; color: #ccc; border-color: #f5f5f5; pointer-events: none; }
.product_empty { text-align: center; padding: 60px 0; color: #999; }

/* ================================================================
   PRODUCT DETAIL PAGE
   ================================================================ */
.n_product_detail { padding: 30px 0 40px; background: #f9fafb; }

/* Breadcrumb inside detail section */
.pd-breadcrumb { margin-bottom: 24px; font-size: 15px; color: #808080; font-family: "FZLT_S"; }
.pd-breadcrumb a { color: #808080; text-decoration: none; }
.pd-breadcrumb a:hover { color: #018843; }
.pd-breadcrumb .s_arrow { margin: 0 12px; }

/* ---- Detail Container ---- */
.product_detail_container { display: flex; gap: 40px; align-items: flex-start; }

/* Left: Image */
.product_detail_image { flex: 0 0 42%; max-width: 520px; min-width: 320px; }

/* Right: Info Card */
.product_detail_info {
    flex: 1; background: #fff; border-radius: 12px;
    padding: 36px 40px; box-shadow: 0 2px 16px rgba(0,0,0,0.04); border: 1px solid #eee;
}
.product_detail_title {
    font-size: 24px; color: #1a1a1a; font-weight: 700;
    margin: 0 0 16px; line-height: 1.4; padding-bottom: 16px; border-bottom: 2px solid #f0f0f0;
}
.product_detail_desc { font-size: 15px; color: #555; line-height: 1.9; margin-bottom: 24px; }

/* Info rows */
.product_detail_info_row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: 14px; line-height: 1.6; }
.product_detail_info_row .info-label { color: #999; flex-shrink: 0; min-width: 70px; }
.product_detail_info_row .info-value { color: #444; flex: 1; }
.product_detail_info_row .info-value a { color: #018843; text-decoration: none; }
.product_detail_info_row .info-value a:hover { text-decoration: underline; }

/* Keywords */
.product_detail_keywords { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.product_detail_keywords .label { color: #999; font-size: 14px; flex-shrink: 0; }
.keyword_tag {
    display: inline-block; padding: 4px 14px; background: #f0f7f2; color: #018843;
    border-radius: 20px; font-size: 13px; text-decoration: none; transition: all 0.2s; border: 1px solid #d4ece0;
}
.keyword_tag:hover { background: #018843; color: #fff; border-color: #018843; }

/* Phone card */
.product_detail_phone {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; margin: 20px 0; background: #f8faf8;
    border-radius: 10px; border: 1px solid #e8f0ea;
}
.product_detail_phone .phone-icon {
    flex-shrink: 0; width: 40px; height: 40px; background: #018843;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.product_detail_phone .phone-info { flex: 1; }
.product_detail_phone .phone-label { font-size: 12px; color: #999; line-height: 1; margin-bottom: 4px; }
.product_detail_phone .phone-number { font-size: 22px; color: #1a1a1a; font-weight: 700; text-decoration: none; letter-spacing: 1px; line-height: 1; }

/* Action Buttons */
.product_detail_actions { display: flex; gap: 12px; flex-wrap: wrap; }
.product_detail_actions .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 32px; font-size: 15px; border-radius: 8px; text-decoration: none;
    cursor: pointer; transition: all 0.3s; border: 1px solid transparent; font-weight: 500;
    flex: 1; min-width: 140px;
}
.product_detail_actions .btn_primary { background: #018843; color: #fff; border-color: #018843; }
.product_detail_actions .btn_primary:hover {
    background: #016b35; border-color: #016b35; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(1,136,67,0.25);
}
.product_detail_actions .btn_outline { background: #fff; color: #018843; border-color: #018843; }
.product_detail_actions .btn_outline:hover { background: #f0faf4; transform: translateY(-1px); }

/* ---- Magnifier ---- */
.pd-magnifier { position: relative; }
.pd-magnifier-container {
    position: relative; overflow: hidden; border: 1px solid #eee;
    border-radius: 8px; aspect-ratio: 1/1; cursor: crosshair; background: #fafafa;
}
.pd-magnifier-container img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-magnifier-view {
    position: absolute; left: calc(100% + 14px); top: 0; width: 100%; height: 100%;
    background: #fff; border: 1px solid #ddd; border-radius: 8px; display: none;
    overflow: hidden; z-index: 10; background-repeat: no-repeat;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); pointer-events: none;
}
.pd-magnifier-line { position: relative; margin-top: 12px; padding: 0 28px; }
.pd-thumb-prev, .pd-thumb-next {
    position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 44px;
    line-height: 44px; text-align: center; cursor: pointer; font-size: 22px;
    color: #999; background: #fff; border: 1px solid #eee; border-radius: 4px;
    user-select: none; z-index: 2; transition: color 0.2s;
}
.pd-thumb-prev { left: 0; } .pd-thumb-next { right: 0; }
.pd-thumb-prev:hover, .pd-thumb-next:hover { color: #018843; }
.pd-magnifier-thumbs { display: flex; gap: 8px; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.pd-magnifier-thumbs li {
    flex: 0 0 64px; height: 64px; border: 2px solid #eee;
    border-radius: 4px; cursor: pointer; overflow: hidden; transition: border-color 0.2s;
}
.pd-magnifier-thumbs li.active { border-color: #018843; }
.pd-magnifier-thumbs li img { width: 100%; height: 100%; object-fit: contain; }

/* ---- Sections ---- */
.product_description { padding: 50px 0 60px; background: #fafafa; }
.product_sub_items { padding: 50px 0 60px; background: #fff; }
.related_products { padding: 50px 0 60px; background: #fff; }
#product_inquiry { padding: 50px 0 60px; background: #fafafa; text-align: center; }
#product_inquiry .btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 40px; font-size: 16px; border-radius: 6px; text-decoration: none; color: #fff; }

.product_description .section_title,
.related_products .section_title,
.product_sub_items .section_title {
    font-size: 22px; color: #222; font-weight: 700; text-align: center;
    margin: 0 0 30px; padding-bottom: 15px; position: relative;
}
.product_description .section_title::after,
.related_products .section_title::after,
.product_sub_items .section_title::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 50px; height: 2px; background: #018843;
}
.product_desc_content { font-size: 14px; color: #555; line-height: 2; max-width: 100%; overflow: hidden; }
.product_desc_content img { max-width: 100%; height: auto; border-radius: 4px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* 1600px */
@media (max-width: 1600px) {
    .n_product > .main, .product_tabs > .main, .n_product_detail > .main,
    .product_description > .main, .product_sub_items > .main,
    .related_products > .main, #product_inquiry > .main { width: calc(100% - 100px); }
    .product_grid { gap: 20px; }
    .product_detail_container { gap: 32px; }
    .product_detail_image { flex: 0 0 40%; max-width: 480px; }
    .product_detail_info { padding: 30px 34px; }
}

/* 1280px */
@media (max-width: 1280px) {
    .n_product > .main, .product_tabs > .main, .n_product_detail > .main,
    .product_description > .main, .product_sub_items > .main,
    .related_products > .main, #product_inquiry > .main { width: calc(100% - 60px); }
    .product_grid { grid-template-columns: repeat(3,1fr); gap: 18px; }
    .product_tabs_nav a { padding: 8px 16px; font-size: 14px; }
    .product_cat_title h1 { font-size: 24px; }
    .product_detail_container { gap: 24px; }
    .product_detail_image { flex: 0 0 38%; max-width: 420px; min-width: 260px; }
    .product_detail_info { padding: 28px 28px; }
    .product_detail_title { font-size: 21px; }
}

/* 992px - tablet: stack vertically */
@media (max-width: 992px) {
    .n_product > .main, .product_tabs > .main, .n_product_detail > .main,
    .product_description > .main, .product_sub_items > .main,
    .related_products > .main, #product_inquiry > .main { width: calc(100% - 40px); }
    .product_grid { grid-template-columns: repeat(2,1fr); gap: 16px; }
    .product_tabs { padding: 12px 0 0; margin-bottom: 20px; }
    .product_tabs .main { gap: 0; }
    .product_tabs .sitemp { display: none; }
    .product_tabs_nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; width: 100%; padding: 6px 0; }
    .product_tabs_nav::-webkit-scrollbar { height: 0; }
    .product_tabs_nav a { padding: 8px 14px; font-size: 13px; flex-shrink: 0; white-space: nowrap; }
    .product_cat_title { margin-bottom: 20px; }
    .product_cat_title h1 { font-size: 22px; }

    /* Stack detail vertically */
    .n_product_detail { padding: 20px 0 28px; background: #fff; }
    .product_detail_container { flex-direction: column; gap: 20px; margin: 0; }
    .product_detail_image { flex: 1 1 auto; max-width: 100%; min-width: 0; }
    .product_detail_info { padding: 28px 24px; }
    .product_detail_title { font-size: 22px; }
    .pd-magnifier-view { display: none !important; }
    .pd-magnifier-container { cursor: default; }
    .product_detail_actions .btn { flex: 1; }
}

/* 768px - mobile */
@media (max-width: 768px) {
    .n_product > .main, .product_tabs > .main, .n_product_detail > .main,
    .product_description > .main, .product_sub_items > .main,
    .related_products > .main, #product_inquiry > .main { width: calc(100% - 24px); }
    .product_grid { grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 24px; }
    .product_tabs { padding: 0; margin-bottom: 16px; }
    .product_tabs .main { gap: 0; }
    .product_tabs .sitemp { display: none; }
    .product_tabs_nav {
        overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
        width: 100%; padding: 10px 0;
        /* scroll hint */
        background: linear-gradient(to right, #fff 95%, rgba(1,136,67,.08)) no-repeat;
        background-size: 30px 100%;
    }
    .product_tabs_nav::-webkit-scrollbar { height: 3px; background: #f0f0f0; }
    .product_tabs_nav::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
    .product_tabs_nav a { padding: 9px 14px; font-size: 13px; flex-shrink: 0; white-space: nowrap; }
    .product_cat_title { margin-bottom: 16px; padding-top: 4px; }
    .product_cat_title h1 { font-size: 20px; margin-bottom: 8px; }
    .product_card_name { font-size: 13px; padding: 10px 8px; }
    .product_card_img img { padding: 8px; }
    .product_pagination a, .product_pagination span { min-width: 34px; height: 34px; font-size: 13px; }
    .product_pagination { gap: 4px; padding: 10px 0 30px; }

    /* Detail mobile */
    .n_product_detail { padding: 0; background: #fff; }
    .pd-breadcrumb { margin-bottom: 0; padding: 10px 16px; font-size: 13px; }
    .pd-breadcrumb .s_arrow { margin: 0 8px; }
    .product_detail_container { flex-direction: column; gap: 0; margin: 0; }
    .product_detail_image { flex: 1 1 auto; max-width: 100%; min-width: 0; }
    .product_detail_info { padding: 16px; border-radius: 0; box-shadow: none; border: none; }
    .product_detail_title { font-size: 19px; margin-bottom: 6px; padding-bottom: 10px; }
    .product_detail_desc { font-size: 14px; margin-bottom: 12px; line-height: 1.7; }
    .product_detail_info_row { margin-bottom: 8px; font-size: 13px; }
    .product_detail_info_row .info-label { min-width: 60px; }
    .keyword_tag { font-size: 12px; padding: 3px 10px; }
    .product_detail_phone { padding: 12px; margin: 12px 0; }
    .product_detail_phone .phone-number { font-size: 17px; }
    .product_detail_phone .phone-icon { width: 32px; height: 32px; }
    .product_detail_actions .btn { padding: 11px 14px; font-size: 14px; flex: 1; }
    .pd-magnifier-view { display: none !important; }
    .pd-magnifier-container { cursor: default; }
    .pd-magnifier-thumbs li { flex: 0 0 56px; height: 56px; }
    .product_description, .product_sub_items, .related_products { padding: 32px 0 36px; }
    #product_inquiry { padding: 32px 0 36px; }
    #product_inquiry .btn { padding: 12px 24px; font-size: 14px; }
    .product_description .section_title, .related_products .section_title, .product_sub_items .section_title { font-size: 18px; margin-bottom: 18px; padding-bottom: 10px; }
}

/* 480px - small phone */
@media (max-width: 480px) {
    .n_product > .main, .product_tabs > .main,
    .product_description > .main, .product_sub_items > .main,
    .related_products > .main, #product_inquiry > .main { width: calc(100% - 16px); }
    .product_grid { gap: 8px; }
    .product_card_name { font-size: 12px; padding: 8px 6px; }

    /* Detail */
    .product_detail_container { gap: 0; }
    .product_detail_info { padding: 14px 12px; border-radius: 0; box-shadow: none; border: none; }
    .product_detail_title { font-size: 17px; }
    .product_detail_desc { font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
    .product_detail_info_row { font-size: 13px; margin-bottom: 6px; }
    .product_detail_info_row .info-label { min-width: 56px; }
    .product_detail_phone { padding: 10px 12px; margin: 10px 0; }
    .product_detail_phone .phone-number { font-size: 16px; }
    .product_detail_phone .phone-icon { width: 30px; height: 30px; }
    .product_detail_actions .btn { padding: 10px 12px; font-size: 13px; flex: 1; }
    .pd-magnifier-thumbs li { flex: 0 0 48px; height: 48px; }
}
