/* =============================================================
   detail.css — Halaman Detail Produk | TOKO MADURA
   Simpan di: assets/css/detail.css
   ============================================================= */

/* ===== BREADCRUMB ===== */
.detail-breadcrumb {
    background: var(--primary-soft);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.detail-breadcrumb a { color: var(--primary); text-decoration: none; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-breadcrumb .sep { color: #ccc; margin: 0 6px; }
.detail-breadcrumb .current { color: var(--text-muted); }

/* ===== MAIN DETAIL ===== */
.detail-section { padding: 32px 0 48px; }

/* ===== IMAGE GALLERY ===== */
.gallery-wrap { position: sticky; top: 20px; }

.gallery-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f9f9f9;
    border: 1.5px solid var(--border);
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .25s ease;
}
.gallery-main .badge-new-lg {
    position: absolute;
    top: 14px; left: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}
.gallery-main .badge-featured-lg {
    position: absolute;
    top: 14px; right: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}

/* Navigasi panah gallery */
.gallery-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px;
    background: rgba(255,255,255,.88);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: background .15s, box-shadow .15s;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.gallery-nav:hover { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

/* Thumbnail strip */
.gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color .15s, transform .15s;
    background: #f9f9f9;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); transform: scale(1.04); }
.gallery-thumb:hover:not(.active) { border-color: #ccc; }

/* ===== PRODUCT INFO ===== */
.info-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 50px;
    border: 1.5px solid;
}
.badge-pill.new  { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.badge-pill.feat { background: var(--accent-soft);   color: var(--accent);  border-color: var(--accent); }
.badge-pill.sold { background: #FEF2F2;              color: #DC2626;        border-color: #DC2626; }

.product-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 6px;
}

.product-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Rating summary line */
.rating-line {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; margin-bottom: 14px;
}
.stars-inline { color: #FFB800; font-size: 14px; }
.rating-score { font-weight: 700; color: var(--text-dark); }
.rating-count { color: var(--text-muted); }
.rating-divider { color: #ddd; }

/* Price */
.price-box { margin-bottom: 20px; }
.price-main {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 30px;
    color: var(--primary);
    line-height: 1;
}
.price-original {
    font-size: 14px;
    color: #aaa;
    text-decoration: line-through;
    margin-top: 4px;
}
.price-tags {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.price-tag-hemat {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}
.price-tag-label {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid var(--primary);
}
.price-tag-end {
    font-size: 11px;
    color: #D97706;
}
.price-stock {
    font-size: 12px;
    margin-top: 8px;
}
.price-stock .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.stock-ok  { color: #16A34A; }
.stock-ok  .dot { background: #16A34A; }
.stock-low { color: #D97706; }
.stock-low .dot { background: #D97706; }
.stock-out { color: #DC2626; }
.stock-out .dot { background: #DC2626; }

/* Divider */
.info-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* Deskripsi singkat */
.short-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.75;
    margin-bottom: 18px;
}

/* Quantity picker */
.qty-label { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 8px; }
.qty-wrap { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.qty-btn {
    width: 38px; height: 38px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 18px; font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: background .15s, color .15s;
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:first-child { border-radius: 8px 0 0 8px; }
.qty-btn:last-child  { border-radius: 0 8px 8px 0; }
.qty-btn:hover { background: var(--primary-light); color: var(--primary); }
.qty-input {
    width: 56px; height: 38px;
    border: 1.5px solid var(--border);
    border-left: none; border-right: none;
    text-align: center;
    font-size: 15px; font-weight: 700;
    color: var(--text-dark);
    outline: none;
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button { display: none; }
.qty-max { font-size: 12px; color: var(--text-muted); margin-left: 12px; }

/* CTA buttons */
.detail-cta { display: flex; gap: 12px; }
.btn-keranjang,
.btn-beli {
    flex: 1;
    border-radius: 50px;
    padding: 13px 20px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-keranjang {
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--primary);
    transition: background .18s, color .18s;
}
.btn-keranjang:hover { background: var(--primary-light); }
.btn-keranjang.added {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-beli {
    background: var(--primary);
    border: 2px solid var(--primary);
    color: #fff;
    transition: opacity .18s;
}
.btn-beli:hover { opacity: .88; }

/* Alert stok habis */
.stock-out-alert {
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    border-radius: 10px;
    color: #DC2626;
    font-size: 13px;
    padding: 12px 16px;
}

/* Info strip */
.info-strip {
    display: flex; gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}
.info-strip-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px;
    text-align: center;
    font-size: 11px; color: #666;
    border-right: 1px solid var(--border);
    gap: 4px;
}
.info-strip-item:last-child { border: none; }
.info-strip-item i { font-size: 18px; color: var(--primary); }
.info-strip-item strong { font-size: 12px; color: var(--text-dark); }

/* ===== TABS ===== */
.detail-tabs-section { padding: 0 0 48px; }
.detail-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.detail-tabs-nav {
    border-bottom: 1.5px solid var(--border);
    padding: 0 24px;
}
.detail-tabs .nav-link {
    font-size: 14px; font-weight: 600;
    color: var(--text-muted);
    border: none !important;
    border-bottom: 2.5px solid transparent !important;
    border-radius: 0 !important;
    padding: 12px 20px;
    transition: color .15s;
}
.detail-tabs .nav-link.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
    background: none;
}
.detail-tabs .nav-link:hover { color: var(--primary); }
.detail-tab-content { padding: 28px 24px; }

.tab-content-inner { font-size: 14px; color: #555; line-height: 1.8; }
.tab-content-inner h5 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700; font-size: 15px;
    color: var(--text-dark); margin: 18px 0 8px;
}
.tab-content-inner h5:first-child { margin-top: 0; }
.tab-content-inner ul {
    padding-left: 0; list-style: none; margin: 0;
}
.tab-content-inner ul li {
    padding: 5px 0;
    border-bottom: 1px dashed #f0f0f0;
    display: flex; gap: 8px;
}
.tab-content-inner ul li:last-child { border: none; }
.tab-content-inner ul li::before {
    content: "✓";
    color: var(--primary);
    font-weight: 700;
}

/* Gambar di tab deskripsi */
.tab-desc-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* Tabel spesifikasi */
.spec-table { font-size: 13px; width: 100%; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table .spec-key { color: var(--text-muted); width: 40%; }

/* Kartu info pengiriman */
.ship-card {
    border-radius: 12px;
    padding: 18px;
    height: 100%;
}
.ship-card-icon { font-size: 26px; margin-bottom: 8px; line-height: 1; }
.ship-card.kirim   { background: var(--primary-soft); }
.ship-card.ongkir  { background: #F0FDF4; }
.ship-card.packing { background: var(--accent-soft); }
.ship-card.ongkir  h5 { color: #16A34A; }
.ship-card.packing h5 { color: #D97706; }

/* ===== REVIEWS ===== */
.review-section { padding: 32px 0 48px; }
.review-card-box {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
}
.review-summary {
    background: var(--primary-soft);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.review-score-big {
    text-align: center;
    min-width: 90px;
}
.review-score-big .num {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 48px;
    color: var(--primary);
    line-height: 1;
}
.review-score-big .out-of { font-size: 13px; color: #aaa; }
.review-score-big .stars  { font-size: 16px; color: #FFB800; }
.review-score-big .count  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.review-bars { flex: 1; min-width: 180px; }
.bar-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-muted); margin-bottom: 5px;
}
.bar-row .bar-track {
    flex: 1; height: 6px;
    background: #e5e7eb;
    border-radius: 99px; overflow: hidden;
}
.bar-row .bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width .6s ease;
}
.bar-row .bar-count { width: 28px; text-align: right; }

/* Review cards */
.review-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.review-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    color: var(--primary);
    flex-shrink: 0;
}
.review-name { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.review-date { font-size: 11px; color: #bbb; }
.review-stars { color: #FFB800; font-size: 13px; }
.review-text { font-size: 13px; color: #555; line-height: 1.7; margin-top: 8px; }
.review-img {
    width: 68px; height: 68px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    margin-top: 10px;
    cursor: pointer;
}

/* Tombol load more review */
.btn-load-more {
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50px;
    padding: 11px 32px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s;
}
.btn-load-more:hover { background: var(--primary-light); }
.btn-load-more .more-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Empty state ulasan */
.review-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}
.review-empty .empty-icon { font-size: 40px; margin-bottom: 10px; }
.review-empty h5 { color: var(--text-muted); font-weight: 600; }
.review-empty p { font-size: 13px; }

/* ===== RELATED PRODUCTS ===== */
.related-section {
    padding: 40px 0;
    background: var(--primary-soft);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gallery-wrap { position: static; }
    .product-title { font-size: 20px; }
    .price-main { font-size: 26px; }
    .detail-cta { flex-direction: column; }
    .review-summary { gap: 16px; }
}