/* ============================================================
   details.css — Product detail page
   ============================================================ */

.details-section { background: var(--bg-page); }

/* ── Media Box (Image + Video Swiper) ── */
.detail-media-box {
    position: relative;
}

.detail-swiper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    aspect-ratio: 1/1;
}

/* Image slide */
.detail-slide-img {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    height: 100%;
}
.detail-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.detail-slide-img img:hover { transform: scale(1.05); }

.detail-disc-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(232,35,42,.4);
}

/* Video slide */
.detail-slide-video {
    position: relative;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .7;
    transition: opacity .3s;
}
.detail-video-thumb:hover .video-thumb-img { opacity: .5; }
.video-play-btn {
    position: absolute;
    font-size: 4.5rem;
    color: #fff;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.6));
    transition: transform .25s ease;
    pointer-events: none;
}
.detail-video-thumb:hover .video-play-btn { transform: scale(1.1); }
.video-slide-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    padding: 20px 14px 10px;
    pointer-events: none;
}

/* Active iframe (replaces thumb) */
.detail-slide-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 2;
}

/* Swiper nav overrides */
.detail-next, .detail-prev {
    width: 38px !important;
    height: 38px !important;
    background: rgba(0,0,0,.4) !important;
    backdrop-filter: blur(4px);
    border-radius: 50% !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    transition: var(--transition) !important;
}
.detail-next:hover, .detail-prev:hover { background: var(--primary) !important; }
.detail-next::after, .detail-prev::after { display: none !important; }
.detail-next i, .detail-prev i { font-size: 1rem; }
.detail-pagination { bottom: 10px !important; }
.detail-pagination .swiper-pagination-bullet { background: rgba(255,255,255,.6) !important; }
.detail-pagination .swiper-pagination-bullet-active {
    background: var(--primary) !important;
    width: 20px !important;
    border-radius: 4px !important;
}

/* Thumbnails row */
.detail-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}
.detail-thumb {
    position: relative;
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    border: 2.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: #f0f0f0;
}
.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-thumb:hover { border-color: var(--primary); }
.detail-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(232,35,42,.25); }
.thumb-label-vid, .thumb-label-img {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: .7rem;
    color: #fff;
    background: rgba(0,0,0,.5);
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.4;
}
.thumb-label-vid { background: rgba(232,35,42,.8); }

/* ── Product Info ── */
.detail-info { padding: 4px 0; }
.detail-product-name {
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 12px;
}
.detail-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.detail-rating-row .stars { color: var(--accent); font-size: .9rem; }
.detail-rating-num { font-weight: 700; color: var(--text-main); font-size: .9rem; }
.detail-rating-count { color: var(--text-muted); font-size: .82rem; }
.detail-stock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
}
.detail-stock.in-stock { background: rgba(16,185,129,.1); color: #10b981; border: 1px solid rgba(16,185,129,.2); }
.detail-stock.out-stock { background: rgba(239,68,68,.1); color: #ef4444; border: 1px solid rgba(239,68,68,.2); }

.detail-price-box {
    background: linear-gradient(135deg, rgba(232,35,42,.05), rgba(232,35,42,.02));
    border: 1px solid rgba(232,35,42,.12);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 18px;
}
.detail-offer-price { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 6px; }
.detail-price-row { display: flex; align-items: center; gap: 10px; }
.detail-regular-price { font-size: .95rem; color: var(--text-muted); text-decoration: line-through; }
.detail-save-badge {
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.2);
    color: #10b981;
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

/* Qty */
.detail-qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.detail-label { font-weight: 600; font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.qty-control { display: flex; align-items: center; background: var(--bg-light); border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-btn {
    width: 40px; height: 40px;
    background: none; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--text-main); transition: var(--transition);
    border: none; cursor: pointer;
}
.qty-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-input {
    width: 48px; text-align: center; border: none; background: none;
    font-size: .95rem; font-weight: 700; color: var(--text-main); font-family: var(--font);
}
.qty-input:focus { outline: none; }

/* Order Button */
.btn-order-now {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border-radius: 12px; padding: 14px;
    font-size: 1rem; font-weight: 700; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(232,35,42,.35);
    margin-bottom: 14px;
    font-family: var(--font);
}
.btn-order-now:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(232,35,42,.5); }
.btn-order-now:active { transform: scale(.98); }

/* Desc Collapse */
.btn-toggle-desc {
    width: 100%; background: var(--bg-card); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 12px 16px; font-size: .88rem; font-weight: 600;
    color: var(--text-main); display: flex; align-items: center; gap: 8px;
    transition: var(--transition); cursor: pointer; font-family: var(--font);
}
.btn-toggle-desc:hover { border-color: var(--primary); color: var(--primary); }
.btn-toggle-desc i:first-child { color: var(--primary); font-size: 1rem; }
.toggle-icon { transition: transform .3s ease; }
.toggle-icon.rotated { transform: rotate(180deg); }
.desc-collapse { overflow: hidden; max-height: 0; transition: max-height .4s ease; }
.desc-collapse.open { max-height: 600px; }
.desc-content {
    background: var(--bg-card); border: 1.5px solid var(--border); border-top: none;
    border-radius: 0 0 10px 10px; padding: 16px;
    font-size: .88rem; color: var(--text-muted); line-height: 1.7;
}
.desc-content ul { padding-left: 18px; margin-top: 8px; }
.desc-content ul li { margin-bottom: 4px; }
.btn-close-desc {
    margin-top: 12px; background: var(--bg-light); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 14px; font-size: .8rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 6px; transition: var(--transition);
    cursor: pointer; font-family: var(--font);
}
.btn-close-desc:hover { color: var(--primary); border-color: var(--primary); }

/* ── Delivery Charge Preview ── */
.delivery-charge-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    border: 1.5px solid;
    transition: var(--transition);
}
.delivery-charge-preview.ctg {
    background: rgba(16,185,129,.08);
    border-color: rgba(16,185,129,.25);
    color: #059669;
}
.delivery-charge-preview.outside {
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.25);
    color: #d97706;
}

/* ── Ratings ── */
.ratings-section { background: var(--bg-page); }
.rating-summary-box {
    background: var(--bg-card); border-radius: var(--radius-md); padding: 30px; text-align: center;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border); height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.rating-big-num { font-size: 3.5rem; font-weight: 700; color: var(--primary); line-height: 1; }
.rating-total-count { font-size: .82rem; color: var(--text-muted); }

.add-rating-box {
    background: var(--bg-card); border-radius: var(--radius-md); padding: 24px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.add-rating-title { font-size: .95rem; font-weight: 700; color: var(--text-main); margin-bottom: 16px; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

.star-rating-input { display: flex; flex-direction: row-reverse; gap: 4px; justify-content: flex-end; }
.star-rating-input input { display: none; }
.star-rating-input label { cursor: pointer; color: var(--border); font-size: 1.5rem; transition: var(--transition); }
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label { color: var(--accent); }

.ratings-list { display: flex; flex-direction: column; gap: 12px; }
.rating-item { background: var(--bg-light); border-radius: 10px; padding: 14px; border: 1px solid var(--border); }
.rating-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rater-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .88rem; flex-shrink: 0;
}
.rater-name { font-size: .85rem; font-weight: 600; color: var(--text-main); }
.rater-date { font-size: .72rem; color: var(--text-light); white-space: nowrap; }
.rater-review { font-size: .82rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* ── Checkout Modal ── */
.checkout-product-preview {
    display: flex; align-items: center; gap: 14px; padding: 14px;
    background: var(--bg-light); border-radius: var(--radius-sm); margin-bottom: 16px;
}
.checkout-product-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.checkout-pname { font-size: .88rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.checkout-qty-label { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

.checkout-price-table {
    background: var(--bg-light); border-radius: var(--radius-sm); overflow: hidden;
    margin-bottom: 16px; border: 1px solid var(--border);
}
.ck-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; font-size: .85rem; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.ck-row:last-child { border-bottom: none; }
.ck-row span:last-child { font-weight: 600; color: var(--text-main); }
.ck-total { background: linear-gradient(135deg, rgba(232,35,42,.06), rgba(232,35,42,.02)); font-size: .92rem !important; }
.ck-total span { color: var(--primary) !important; font-size: 1.05rem !important; }

.payment-method-box {
    display: flex; align-items: center; gap: 12px;
    background: rgba(16,185,129,.05); border: 1.5px solid rgba(16,185,129,.2);
    border-radius: 10px; padding: 12px 16px;
}
.payment-method-box > i:first-child { font-size: 1.4rem; color: #10b981; }
.pm-title { font-size: .88rem; font-weight: 700; color: var(--text-main); }
.pm-desc { font-size: .75rem; color: var(--text-muted); }
.pm-check { color: #10b981; font-size: 1.2rem; margin-left: auto; }

.btn-confirm-order {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff; border-radius: 8px; padding: 9px 20px;
    font-size: .88rem; font-weight: 700; transition: var(--transition);
    box-shadow: 0 4px 14px rgba(16,185,129,.3);
    border: none; cursor: pointer; font-family: var(--font);
}
.btn-confirm-order:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,.45); }

/* ── Success Modal ── */
.success-anim { margin-bottom: 16px; }
.success-circle {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto; animation: successPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes successPop { from { transform: scale(0) } to { transform: scale(1) } }
.success-circle i { font-size: 2.2rem; color: #fff; }
.success-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.success-msg { font-size: .82rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.success-order-num {
    background: var(--bg-light); border-radius: 8px; padding: 8px 16px;
    font-size: .82rem; font-weight: 700; color: var(--primary); display: inline-block;
}

/* ── Mobile ── */
@media(max-width:767px) {
    .detail-offer-price { font-size: 1.6rem; }
    .rating-summary-box { padding: 20px; }
    .detail-thumb { width: 56px; height: 56px; }
    .detail-media-box { max-width: 420px; margin: 0 auto; }
}