/* =========================================================
   PRODUCT PAGE ONLY
   Kemaskan product detail, size dan related products tanpa
   ganggu index.php.
========================================================= */
.product-section {
    padding-top: 24px;
}
.product-wrap {
    align-items: start;
}
.gallery-main {
    background: #fff;
}
.gallery-canvas {
    background: #fff;
}
.main-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
}
.size-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}
.size-btn {
    min-height: 42px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
}
.related-section {
    padding: 0 0 60px;
}
.related-inner {
    width: min(1240px, calc(100% - 80px));
    margin: 0 auto;
}
.related-title {
    margin: 0 0 18px;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1;
    text-transform: uppercase;
}

/* Produk Lain: thumbnail/card 100% ikut product cards di index.php */
.related-grid.sp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.related-section .sp-card {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--white);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 16px 36px rgba(0,0,0,.055);
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
    overflow: hidden;
}
.related-section .sp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(0,0,0,.085);
}
.related-section .sp-card .sp-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
}
.related-section .sp-card .sp-heart {
    position: static;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    color: #111827;
}
.related-section .sp-card .sp-heart svg {
    width: 29px;
    height: 29px;
    stroke-width: 2.35;
}
.related-section .sp-card .sp-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    display: block;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #f4f6f8;
    box-shadow: none;
    overflow: hidden;
}
.related-section .sp-card .sp-product-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.related-section .sp-card .sp-image-empty {
    width: 100%;
    height: 100%;
    min-height: 132px;
    display: grid;
    place-items: center;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #667085;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}
.related-section .sp-card .sp-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 2px;
}
.related-section .sp-card .sp-info-text {
    min-width: 0;
}
.related-section .sp-card .sp-bottom {
    margin-top: 0;
    padding-top: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.related-section .sp-card .sp-cart {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
}
.related-section .sp-card .sp-cart svg {
    width: 19px;
    height: 19px;
}

/* FIX: pastikan text Produk Lain tidak naik/bertindih atas gambar */
.related-section .sp-card {
    position: relative !important;
    overflow: hidden !important;
}
.related-section .sp-card .sp-product-image {
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}
.related-section .sp-card .sp-product-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}
.related-section .sp-card .sp-name,
.related-section .sp-card .sp-info-row {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    background: #fff !important;
}
.related-section .sp-card .sp-name {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
}
.related-section .sp-card .sp-info-row {
    margin-top: 2px !important;
}

@media (max-width: 1080px) {
    .product-wrap {
        grid-template-columns: 1fr;
    }
    .related-inner {
        width: min(900px, calc(100% - 48px));
    }
}
@media (max-width: 820px) {
    .related-grid.sp-grid {
        grid-template-columns: 1fr;
    }
    .related-inner {
        width: min(100% - 28px, 520px);
    }
    .related-section .sp-card {
        min-height: 300px;
    }
    .related-section .sp-card .sp-product-image {
        margin-bottom: 12px;
    }
}

@media (max-width: 720px) {
    .gallery-main {
        min-height: 420px;
    }
    .size-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .personalization-grid,
    .cta-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .page-top-inner,
    .product-wrap {
        width: min(100% - 22px, 520px);
    }
    .related-inner {
        width: min(100% - 28px, 520px);
    }
    .gallery-main {
        min-height: 340px;
        border-radius: 18px;
    }
    .gallery-arrow {
        width: 40px;
        height: 40px;
    }
    .product-title {
        font-size: clamp(34px, 10vw, 48px);
    }
    .price {
        font-size: clamp(36px, 10vw, 52px);
    }
    .size-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .related-section .sp-card .sp-top {
        gap: 8px;
    }
    .related-section .sp-card .sp-heart {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-basis: 44px;
    }
    .related-section .sp-card .sp-heart svg {
        width: 25px;
        height: 25px;
    }
    .related-section .sp-card .sp-info-row {
        gap: 10px;
    }
}


/* 20260627g: samakan Produk Lain dengan overlay dalam gambar */
.related-section .sp-card {
    overflow: visible !important;
}
.related-section .sp-card .sp-product-image {
    position: relative !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
.related-section .sp-card .sp-product-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.related-section .sp-card .sp-top.sp-top-overlay {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    z-index: 4 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin: 0 !important;
    pointer-events: none;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-badge,
.related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
    pointer-events: auto;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    flex-basis: 42px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.96) !important;
    color: #111827 !important;
    box-shadow: 0 8px 20px rgba(16,24,40,.12) !important;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-heart svg {
    width: 24px !important;
    height: 24px !important;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-badge {
    box-shadow: 0 8px 20px rgba(16,24,40,.12) !important;
}
@media (max-width: 560px) {
    .related-section .sp-card .sp-top.sp-top-overlay {
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
    }
    .related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        flex-basis: 38px !important;
    }
    .related-section .sp-card .sp-top.sp-top-overlay .sp-heart svg {
        width: 22px !important;
        height: 22px !important;
    }
}


/* 20260627i: fix badge text + buang shadow heart/label untuk Produk Lain */
.related-section .sp-card .sp-top.sp-top-overlay .sp-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: fit-content !important;
    max-width: calc(100% - 54px) !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #ffffff !important;
    box-shadow: none !important;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-badge.yellow {
    color: #111827 !important;
}
.related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
    box-shadow: none !important;
}


/* 20260627j: heart Produk Lain ada shadow ringan sahaja */
.related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
    box-shadow: 0 2px 8px rgba(16,24,40,.10) !important;
}


/* 20260627k: main product image 1:1 tepat, elak nampak tercrop bawah */
.gallery-main {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
}
.gallery-canvas {
    inset: 0 !important;
    padding: 0 !important;
}
.main-product-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}
@media (max-width: 720px) {
    .gallery-main {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: 0 !important;
    }
}
@media (max-width: 560px) {
    .gallery-main {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: 0 !important;
        border-radius: 18px !important;
    }
}


/* 20260627l: heart overlay untuk main thumbnails product gallery */
.thumb-btn {
    position: relative;
}
.thumb-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    color: #111827;
    box-shadow: 0 2px 8px rgba(16,24,40,.10);
    pointer-events: none;
}
.thumb-heart svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.1;
}
@media (max-width: 560px) {
    .thumb-heart {
        top: 6px;
        right: 6px;
        width: 27px;
        height: 27px;
    }
    .thumb-heart svg {
        width: 15px;
        height: 15px;
    }
}


/* 20260627m: heart hanya pada main image besar product.php */
.gallery-heart {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    color: #111827;
    box-shadow: 0 2px 8px rgba(16,24,40,.10);
    pointer-events: none;
}
.gallery-heart svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.2;
}
@media (max-width: 560px) {
    .gallery-heart {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }
    .gallery-heart svg {
        width: 22px;
        height: 22px;
    }
}


/* 20260627n: dummy quantity berbeza untuk setiap size */
.size-btn {
    min-height: 56px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 8px 6px !important;
    line-height: 1.05 !important;
}
.size-code {
    display: block;
    font-size: 15px;
    font-weight: 900;
}
.size-qty {
    display: block;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}
.size-btn.active .size-qty {
    color: rgba(255,255,255,.82);
}
@media (max-width: 560px) {
    .size-btn {
        min-height: 54px !important;
        padding: 7px 4px !important;
    }
    .size-code {
        font-size: 14px;
    }
    .size-qty {
        font-size: 9px;
    }
}

/* 20260627o: compact size + kuantiti logic */
.size-stock-block {
    margin-bottom: 18px !important;
}
.size-stock-block .section-head,
.qty-stock-block .section-head {
    margin-bottom: 9px !important;
}
.size-grid {
    gap: 8px !important;
}
.size-btn {
    min-height: 50px !important;
    padding: 7px 5px !important;
    border-radius: 10px !important;
    line-height: 1.05 !important;
}
.size-btn:not(.sold-out):hover {
    border-color: var(--blue) !important;
    transform: translateY(-1px);
}
.size-btn.sold-out {
    cursor: not-allowed !important;
    background: #f2f4f7 !important;
    color: #98a2b3 !important;
    border-color: #e4e7ec !important;
    opacity: 1 !important;
}
.size-btn.sold-out .size-qty {
    color: #b42318 !important;
}
.size-stock-summary {
    margin: 9px 0 0 !important;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}
.qty-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.qty-note {
    margin: 0;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}
.qty-btn:disabled {
    cursor: not-allowed;
    opacity: .42;
    background: #f2f4f7;
}
.btn-cart.is-disabled,
.btn-buy.is-disabled {
    pointer-events: none;
    opacity: .48;
    filter: grayscale(.25);
}
.personal-card.active {
    border-color: var(--blue);
    background: #eef4ff;
    color: var(--blue);
}
@media (max-width: 560px) {
    .size-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    .size-stock-summary {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .qty-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}


/* 20260627n: compact size quantity text */
.size-stock-summary,
.qty-note {
    display: none !important;
}
.qty-stock-block .section-head .sub-link {
    font-weight: 800 !important;
    color: var(--blue) !important;
}


/* 20260627q: Max qty letak sebelah button + */
.qty-stock-block .section-head {
    margin-bottom: 9px !important;
}
.qty-stock-block .section-head .sub-link {
    display: none !important;
}
.qty-line {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}
.qty-max-text {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 38px;
    color: #667085 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}
@media (max-width: 560px) {
    .qty-line {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
    }
    .qty-max-text {
        min-height: 36px;
        font-size: 11px !important;
    }
}


/* 20260627r: product page width disamakan dengan product section index.php */
.page-top-inner,
.product-wrap,
.related-inner {
    width: min(1240px, calc(100% - 80px)) !important;
}
@media (max-width: 1080px) {
    .page-top-inner,
    .product-wrap,
    .related-inner {
        width: min(900px, calc(100% - 48px)) !important;
    }
}
@media (max-width: 560px) {
    .page-top-inner,
    .product-wrap,
    .related-inner {
        width: min(100% - 28px, 520px) !important;
    }
}


/* 20260627o: product page content width 100% sama dengan index product section */
.page-top-inner,
.product-wrap,
.related-inner {
    width: min(1240px, calc(100% - 80px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
@media (max-width: 1180px) {
    .page-top-inner,
    .product-wrap,
    .related-inner {
        width: min(900px, calc(100% - 48px)) !important;
    }
}
@media (max-width: 820px) {
    .page-top-inner,
    .product-wrap,
    .related-inner {
        width: min(100% - 28px, 520px) !important;
    }
}


/* 20260627w: samakan Produk Lain mobile dengan thumbnail lain */
@media (max-width: 560px) {
    .related-section .sp-card .sp-top.sp-top-overlay {
        top: 7px !important;
        left: 7px !important;
        right: 7px !important;
        gap: 7px !important;
    }
    .related-section .sp-card .sp-top.sp-top-overlay .sp-badge {
        min-height: 20px !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
        font-size: 9px !important;
        line-height: 1 !important;
    }
    .related-section .sp-card .sp-top.sp-top-overlay .sp-heart {
        width: 31px !important;
        height: 31px !important;
        min-width: 31px !important;
        min-height: 31px !important;
        flex-basis: 31px !important;
    }
    .related-section .sp-card .sp-top.sp-top-overlay .sp-heart svg {
        width: 17px !important;
        height: 17px !important;
        stroke-width: 2.2 !important;
    }
}


/* 20260627y: auto resize main product label + heart di mobile */
@media (max-width: 720px) {
    .gallery-badge {
        top: 12px !important;
        left: 12px !important;
        min-height: 24px !important;
        padding: 4px 9px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
        line-height: 1 !important;
        letter-spacing: .02em !important;
    }
    .gallery-heart {
        top: 12px !important;
        right: 12px !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }
    .gallery-heart svg {
        width: 19px !important;
        height: 19px !important;
    }
}
@media (max-width: 560px) {
    .gallery-badge {
        top: 10px !important;
        left: 10px !important;
        min-height: 20px !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
        font-size: 9px !important;
        line-height: 1 !important;
    }
    .gallery-heart {
        top: 10px !important;
        right: 10px !important;
        width: 31px !important;
        height: 31px !important;
        min-width: 31px !important;
        min-height: 31px !important;
    }
    .gallery-heart svg {
        width: 17px !important;
        height: 17px !important;
        stroke-width: 2.2 !important;
    }
}


/* 20260627aa: buang heart + label/badge main product dan Produk Lain */
.gallery-badge,
.gallery-heart,
.related-section .sp-top.sp-top-overlay,
.related-section .sp-top.sp-top-overlay .sp-badge,
.related-section .sp-top.sp-top-overlay .sp-heart {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 20260627ac: Produk Lain compact ikut size card index.php */
.related-inner {
    display: grid !important;
    grid-template-columns: 300px minmax(0, 1fr) !important;
    gap: 56px !important;
    align-items: start !important;
}
.related-title {
    max-width: 300px !important;
    margin: 0 !important;
    font-size: clamp(46px, 4vw, 62px) !important;
    line-height: .98 !important;
}
.related-grid.sp-grid {
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
}
.related-section .sp-card {
    min-height: 340px !important;
    padding: 14px 14px 16px !important;
}
.related-section .sp-card .sp-product-image {
    aspect-ratio: 1 / 1 !important;
    margin-bottom: 14px !important;
}
@media (max-width: 1180px) {
    .related-inner {
        display: block !important;
        width: min(900px, calc(100% - 48px)) !important;
    }
    .related-title {
        max-width: none !important;
        margin: 0 0 18px !important;
    }
    .related-grid.sp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 820px) {
    .related-inner {
        width: min(100% - 28px, 520px) !important;
    }
    .related-grid.sp-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 560px) {
    .related-section .sp-card {
        min-height: 300px !important;
    }
    .related-section .sp-card .sp-product-image {
        margin-bottom: 12px !important;
    }
}


/* 20260627ad: Produk Lain title kecil di atas, gambar/card di bawah */
.related-inner {
    display: block !important;
    width: min(1240px, calc(100% - 80px)) !important;
    margin: 0 auto !important;
}
.related-title {
    display: block !important;
    max-width: none !important;
    margin: 0 0 14px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    color: #111827 !important;
}
.related-grid.sp-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
}
.related-section .sp-card {
    min-height: 0 !important;
    padding: 14px 14px 16px !important;
}
.related-section .sp-card .sp-product-image {
    aspect-ratio: 1 / 1 !important;
    margin-bottom: 14px !important;
}
@media (max-width: 1180px) {
    .related-inner {
        width: min(900px, calc(100% - 48px)) !important;
    }
    .related-title {
        margin-bottom: 14px !important;
        font-size: 15px !important;
    }
    .related-grid.sp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 18px !important;
    }
}
@media (max-width: 820px) {
    .related-inner {
        width: min(100% - 28px, 520px) !important;
    }
    .related-grid.sp-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 560px) {
    .related-title {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }
    .related-section .sp-card .sp-product-image {
        margin-bottom: 12px !important;
    }
}
