/* ============ Product Show Page ============ */

/* Page Banner & Breadcrumb */
.page-banner { position: relative; height: 280px; overflow: hidden; }
.page-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-banner-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); }
.page-banner h1 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 44px; font-weight: 600; letter-spacing: 1px; margin: 0; }
.breadcrumb-bar { background: #f2f2f2; padding: 14px 0; font-size: 14px; color: #666; }
.breadcrumb-bar .container, .proshow-wrap .container { max-width: 1500px; margin: 0 auto; }
.breadcrumb-bar a { color: #666; transition: color 0.3s; }
.breadcrumb-bar a:hover { color: #4c4c4c; }
.breadcrumb-label { margin-right: 8px; }
.breadcrumb-sep { margin: 0 8px; color: #999; }
.breadcrumb-current { color: #999; }

/* Layout */
.prolist-wrap, .proshow-wrap { padding: 40px 0 60px; }
.proshow-layout { display: flex; gap: 25px; align-items: flex-start; }
.proshow-sidebar { flex: 0 0 300px; }
.proshow-content { min-width: 0; }

/* Mobile Sidebar Toggle */
.sidebar-toggle { display: none; }
.side-toggle { display: none; }

/* Sidebar Category Box */
.side-box { margin-bottom: 25px; }
.side-box-title { background: #4c4c4c; color: #fff; font-size: 17px; font-weight: 600; padding: 14px 18px; margin: 0; }
.cate-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e8e8e8; border-top: none; background: #fff; }
.cate-item { border-bottom: 1px solid #eee; }
.cate-item:last-child { border-bottom: none; }
.cate-item > a { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 14px; color: #333; transition: all 0.3s; }
.cate-item > a:hover { color: #4c4c4c; background: #fafafa; }
.cate-arrow { font-size: 12px; color: #999; transition: transform 0.3s; }
.cate-item.open .cate-arrow { transform: rotate(180deg); }
.cate-sub { list-style: none; margin: 0; padding: 0 0 8px; display: none; }
.cate-item.open .cate-sub { display: block; }
.cate-sub li a { display: block; padding: 8px 18px 8px 30px; font-size: 13px; color: #666; position: relative; transition: all 0.3s; }
.cate-sub li a::before { content: "•"; position: absolute; left: 20px; color: #17a89f; }
.cate-sub li a:hover { color: #4c4c4c; }
.cate-sub li.current a { color: #4c4c4c; }

/* QR Hover Popup */
.qr-wrap { position: relative; display: inline-flex; cursor: pointer; }
.qr-popup { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #ddd; box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 8px; width: 146px; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 50; }
.qr-popup img, .qr-popup canvas { display: block; max-width: none; width: 130px; height: 130px; }
.qr-wrap:hover .qr-popup { opacity: 1; visibility: visible; }

/* Product Top: Gallery + Info */
.product-top { display: flex; gap: 30px; margin-bottom: 30px; flex: 1; min-width: 0; }
.product-gallery { flex: 0 0 46%; min-width: 0; }
.gallery-main { position: relative; border: 1px solid #eee; padding: 25px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity 0.3s, transform 0.25s ease-out; will-change: transform; }
@media (hover: hover) {
    .gallery-main:hover img { transform: scale(1.8); }
}
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,0.85); color: #333; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.15); opacity: 0; transition: all 0.3s; z-index: 5; display: flex; align-items: center; justify-content: center; padding-bottom: 3px; }
.gallery-main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.gallery-arrow:hover { background: #4c4c4c; color: #fff; }
.gallery-thumbs-wrap { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.gallery-nav { flex: 0 0 26px; height: 60px; border: none; background: #eee; color: #999; font-size: 16px; cursor: pointer; transition: all 0.3s; }
.gallery-nav:hover { background: #4c4c4c; color: #fff; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb { flex: 0 0 calc((100% - 24px) / 4); border: 2px solid transparent; padding: 4px; cursor: pointer; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: #fff; transition: border-color 0.3s; scroll-snap-align: start; }
.gallery-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumb.active { border-color: #17a89f; }

/* Product Info Box */
.product-info-box { flex: 1; min-width: 0; }
.product-title { font-size: 24px; font-weight: 600; color: #222; margin: 0 0 20px; line-height: 1.4; display: flex; align-items: flex-start; gap: 8px; }
.qr-icon { flex: 0 0 auto; margin-top: 4px; }
.product-attr { font-size: 14px; color: #666; margin-bottom: 12px; }
.quantity-attr { display: flex; align-items: center; gap: 12px; }
.quantity-stepper { display: flex; }
.quantity-stepper button { width: 32px; height: 32px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; font-size: 16px; color: #555; transition: all 0.3s; }
.quantity-stepper button:hover { background: #4c4c4c; color: #fff; border-color: #17a89f; }
.quantity-stepper input { width: 50px; height: 32px; text-align: center; border: 1px solid #ddd; border-left: none; border-right: none; background: #e8f5e9; font-size: 14px; font-family: inherit; outline: none; }
.product-btns { margin: 25px 0 20px; display: flex; flex-direction: column; gap: 12px; max-width: 300px; }
.btn-outline { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #17a89f; color: #17a89f; padding: 11px 20px; font-size: 15px; border-radius: 30px; transition: all 0.3s; }
.btn-outline:hover { background: #4c4c4c; color: #fff; }
.share-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; transition: opacity 0.3s, transform 0.3s; }
.share-icon:hover { opacity: 0.85; transform: translateY(-2px); }
.share-icon.fb { background: #3b5998; }
.share-icon.tw { background: #000; }
.share-icon.wa { background: #25d366; }
.share-icon.li { background: #0077b5; }
.share-icon.pi { background: #e60023; }
.share-icon.em { background: #888; }
.share-icon.sh { background: #4c4c4c; }

/* Tag Pill */
.product-tag-pill { display: inline-block; border: 1px solid #ccc; border-radius: 20px; padding: 6px 18px; font-size: 13px; color: #666; margin-bottom: 30px; }

/* Model Tabs */
.model-tabs { display: flex; background: #f0f0f0; margin-bottom: 30px; }
.model-tab { flex: 1; padding: 14px 10px; text-align: center; font-size: 15px; font-weight: 600; color: #555; background: none; border: none; cursor: pointer; font-family: inherit; transition: all 0.3s; }
.model-tab:hover { color: #4c4c4c; }
.model-tab.active { background: #4c4c4c; color: #fff; }

/* Model Panel */
.model-panel { display: none; }
.model-panel.active { display: block; }
.model-subtitle { font-size: 17px; font-weight: 600; color: #333; margin: 0 0 15px; }
.model-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 35px; }
.model-img { background: #fff; }
.model-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border: 1px solid #f0f0f0; }
.model-img-box img { border: none; }
.model-img p { text-align: center; font-size: 14px; color: #555; margin: 0; padding: 10px 0; background: #fafafa; border: 1px solid #f0f0f0; border-top: none; }

/* Article */
.product-article { font-size: 15px; color: #444; line-height: 1.9; }
.product-article p { margin: 0 0 14px; }
.product-article a { color: #4c4c4c; }
.product-article a:hover { text-decoration: underline; }
.product-article h2 { font-size: 24px; font-weight: 400; color: #222; margin: 30px 0 12px; }

/* Related Products */
.related-section { background: #f5f5f5; padding: 45px 0 35px; }
.related-title { font-size: 34px; font-weight: 600; color: #222; margin: 0 0 25px; }
.related-carousel { display: flex; gap: 15px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 5px; }
.related-carousel::-webkit-scrollbar { display: none; }
.related-card { flex: 0 0 calc((100% - 90px) / 7); scroll-snap-align: start; background: #fff; text-decoration: none; }
.related-img { aspect-ratio: 4/3; overflow: hidden; padding: 10px; }
.related-img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s; }
.related-card:hover .related-img img { transform: scale(1.05); }
.related-card p { font-size: 13px; color: #555; text-align: center; margin: 0; padding: 8px 10px 12px; line-height: 1.5; }
.related-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.related-dot { width: 9px; height: 9px; border-radius: 50%; background: #ccc; border: none; cursor: pointer; padding: 0; transition: background 0.3s; }
.related-dot.active { background: #4c4c4c; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .proshow-sidebar { flex: 0 0 260px; }
    .product-top { gap: 20px; }
    .page-banner { height: 220px; }
    .page-banner h1 { font-size: 36px; }
    .related-card { flex: 0 0 calc((100% - 30px) / 3); }
}

@media (max-width: 768px) {
    .proshow-wrap { padding: 20px 0 40px; }
    .page-banner { height: 150px; }
    .page-banner h1 { font-size: 28px; }
    .breadcrumb-bar { padding: 10px 0; font-size: 12px; }

    /* Sidebar collapsed by default */
    .sidebar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: #17a89f; color: #fff; border: none; padding: 13px 18px; font-size: 15px; font-family: inherit; cursor: pointer; margin-bottom: 0; justify-content: center; }
    .sidebar-toggle .toggle-arrow { margin-left: auto; font-size: 16px; transition: transform 0.3s; }
    .sidebar-toggle.open .toggle-arrow { transform: rotate(180deg); }

    .proshow-layout { flex-direction: column; gap: 15px; }
        .sidebar-toggle { margin-bottom: 0; }
        .proshow-sidebar .side-box { margin-bottom: 0; }
    .proshow-sidebar { display: none; flex: unset; width: 100%; order: -1; }
    .proshow-layout.sidebar-open .proshow-sidebar { display: block; }
    .proshow-sidebar .side-box.collapsible .side-box-title { display: none; }
    .proshow-sidebar .side-box.collapsible .cate-list { max-height: none; overflow: visible; border-top: 1px solid #e8e8e8; }

    /* Category box collapsible */
    .side-box.collapsible .side-box-title { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
    .side-box.collapsible .side-toggle { display: block; font-size: 16px; transition: transform 0.3s; }
    .side-box.collapsible.open .side-toggle { transform: rotate(180deg); }
    .side-box.collapsible .cate-list { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
    .side-box.collapsible.open .cate-list { max-height: 800px; }

    /* Product top stacks vertically */
    .product-top { flex-direction: column; gap: 20px; margin-bottom: 20px; }
    .product-gallery { flex: unset; width: 100%; }
    .gallery-main { padding: 15px; cursor: default; }
    .gallery-arrow { opacity: 1; width: 32px; height: 32px; font-size: 20px; }
    .gallery-main:hover img { transform: none; }
    .gallery-thumbs { scroll-snap-type: x mandatory; }
    .qr-popup { left: auto; right: 0; transform: none; }
    .product-title { font-size: 18px; }
    .product-attr { font-size: 13px; }
    .product-btns { max-width: 100%; flex-direction: row; }
    .btn-outline { flex: 1; padding: 10px 12px; font-size: 13px; }

    .product-tag-pill { font-size: 12px; margin-bottom: 20px; }
    .model-tabs { margin-bottom: 20px; }
    .model-tab { padding: 11px 5px; font-size: 13px; }
    .model-subtitle { font-size: 15px; margin-bottom: 10px; }
    .model-imgs { grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }

    .product-article { font-size: 14px; }
    .product-article h2 { font-size: 19px; margin: 22px 0 10px; }

    .related-section { padding: 30px 0 25px; }
    .related-title { font-size: 24px; margin-bottom: 15px; }
    .related-card { flex: 0 0 46%; }
    .related-card p { font-size: 12px; }
}
