/* ============================================================
   share cart / shared cart / recently viewed
   Appended after main.css via _layout.html.
   ============================================================ */
.cart-share-btn {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cart-share-icon { font-size: 18px; line-height: 1; }

.share-cart-result {
    margin-top: 14px;
    padding: 14px;
    background: var(--bg-soft, #f7f7f9);
    border: 1px solid var(--border, #e5e5ea);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.share-cart-result[hidden] { display: none; }
.share-cart-url-label { font-weight: 600; font-size: 14px; }
.share-cart-url-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-cart-url-row input {
    flex: 1 1 220px;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e5ea);
    border-radius: 8px;
    background: #fff;
    direction: ltr;
}
.share-cart-hint { font-size: 13px; color: var(--text-muted, #666); margin: 0; }
.share-cart-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-cart-actions .btn.whatsapp {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
}

/* ----- shared cart recipient page ----- */
.shared-cart-page { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.shared-cart-kicker {
    font-size: 13px;
    color: var(--brand, #c8472a);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 4px;
    font-weight: 700;
}
.shared-cart-title { margin: 0 0 12px; font-size: 28px; }
.shared-cart-note {
    margin: 8px 0 16px;
    padding: 12px 14px;
    background: var(--bg-soft, #f7f7f9);
    border-inline-start: 3px solid var(--brand, #c8472a);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-style: italic;
}
.shared-cart-note-icon { font-size: 20px; line-height: 1; }
.shared-cart-intro { color: var(--text-muted, #666); margin: 0 0 18px; }
.shared-cart-form { display: flex; flex-direction: column; gap: 16px; }
.shared-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.shared-cart-item {
    display: grid;
    grid-template-columns: auto 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border, #e5e5ea);
    border-radius: 12px;
    background: #fff;
}
.shared-cart-item.is-unavailable { opacity: 0.55; }
.shared-cart-pick { display: inline-flex; align-items: center; justify-content: center; }
.shared-cart-pick input { width: 22px; height: 22px; cursor: pointer; }
.shared-cart-pick.is-disabled { font-size: 22px; }
.shared-cart-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-soft, #f7f7f9);
}
.shared-cart-img.placeholder { background: var(--bg-soft, #f7f7f9); }
.shared-cart-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shared-cart-name {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.shared-cart-name:hover { text-decoration: underline; }
.shared-cart-price { margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.shared-cart-oldprice { color: var(--text-muted, #888); font-size: 13px; }
.shared-cart-newprice { color: var(--brand, #c8472a); }
.shared-cart-pricechip {
    background: #fff3e6;
    color: #c8472a;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.shared-cart-unavail { margin: 0; color: #c0392b; font-size: 13px; font-weight: 600; }
.shared-cart-qty input {
    width: 64px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid var(--border, #e5e5ea);
    border-radius: 8px;
    font-size: 15px;
}
.shared-cart-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 4px;
}
.shared-cart-browse { color: var(--text-muted, #666); text-decoration: underline; }
@media (max-width: 540px) {
    .shared-cart-item {
        grid-template-columns: auto 56px 1fr;
        grid-template-areas:
            "pick img meta"
            ".    .   qty";
    }
    .shared-cart-pick { grid-area: pick; }
    .shared-cart-img  { grid-area: img; width: 56px; height: 56px; }
    .shared-cart-meta { grid-area: meta; }
    .shared-cart-qty  { grid-area: qty; justify-self: end; }
}

/* ----- recently viewed strip on PDP ----- */
.recently-viewed { margin-top: 32px; padding: 0 4px; }
.recently-viewed-head h2 { font-size: 18px; margin: 0 0 12px; }
.recently-viewed-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.recently-viewed-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    padding: 8px;
    border: 1px solid var(--border, #e5e5ea);
    border-radius: 10px;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.recently-viewed-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.recently-viewed-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    outline: 2px solid var(--brand, #c8472a);
    outline-offset: 2px;
}
.recently-viewed-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-soft, #f7f7f9);
}
.recently-viewed-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
}
.recently-viewed-price { color: var(--brand, #c8472a); font-size: 13px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    .recently-viewed-link { transition: none; }
}
