/* ==========================================================================
   Blessing Your Scalp — Product Details Page
   External stylesheet for /shop/product/{slug}
   ========================================================================== */

/* ─── Design tokens ──────────────────────────────────────────────────────── */
.bys-pdp {
    --rose:        #be6d76;
    --rose-deep:   #a85961;
    --rose-rgb:    190, 109, 118;
    --cream:       #fbf4f0;
    --blush:       #f5e6e0;
    --white:       #ffffff;
    --charcoal:    #35312f;
    --espresso:    #302c2a;
    --stone:       #8a8582;
    --divider:     #e3e3e3;
    --shadow-card: 0 5px 20px rgba(0,0,0,0.09);
    --shadow-btn:  0 4px 15px rgba(190,109,118,0.30);
    font-family: 'Jost', sans-serif;
    color: var(--charcoal);
    padding-bottom: 80px;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.bys-pdp__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--stone);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.bys-pdp__breadcrumb a {
    color: var(--charcoal);
    text-decoration: none;
    transition: color 0.18s;
}
.bys-pdp__breadcrumb a:hover { color: var(--rose); }
.bys-pdp__breadcrumb span { color: var(--rose); }
.bys-pdp__breadcrumb svg { color: var(--stone); flex-shrink: 0; }

/* ─── Two-col layout ─────────────────────────────────────────────────────── */
.bys-pdp__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
@media (max-width: 991px) {
    .bys-pdp__layout { grid-template-columns: 1fr; gap: 36px; }
}

/* ─── Gallery ────────────────────────────────────────────────────────────── */
.bys-gallery {
    position: sticky;
    top: 96px;
}

/* Main image */
.bys-gallery__main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--cream);
    aspect-ratio: 3 / 4;
    margin-bottom: 14px;
}
.bys-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    cursor: zoom-in;
}
.bys-gallery__main:hover .bys-gallery__main-img { transform: scale(1.04); }

/* Zoom overlay hint */
.bys-gallery__zoom-hint {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255,255,255,0.88);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.bys-gallery__main:hover .bys-gallery__zoom-hint { opacity: 1; }

/* Nav arrows on main image */
.bys-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.88);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: var(--charcoal);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.18s, color 0.18s;
}
.bys-gallery__arrow:hover { background: var(--charcoal); color: white; }
.bys-gallery__arrow--prev { left: 12px; }
.bys-gallery__arrow--next { right: 12px; }

/* Badge overlay on image */
.bys-gallery__badges {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
}
.bys-gallery__badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.bys-gallery__badge--new  { background: var(--charcoal); color: white; }
.bys-gallery__badge--sale { background: var(--rose); color: white; }

/* Thumbnail strip */
.bys-gallery__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.bys-gallery__thumbs::-webkit-scrollbar { display: none; }

.bys-gallery__thumb {
    flex-shrink: 0;
    width: 74px;
    height: 74px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.18s;
    background: var(--cream);
}
.bys-gallery__thumb.is-active { border-color: var(--rose); }
.bys-gallery__thumb:hover { border-color: var(--charcoal); }
.bys-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Product info column ────────────────────────────────────────────────── */
.bys-pdp__info { /* styles applied via children */ }

/* Category eyebrow */
.bys-pdp__category {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rose);
    margin: 0 0 10px;
}

/* Product name */
.bys-pdp__name {
    font-family: 'Jost', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 400;
    color: var(--charcoal);
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}

/* Divider */
.bys-pdp__divider {
    height: 1px;
    background: var(--divider);
    margin: 22px 0;
}

/* Price block */
.bys-pdp__price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
}
.bys-pdp__price-current {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1;
}
.bys-pdp__price-old {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--stone);
    text-decoration: line-through;
}
.bys-pdp__price-sale {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--rose);
    line-height: 1;
}
.bys-pdp__discount-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(var(--rose-rgb), 0.1);
    color: var(--rose);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    align-self: center;
}

/* Short description */
.bys-pdp__desc {
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--stone);
    margin: 0 0 24px;
}

/* ─── Variant selectors ──────────────────────────────────────────────────── */
.bys-pdp__option-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--charcoal);
    margin-bottom: 12px;
    display: block;
}
.bys-pdp__option-label span {
    font-weight: 400;
    text-transform: none;
    color: var(--stone);
    letter-spacing: 0;
}
.bys-pdp__option-group { margin-bottom: 20px; }

/* Colour select (replaces the old circular swatches) */
.bys-pdp__select {
    width: 100%;
    max-width: 320px;
    height: 44px;
    padding: 0 40px 0 14px;
    border: 1.5px solid var(--divider);
    border-radius: 6px;
    background-color: var(--white);
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.18s;
    outline: none;
    /* Native arrow varies per platform - draw our own for a consistent look. */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23333' stroke-width='1.8' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.bys-pdp__select:hover { border-color: var(--charcoal); }
.bys-pdp__select:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}

/* Length/size swatches */
.bys-size-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.bys-size-swatch {
    height: 38px;
    padding: 0 16px;
    border: 1.5px solid var(--divider);
    border-radius: 6px;
    background: var(--white);
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
    outline: none;
}
.bys-size-swatch:hover { border-color: var(--charcoal); }
.bys-size-swatch.is-active {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: white;
    font-weight: 600;
}
.bys-size-swatch:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ─── Stock status ───────────────────────────────────────────────────────── */
.bys-stock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}
.bys-stock__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bys-stock--in {
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
}
.bys-stock--in .bys-stock__dot { background: #22c55e; }
.bys-stock--low {
    background: rgba(234, 179, 8, 0.1);
    color: #a16207;
}
.bys-stock--low .bys-stock__dot { background: #eab308; }
.bys-stock--out {
    background: rgba(190, 109, 118, 0.1);
    color: var(--rose-deep);
}
.bys-stock--out .bys-stock__dot { background: var(--rose); }

/* ─── Qty + ATC ──────────────────────────────────────────────────────────── */
.bys-pdp__atc-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}

/* Qty control */
.bys-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--divider);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    flex-shrink: 0;
}
.bys-qty__btn {
    width: 40px;
    height: 50px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    outline: none;
}
.bys-qty__btn:hover { background: var(--blush); color: var(--rose); }
.bys-qty__btn:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; }
.bys-qty__input {
    width: 48px;
    height: 50px;
    border: none;
    border-left: 1.5px solid var(--divider);
    border-right: 1.5px solid var(--divider);
    text-align: center;
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
    background: var(--white);
    outline: none;
    -moz-appearance: textfield;
}
.bys-qty__input::-webkit-inner-spin-button,
.bys-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ATC button */
.bys-pdp__atc-btn {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--rose);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Jost', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.bys-pdp__atc-btn:hover:not(:disabled) {
    background: var(--rose-deep);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--rose-rgb), 0.38);
}
.bys-pdp__atc-btn:disabled {
    background: var(--stone);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Loading row inside a button.
   Deliberately sets no `display`: Livewire shows/hides wire:loading elements by
   writing element.style.display, and an inline display value would already
   occupy that slot at page load - leaving "Adding..." visible before any click.
   Alignment comes from the class, visibility stays Livewire's to control. */
.bys-btn-loading {
    align-items: center;
    gap: 8px;
}

/* Spinner */
.bys-spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: bys-spin 0.65s linear infinite;
    display: inline-block;
}
@keyframes bys-spin { to { transform: rotate(360deg); } }

/* ─── Flash messages ─────────────────────────────────────────────────────── */
.bys-pdp__flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
    animation: bys-fade-in 0.22s ease;
}
.bys-pdp__flash--success {
    background: rgba(34, 197, 94, 0.08);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.22);
}
.bys-pdp__flash--error {
    background: rgba(190, 109, 118, 0.08);
    color: var(--rose-deep);
    border: 1px solid rgba(190, 109, 118, 0.22);
}
@keyframes bys-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Trust icons strip ──────────────────────────────────────────────────── */
.bys-pdp__trust {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--divider);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}
.bys-pdp__trust-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    background: var(--cream);
    text-align: center;
    border-right: 1.5px solid var(--divider);
}
.bys-pdp__trust-item:last-child { border-right: none; }
.bys-pdp__trust-item svg { color: var(--rose); }
.bys-pdp__trust-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--charcoal);
    line-height: 1.3;
}

/* ─── Product meta ───────────────────────────────────────────────────────── */
.bys-pdp__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bys-pdp__meta-row {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.bys-pdp__meta-label {
    font-weight: 600;
    color: var(--charcoal);
    min-width: 120px;
    flex-shrink: 0;
}
.bys-pdp__meta-value { color: var(--stone); }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.bys-pdp__tabs { margin-top: 64px; }

.bys-tab-nav {
    display: flex;
    border-bottom: 1.5px solid var(--divider);
    margin-bottom: 32px;
    gap: 0;
}
.bys-tab-btn {
    padding: 12px 28px;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    font-family: 'Jost', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
    outline: none;
}
.bys-tab-btn:hover { color: var(--charcoal); }
.bys-tab-btn.is-active {
    color: var(--charcoal);
    border-bottom-color: var(--rose);
}
.bys-tab-btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.bys-tab-content {
    font-size: 0.96rem;
    line-height: 1.8;
    color: var(--stone);
    max-width: 70ch;
}
.bys-tab-content p { margin-bottom: 1em; }

/* Additional info table */
.bys-info-table {
    width: 100%;
    border-collapse: collapse;
}
.bys-info-table tr + tr td,
.bys-info-table tr + tr th { border-top: 1px solid var(--divider); }
.bys-info-table th,
.bys-info-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
}
.bys-info-table th {
    font-weight: 600;
    color: var(--charcoal);
    background: var(--cream);
    width: 180px;
}
.bys-info-table td { color: var(--stone); }
.bys-info-table tr:first-child th { border-radius: 8px 0 0 0; }
.bys-info-table tr:last-child  th { border-radius: 0 0 0 8px; }

/* ─── Related products ───────────────────────────────────────────────────── */
.bys-pdp__related { margin-top: 64px; }

.bys-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.bys-section-title {
    font-family: 'Jost', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 400;
    color: var(--charcoal);
    margin: 0;
    letter-spacing: -0.01em;
}
.bys-section-title em {
    font-family: 'Parisienne', cursive;
    font-style: normal;
    color: var(--rose);
    font-size: 1.1em;
}
.bys-section-link {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--charcoal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.18s;
}
.bys-section-link:hover { color: var(--rose); }

/* Related product cards grid */
.bys-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 1200px) { .bys-related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .bys-related-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 400px)  { .bys-related-grid { grid-template-columns: 1fr; } }

/* Related card (self-contained, no bys-shop wrapper needed) */
.bys-rel-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.bys-rel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
}
.bys-rel-card__img-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--cream);
    overflow: hidden;
}
.bys-rel-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
.bys-rel-card:hover .bys-rel-card__img { transform: scale(1.06); }
.bys-rel-card__img-alt {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.bys-rel-card:hover .bys-rel-card__img-alt { opacity: 1; }

.bys-rel-card__badge {
    position: absolute;
    top: 10px; left: 10px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--rose);
    color: white;
}

.bys-rel-card__info {
    padding: 14px 16px 18px;
}
.bys-rel-card__cat {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rose);
    margin: 0 0 5px;
}
.bys-rel-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
    margin: 0 0 8px;
    line-height: 1.35;
}
.bys-rel-card__name a { color: inherit; text-decoration: none; }
.bys-rel-card__name a:hover { color: var(--rose); }
.bys-rel-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.bys-rel-card__price-current { font-size: 0.98rem; font-weight: 700; color: var(--charcoal); }
.bys-rel-card__price-old     { font-size: 0.85rem; font-weight: 400; color: var(--stone); text-decoration: line-through; }
.bys-rel-card__price-sale    { font-size: 0.98rem; font-weight: 700; color: var(--rose); }

/* ─── Accessibility ──────────────────────────────────────────────────────── */
.bys-pdp *:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}

/* ==========================================================================
   Stock feedback
   --------------------------------------------------------------------------
   The refusal is reported at the quantity control rather than as a banner at
   the top of the page, and carries the one action that resolves it.
   ========================================================================== */

.bys-qty {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bys-qty.is-invalid {
    border-color: #a3302b;
    box-shadow: 0 0 0 3px rgba(163, 48, 43, 0.12);
}

/* At the ceiling the control is dimmed but still clickable — pressing it
   explains the limit, which a `disabled` button could not. */
.bys-qty__btn.is-maxed {
    opacity: 0.4;
    cursor: not-allowed;
}

.bys-qty__btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

.bys-pdp__stock-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #f0c4c1;
    border-radius: 8px;
    background: #fdf1f0;
    color: #8a2b26;
    font-size: 0.875rem;
    font-weight: 500;
}

.bys-pdp__stock-note svg {
    flex: 0 0 auto;
    color: #a3302b;
}

.bys-pdp__stock-note-text {
    flex: 1 1 14rem;
    min-width: 0;
    line-height: 1.55;
}

.bys-pdp__stock-fix {
    flex: 0 0 auto;
    /* 42px keeps the recovery action a comfortable target on a phone. */
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid #a3302b;
    border-radius: 999px;
    background: transparent;
    color: #a3302b;
    font-family: 'Jost', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.bys-pdp__stock-fix:hover,
.bys-pdp__stock-fix:focus-visible {
    background: #a3302b;
    color: #fff;
}

.bys-pdp__stock-hint {
    margin: 12px 0 0;
    color: #6f6a67;
    font-size: 0.82rem;
}

@media (max-width: 479px) {
    /* Full width rather than a cramped chip beside wrapping text. */
    .bys-pdp__stock-fix { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .bys-qty,
    .bys-pdp__stock-fix { transition-duration: 0.01ms !important; }
}
