/* ============================================================
   CB Marketplace — Product Detail Page
   Design tokens:
     Font:    Epilogue
     Blue:    #1732a4
     Red:     #ff5858 / #e84a3d
     Dark:    #191c2f
     Grey BG: #f5f6fa
     Border:  #e4e8f0
     Gradient: linear-gradient(135deg, #e84a3d 0%, #2a348c 100%)
   ============================================================ */

/* ──────────────────────────────────────────────
   1. PAGE LAYOUT
   ────────────────────────────────────────────── */
.cb-product {
    padding: 1.25rem 0 2rem;
}

/* Breadcrumb */
.cb-product__breadcrumb .breadcrumb {
    margin: 0;
    font-size: .85rem;
}

.cb-product__breadcrumb .breadcrumb-item a {
    color: #1732a4;
    text-decoration: none;
    font-weight: 500;
}

.cb-product__breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.cb-product__breadcrumb .breadcrumb-item.active {
    color: #7c8299;
}

/* ──────────────────────────────────────────────
   2. PRODUCT HERO CARD
   ────────────────────────────────────────────── */
.cb-product__hero {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e4e8f0;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .cb-product__hero { padding: 1.75rem; }
}

/* ──────────────────────────────────────────────
   3. IMAGE GALLERY
   ────────────────────────────────────────────── */
.cb-gallery {
    display: flex;
    gap: .75rem;
}

/* Thumbnail strip */
.cb-gallery__thumbs {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 0 0 auto;
    width: 70px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cb-gallery__thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    border: 2px solid #e4e8f0;
    overflow: hidden;
    cursor: pointer;
    background: #f5f6fa;
    padding: 4px;
    transition: border-color .2s, box-shadow .2s;
    flex-shrink: 0;
}

.cb-gallery__thumb:hover,
.cb-gallery__thumb.active {
    border-color: #1732a4;
    box-shadow: 0 0 0 2px rgba(23, 50, 164, .15);
}

.cb-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Main image */
.cb-gallery__main {
    flex: 1;
    min-width: 0;
    background: #f5f6fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.cb-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: opacity .3s;
}

/* Single-image fallback (no thumbnails) */
.cb-gallery--single {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
}

.cb-gallery--single img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 1.5rem;
}

/* ──────────────────────────────────────────────
   4. PRODUCT INFO
   ────────────────────────────────────────────── */
.cb-product__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #191c2f;
    line-height: 1.4;
    margin: 0 0 .75rem;
}

@media (min-width: 768px) {
    .cb-product__title { font-size: 1.35rem; }
}

/* Badge pills */
.cb-product__badge {
    display: inline-block;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}

.cb-product__badge:hover {
    opacity: .85;
}

.cb-product__badge--brand {
    background: rgba(23, 50, 164, .1);
    color: #1732a4;
}

.cb-product__badge--category {
    background: rgba(232, 74, 61, .1);
    color: #e84a3d;
}

/* Actions row */
.cb-product__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.cb-product__share {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e4e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c8299;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
}

.cb-product__share:hover {
    border-color: #1732a4;
    color: #1732a4;
    background: rgba(23, 50, 164, .05);
}

/* ──────────────────────────────────────────────
   5. TABS
   ────────────────────────────────────────────── */
.cb-tabs .nav-tabs {
    border-bottom: 2px solid #e4e8f0;
    gap: .25rem;
}

.cb-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #7c8299;
    font-size: .85rem;
    font-weight: 600;
    padding: .6rem 1rem;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    background: transparent;
}

.cb-tabs .nav-link:hover {
    color: #191c2f;
    border-bottom-color: #e4e8f0;
}

.cb-tabs .nav-link.active {
    color: #1732a4;
    border-bottom-color: #1732a4;
    background: transparent;
}

.cb-tabs__content {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1.25rem;
    font-size: .88rem;
    color: #7c8299;
    line-height: 1.7;
}

/* ──────────────────────────────────────────────
   6. RELATED PRODUCTS
   ────────────────────────────────────────────── */
.cb-related {
    margin-bottom: 2rem;
}

.cb-related__header {
    margin-bottom: 1.25rem;
}

.cb-related__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    background: linear-gradient(135deg, #e84a3d 0%, #2a348c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cb-related__bar {
    display: block;
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: #ff5858;
}

/* Product grid (mirrors category.css) */
.cb-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 156px);
    justify-content: space-evenly;
    row-gap: 1rem;
}

.cb-product-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    transition: transform .3s, box-shadow .3s, border-color .3s;
}

.cb-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(23, 50, 164, .1);
    border-color: rgba(23, 50, 164, .18);
}

.cb-product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.cb-product-card__visual {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f6fa;
}

.cb-product-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .35s;
}

.cb-product-card:hover .cb-product-card__visual img {
    transform: scale(1.05);
}

.cb-product-card__info {
    padding: .6rem .65rem;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-product-card__name {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    color: #191c2f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.cb-product-card:hover .cb-product-card__name {
    color: #1732a4;
}

/* Responsive grid */
@media (min-width: 576px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 170px); }
}

@media (min-width: 768px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 185px); }
    .cb-product-card__name { font-size: .82rem; }
}

@media (min-width: 1200px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 200px); }
    .cb-product-card__name { font-size: .85rem; }
}

@media (min-width: 1400px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 210px); }
}
