/* [weave_product]: a product's page in the Apothecary design. Follows the
   host page's fonts and the same variables as the cards and the cart:
   --weave-accent, --weave-ink, --weave-surface, --weave-muted,
   --weave-radius, --weave-font, --weave-display-font. */

.weave-pdp {
    --_accent: var(--weave-accent, var(--weave-primary-color, #1f6f5c));
    --_ink: var(--weave-ink, #1b1b1b);
    --_surface: var(--weave-surface, #fff);
    --_muted: var(--weave-muted, #6b6b6b);
    --_radius: var(--weave-radius, 14px);
    --_line: color-mix(in srgb, var(--_ink) 14%, transparent);
    display: block;
    width: 100%; /* inline-size containment would let a flex parent shrink it to nothing */
    max-width: 100%;
    color: var(--_ink);
    font-family: var(--weave-font, inherit);
    container-type: inline-size;
}
.weave-pdp .weave-carousel { width: 100%; }
/* The plugin's own page template (templates/product.php) */
.weave-product-page__inner { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
/* Breakdance's fallback template puts page content in a Code Block that
   shrink-wraps its children (a column flex box aligned to the start);
   with inline-size containment that leaves no width. Stretch it. */
.bde-code-block:has(> .weave-pdp) { align-self: stretch; align-items: stretch; max-width: 100%; }
.weave-pdp *, .weave-pdp *::before, .weave-pdp *::after { box-sizing: border-box; }
.weave-pdp a { color: inherit; }

/* Breadcrumbs */
.weave-pdp__crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--_muted); }
.weave-pdp__crumbs li + li::before { content: '›'; margin-right: 8px; }
.weave-pdp__crumbs a { color: var(--_muted); text-decoration: none; }
.weave-pdp__crumbs a:hover { color: var(--_ink); text-decoration: underline; }
.weave-pdp__crumbs [aria-current] { color: var(--_ink); }

/* Layout */
.weave-pdp__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@container (min-width: 820px) {
    .weave-pdp__layout { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 48px; }
    .weave-pdp__media { position: sticky; top: 24px; }
}

/* Gallery */
.weave-pdp__photo {
    display: block; margin: 0; aspect-ratio: 1 / 1; overflow: hidden;
    border-radius: var(--_radius); background: color-mix(in srgb, var(--_ink) 6%, transparent);
}
.weave-pdp__photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.weave-pdp--sold-out .weave-pdp__photo img { opacity: 0.5; }
.weave-pdp__thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.weave-pdp__thumb {
    width: 72px; height: 72px; padding: 0; overflow: hidden; cursor: pointer;
    border: 1px solid var(--_line); border-radius: calc(var(--_radius) / 2); background: var(--_surface);
}
.weave-pdp__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.weave-pdp__thumb.is-current { border-color: var(--_ink); box-shadow: inset 0 0 0 1px var(--_ink); }
.weave-pdp__thumb:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }

/* Info */
.weave-pdp__info > * + * { margin-top: 16px; }
.weave-pdp__brand { margin: 0; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--_muted); }
.weave-pdp__brand-link { color: inherit; text-decoration: none; }
.weave-pdp__brand-link:hover, .weave-pdp__brand-link:focus-visible { color: var(--_accent); text-decoration: underline; }
.weave-pdp__brand + .weave-pdp__title { margin-top: 6px; }
.weave-pdp__title { margin: 0; font-family: var(--weave-display-font, inherit); font-weight: var(--weave-display-weight, 400); color: var(--weave-heading-color, inherit); font-size: 2rem; line-height: 1.15; }
.weave-pdp__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.weave-pdp__tags .weave-card__tag { background: color-mix(in srgb, var(--_ink) 6%, transparent); color: var(--_ink); text-decoration: none; }
.weave-pdp__tags .weave-card__tag--deal { background: var(--_accent); color: var(--_surface); }
.weave-pdp__offer { margin: 20px 0 0; padding: 16px 18px; border-radius: var(--_radius); background: color-mix(in srgb, var(--_accent) 8%, transparent); }
.weave-pdp__offer-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1rem; font-weight: 600; color: var(--_accent); }
.weave-pdp__offer-name { margin: 0; font-weight: 600; color: var(--_ink); }
.weave-pdp__offer-text { margin: 4px 0 0; font-size: 0.9rem; color: var(--_muted); }
.weave-pdp__tags .weave-card__tag--strain { background: color-mix(in srgb, var(--_accent) 12%, transparent); color: var(--_accent); }
.weave-pdp__price { margin: 0; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.weave-pdp__price .weave-card__was { font-size: 1.1rem; }
.weave-pdp__from { font-size: 1.25rem; }
.weave-pdp__label { display: block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--_muted); margin-bottom: 8px; }

/* Buy box */
.weave-pdp__buy { padding: 20px 0; border-top: 1px solid var(--_line); border-bottom: 1px solid var(--_line); }
.weave-pdp__buy > * + * { margin-top: 16px; }
.weave-pdp__gone { margin: 0; padding: 10px 14px; border-radius: calc(var(--_radius) / 2); background: color-mix(in srgb, var(--_ink) 6%, transparent); color: var(--_muted); font-size: 0.9rem; }
.weave-pdp__sizes { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.weave-pdp__sizes legend { padding: 0; margin-bottom: 8px; width: 100%; }
.weave-pdp__size {
    position: relative; display: inline-flex; align-items: baseline; gap: 8px; cursor: pointer;
    padding: 10px 14px; border: 1px solid var(--_line); border-radius: 999px; background: var(--_surface);
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.weave-pdp__size input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.weave-pdp__size:has(input:checked) { border-color: var(--_ink); background: var(--_ink); color: var(--_surface); }
.weave-pdp__size:has(input:focus-visible) { outline: 2px solid var(--_accent); outline-offset: 2px; }
.weave-pdp__size-price { font-variant-numeric: tabular-nums; opacity: 0.8; }
.weave-pdp__size--out { color: var(--_muted); border-style: dashed; }
.weave-pdp__size-out { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.weave-pdp__actions { display: flex; gap: 12px; align-items: stretch; }
.weave-pdp__qty { display: inline-flex; align-items: center; border: 1px solid var(--_ink); border-radius: 999px; overflow: hidden; flex: none; }
.weave-pdp__qty button { width: 42px; height: 46px; border: 0; background: none; color: inherit; font: inherit; font-size: 1.1rem; cursor: pointer; }
.weave-pdp__qty button:hover { background: color-mix(in srgb, var(--_ink) 8%, transparent); }
.weave-pdp__qty input { width: 44px; height: 46px; border: 0; background: none; color: inherit; font: inherit; text-align: center; -moz-appearance: textfield; }
.weave-pdp__qty input::-webkit-inner-spin-button, .weave-pdp__qty input::-webkit-outer-spin-button { -webkit-appearance: none; }
.weave-pdp__add {
    flex: 1; min-height: 46px; padding: 10px 24px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--_accent); background: var(--_accent); color: var(--_surface);
    font: inherit; font-weight: 600; line-height: 1.3; transition: background-color 0.2s, border-color 0.2s;
}
.weave-pdp__add:hover { background: var(--_ink); border-color: var(--_ink); }
.weave-pdp__add:disabled { background: color-mix(in srgb, var(--_ink) 10%, transparent); border-color: transparent; color: var(--_muted); cursor: not-allowed; }
.weave-pdp__add[data-weave-state="busy"] { opacity: 0.7; }
.weave-pdp__add[data-weave-state="added"] { background: var(--_ink); border-color: var(--_ink); }

/* Lab results */
.weave-pdp__potency { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.weave-pdp__potency > div { padding: 10px 14px; border-radius: calc(var(--_radius) / 2); background: color-mix(in srgb, var(--_ink) 5%, transparent); min-width: 88px; }
.weave-pdp__potency dt { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--_muted); }
.weave-pdp__potency dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.weave-pdp__terpenes { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.weave-pdp__terpenes .weave-pdp__label { margin: 0; width: 100%; }
.weave-pdp__terpene { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--_line); font-size: 0.8rem; }

/* Description */
.weave-pdp__desc p { margin: 0 0 1em; line-height: 1.65; }
.weave-pdp__desc p:last-child { margin-bottom: 0; }

/* Related */
.weave-pdp__related { margin-top: 56px; }

@media (max-width: 767px) {
    .weave-pdp__title { font-size: 1.6rem; }
    .weave-pdp__related { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .weave-pdp__size, .weave-pdp__add { transition: none; }
}
