/* ===================================
   Ecooza — Product detail page (PDP)
   Gallery + summary, then detail, then related.
   Cards in the related rail come from style.css (.pcard).
   =================================== */

.pdp {
    --pdp-line: #e8eade;
    --pdp-muted: #6f7566;
    background: #fbfbf8;
    padding-bottom: 3.5rem;
}

.pdp-crumb {
    font-size: 0.76rem;
    color: var(--pdp-muted);
    padding: 0.9rem 0 1rem;
}

.pdp-crumb a { color: var(--color-primary-dark); }
.pdp-crumb a:hover { text-decoration: underline; }

/* --- Layout ------------------------------------------------------------ */

.pdp-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 1400px) {
    .pdp-top { grid-template-columns: minmax(0, 620px) minmax(0, 1fr); }
}

@media (max-width: 880px) {
    .pdp-top { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

/* --- Gallery ----------------------------------------------------------- */

.pdp-gallery { position: sticky; top: 90px; }

/* Rail left, stage right. Only applied when there is more than one image. */
.pdp-gallery--rail {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
}

@media (max-width: 880px) {
    .pdp-gallery { position: static; }
    /* Stacked on phones: stage first, rail scrolling horizontally beneath it. */
    .pdp-gallery--rail { grid-template-columns: minmax(0, 1fr); }
    .pdp-gallery--rail .pdp-stage { order: 1; }
    .pdp-gallery--rail .pdp-thumbs { order: 2; }
}

.pdp-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid var(--pdp-line);
    border-radius: 16px;
    overflow: hidden;
}

.pdp-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.25rem;
}

.pdp-stage__empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #bcc3b0;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pdp-stage__empty i { font-size: 2rem; }

.pdp-stage__flags {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: flex;
    gap: 0.35rem;
}

/* Vertical rail beside the stage; caps its height and scrolls if a vendor
   uploads a long gallery, so it never outgrows the main image. */
.pdp-thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: #d5dcc3 transparent;
}

.pdp-thumbs::-webkit-scrollbar { width: 4px; height: 4px; }
.pdp-thumbs::-webkit-scrollbar-thumb { background: #dde3ce; border-radius: 4px; }

.pdp-thumb {
    flex: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1.5px solid var(--pdp-line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb:hover { border-color: #c7d2a5; }
.pdp-thumb.is-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(144, 173, 68, 0.18);
}
.pdp-thumb:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

@media (max-width: 880px) {
    .pdp-thumbs {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        margin-top: 0.7rem;
        padding-bottom: 0.25rem;
    }
    .pdp-thumb { width: 66px; }
}

/* --- Summary ----------------------------------------------------------- */

.pdp-summary { min-width: 0; }

.pdp-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-primary-dark);
}

.pdp-eyebrow:hover { text-decoration: underline; }

.pdp-title {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0.4rem 0 0.55rem;
    color: var(--color-text-primary);
}

.pdp-lede {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #58604d;
    max-width: 62ch;
}

/* Key facts — the four things a B2B buyer checks before enquiring. */
.pdp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
    margin: 0 0 1.25rem;
}

.pdp-fact {
    background: #fff;
    border: 1px solid var(--pdp-line);
    border-radius: 11px;
    padding: 0.6rem 0.75rem;
}

.pdp-fact dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #8b9377;
    margin-bottom: 0.2rem;
}

.pdp-fact dt i { font-size: 0.68rem; color: #a8b287; }

.pdp-fact dd {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* --- Buy box ----------------------------------------------------------- */

.pdp-buy {
    background: linear-gradient(120deg, #f4f8e9, #eef4dc);
    border: 1px solid #e2ead0;
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.4rem;
}

.pdp-buy__note {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #55603f;
}

.pdp-buy__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pdp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.pdp-btn i { font-size: 0.8rem; }
.pdp-btn:active { transform: translateY(1px); }
.pdp-btn:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

.pdp-btn--primary {
    background: var(--color-text-primary);
    color: #fff;
    border: 1px solid var(--color-text-primary);
    flex: 1 1 220px;
}

.pdp-btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
    text-decoration: none;
}

.pdp-btn--ghost {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #d4dcb8;
    color: #4d5a26;
}

.pdp-btn--ghost:hover { background: #fff; border-color: var(--color-primary); text-decoration: none; }

.pdp-buy__trust {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    color: #6f7b56;
}

.pdp-buy__trust i { color: var(--color-primary-dark); margin-right: 0.25rem; }

/* --- Attribute pills --------------------------------------------------- */

.pdp-attrs {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pdp-line);
    margin-bottom: 1rem;
}

.pdp-attr__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b9377;
    margin-bottom: 0.4rem;
}

.pdp-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.pdp-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border: 1px solid var(--pdp-line);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    color: #4c5443;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pdp-pill:hover {
    border-color: var(--color-primary);
    background: #f7faee;
    color: var(--color-primary-dark);
    text-decoration: none;
}

.pdp-pill--cert i { font-size: 0.68rem; color: var(--color-primary); }

/* --- Detail sections --------------------------------------------------- */

.pdp-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

@media (max-width: 880px) {
    .pdp-detail { grid-template-columns: minmax(0, 1fr); }
}

.pdp-section {
    background: #fff;
    border: 1px solid var(--pdp-line);
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
}

.pdp-section h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin: 0 0 0.85rem;
    color: var(--color-text-primary);
}

.pdp-subhead {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    margin: 1.4rem 0 0.7rem;
    color: var(--color-text-primary);
}

.pdp-prose { color: #56604c; font-size: 0.9rem; line-height: 1.75; }
.pdp-prose p { margin: 0 0 0.85rem; }
.pdp-prose p:last-child { margin-bottom: 0; }

.pdp-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.5rem 1rem;
}

.pdp-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #4c5443;
}

.pdp-features i { color: var(--color-primary); font-size: 0.8rem; margin-top: 0.2rem; flex: none; }

.pdp-specs { margin: 0; }

.pdp-specs > div {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3ea;
}

.pdp-specs > div:last-child { border-bottom: 0; }

.pdp-specs dt { font-size: 0.82rem; color: #8b9377; }
.pdp-specs dd { margin: 0; font-size: 0.84rem; font-weight: 600; color: var(--color-text-primary); overflow-wrap: anywhere; }

/* --- Related ----------------------------------------------------------- */

.pdp-related { margin-top: 2.5rem; }

.pdp-related__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.pdp-related__head h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0;
    color: var(--color-text-primary);
}

.pdp-related__all {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

.pdp-related__all i { font-size: 0.7rem; transition: transform 0.15s ease; display: inline-block; }
.pdp-related__all:hover { text-decoration: none; }
.pdp-related__all:hover i { transform: translateX(3px); }
