/* Product detail (templates/product_page.html). Scoped to .pd-* ; colours follow design.md.
   Recommended-product cards reuse .shop-* from products_page.css */

.pd-page { color: #333; }
.pd-breadcrumb { padding: 14px 0 0; }
.pd-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 0; list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.pd-breadcrumb li { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.pd-breadcrumb li + li::before { content: "/"; margin: 0 .55rem; color: #9ca3af; }
.pd-breadcrumb a { color: #511616; text-decoration: none; font-weight: 500; }
.pd-breadcrumb a:hover { color: #0a0a0a; text-decoration: underline; }
.pd-breadcrumb .is-current span { color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }

.pd-main { padding: 20px 0 40px; }

/* gallery */
.pd-stage {
    position: relative; aspect-ratio: 4 / 3; max-height: 440px; width: 100%; background: #f8f9fa; border: 1px solid #e5e7eb; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pd-stage img, #pd-main-image { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pd-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 1px solid #e5e7eb; border-radius: 50%;
    background: rgba(255, 255, 255, .9); color: #0a0a0a; display: grid; place-items: center; cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.pd-arrow:hover { background: #FACC15; border-color: #FACC15; }
.pd-arrow:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }
.pd-arrow-prev { left: .6rem; }
.pd-arrow-next { right: .6rem; }
.pd-noimg { color: #c4c7cc; font-size: 3.5rem; }
.pd-badge {
    position: absolute; top: .9rem; left: .9rem; background: #511616; color: #fff;
    font-size: .8rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px;
}
.pd-thumbs { display: flex; gap: .6rem; margin: .8rem 0 0; padding: .2rem; overflow-x: auto; max-width: 100%; }
.pd-thumbs li { flex: 0 0 auto; }
.pd-thumb {
    width: 68px; height: 68px; padding: 0; border: 2px solid #e5e7eb; border-radius: 10px; background: #f8f9fa;
    overflow: hidden; cursor: pointer; transition: border-color .2s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pd-thumb:hover { border-color: #FACC15; }
.pd-thumb.is-active { border-color: #FACC15; box-shadow: 0 0 0 2px rgba(250, 204, 21, .35); }
.pd-thumb:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }

/* info */
.pd-info { display: flex; flex-direction: column; gap: 1.35rem; }
.pd-title { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.25; color: #511616; overflow-wrap: anywhere; }
.pd-short { font-size: 1rem; line-height: 1.7; color: #333; overflow-wrap: anywhere; }
.pd-short p:last-child { margin-bottom: 0; }

.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem; padding: .85rem 0; border-top: 1px solid #f0e2a0; border-bottom: 1px solid #f0e2a0; }
.pd-price-now { font-size: 2rem; font-weight: 700; color: #0a0a0a; line-height: 1.1; }
.pd-price-old { font-size: 1.05rem; color: #6b7280; }
.pd-save { background: #FFF6D6; color: #511616; font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }

.pd-stock { margin: 0; font-size: .92rem; color: #166534; }
.pd-stock.is-out { color: #b91c1c; }

.pd-buy { display: flex; flex-direction: column; gap: 1rem; margin: 0; }
.pd-qty-row { display: flex; align-items: center; gap: 1rem; }
.pd-label { margin: 0; font-weight: 600; font-size: .92rem; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid #d1d5db; border-radius: 999px; overflow: hidden; background: #fff; }
.qty-btn { width: 42px; height: 42px; border: 0; background: transparent; color: #0a0a0a; cursor: pointer; display: grid; place-items: center; transition: background-color .2s; }
.qty-btn:hover { background: #FFF6D6; }
.qty-btn:focus-visible { outline: 2px solid #FACC15; outline-offset: -2px; }
.qty-input { width: 54px; height: 42px; border: 0; text-align: center; font-weight: 600; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: 0; background: #FFFDF3; }

/* primary button: brand yellow, near-black text, #E6B800 hover (design.md) */
.pd-btn {
    display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: .85rem 1.25rem;
    background: #FACC15; color: #0a0a0a; border: 0; border-radius: 999px; font-weight: 600; font-size: 1.02rem;
    transition: background-color .2s;
}
.pd-btn:hover, .pd-btn:focus { background: #E6B800; color: #0a0a0a; }
.pd-btn:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; box-shadow: none; }
.pd-btn-disabled, .pd-btn-disabled:hover { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }

.pd-secondary { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.pd-secondary form { margin: 0; }
.pd-link-btn {
    display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .1rem; border: 0; background: transparent;
    color: #511616; font-weight: 600; font-size: .93rem; cursor: pointer;
}
.pd-link-btn:hover { color: #0a0a0a; text-decoration: underline; }
.pd-link-btn:focus-visible { outline: 2px solid #FACC15; outline-offset: 2px; }

/* description + related */
.pd-desc { padding: 36px 0 24px; }
.pd-desc h2, .pd-related h2 { font-size: 1.3rem; font-weight: 700; color: #511616; margin: 0 0 1rem; }
.pd-desc .container { border-top: 1px solid #e5e7eb; padding-top: 1.5rem; }
.pd-desc-body { line-height: 1.75; max-width: 820px; overflow-wrap: anywhere; }
.pd-desc-body img { max-width: 100%; height: auto; }
.pd-desc-body .text-align-left { text-align: left; }
.pd-desc-body .text-align-center { text-align: center; }
.pd-desc-body .text-align-right { text-align: right; }
.pd-desc-body .text-align-justify { text-align: justify; }
.pd-related { padding: 48px 0 80px; border-top: 1px solid #f0f0f0; margin-top: 24px; }

@media (max-width: 767.98px) {
    .pd-main { padding: 14px 0 24px; }
    .pd-stage { max-height: 340px; }
    .pd-arrow { width: 44px; height: 44px; }
    .pd-related { padding: 36px 0 56px; }
    .pd-price-now { font-size: 1.75rem; }
    .pd-thumb { width: 60px; height: 60px; }
}
@media (max-width: 575.98px) {
    .qty-btn, .qty-input { height: 46px; }
    .qty-btn { width: 46px; }
    .pd-btn { padding: .95rem 1.25rem; }
}


/* variant (package size) selector */
.pd-variants { display: flex; flex-direction: column; gap: .5rem; }
.pd-variant-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.pd-variant { position: relative; margin: 0; cursor: pointer; }
.pd-variant input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pd-variant span { display: inline-block; padding: .4rem .9rem; border: 1px solid #EAE6DA; border-radius: 999px; background: #FAF7EF; color: #242424; font-size: .88rem; font-weight: 500; transition: background-color .15s, border-color .15s; }
.pd-variant:hover span { border-color: #242424; }
.pd-variant input:checked + span { background: #F4C430; border-color: #F4C430; font-weight: 600; }
.pd-variant input:focus-visible + span { outline: 2px solid #242424; outline-offset: 2px; }
.pd-variant.is-unavailable span { color: #9a968c; text-decoration: line-through; }

/* coffee blend (Arabica / Robusta) */
.pd-blend { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.pd-blend-values { margin: 0; font-size: 1.05rem; color: #0a0a0a; }
.pd-blend-values strong { color: #511616; }
.pd-blend input[type="range"] { width: 100%; accent-color: #FACC15; cursor: pointer; }
.pd-blend-presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.pd-blend-preset {
    border: 1px solid #d1d5db; background: #fff; color: #333; border-radius: 999px; padding: .3rem .85rem; font-size: .85rem;
    cursor: pointer; transition: background-color .2s, border-color .2s;
}
.pd-blend-preset:hover { border-color: #FACC15; background: #FFF6D6; }
.pd-blend-hint { margin: 0; font-size: .85rem; color: #6b7280; }
.pd-blend-hint.is-error { color: #b91c1c; }
.pd-blend-hint[hidden] { display: none; }
