/*
 * product-recommendations.css (v3 - fixed light-theme colors + layout)
 * ----------------------------------------------------------------------
 * v2 was styled for a dark/gradient order-summary-aside (semi-transparent
 * white "frosted glass" cards + a light-bg fallback that only activated
 * for an INLINE style="background:#fff" or a .light-bg class). The aside
 * is now always a plain white card (background-color:#fff set in
 * multi-product.css, as a stylesheet rule - not inline style, and without
 * .light-bg), so that fallback never actually matched: the items were
 * always rendering as near-invisible white-on-white cards.
 *
 * Fix: since there is currently no dark-aside variant in use, the light
 * theme is now the direct default (old dark-mode colors + the dead
 * fallback selectors removed) rather than something to detect.
 *
 * Also fixes inconsistent alignment: the mobile flex-wrap rule made the
 * button drop to its own line whenever a row felt tight, which looked
 * different from item to item depending on name length. The name now
 * flexes/truncates instead, so the button stays in a fixed, consistent
 * position on every row, every item, every width.
 *
 * Scoped to .pi-reco-aside-* only - does not override any existing class.
 * ----------------------------------------------------------------------
 */

.pi-reco-aside-box {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #eef1f4;
}

.pi-reco-aside-box.is-visible {
    display: block;
    animation: piRecoAsideFadeIn .25s ease;
}

@keyframes piRecoAsideFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading state - shown the instant a real network request starts
   (cache hits skip this entirely). Sized/padded to sit close to a single
   result row so swapping in the real list afterwards doesn't jump the
   page around much. ── */
.pi-reco-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    background: #f5f9ff;
    border: 1px solid #cfe2f9;
    border-radius: 8px;
    animation: piRecoAsideFadeIn .2s ease;
}

.pi-reco-spinner {
    position: relative;
    width: 15px;
    height: 15px;
    flex: none;
}

.pi-reco-spinner i {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1.5px;
    height: 4.5px;
    margin-left: -0.75px;
    border-radius: 1px;
    background: #6b96c9;
    transform-origin: 50% 7.5px;
    animation: piRecoSpin 1s linear infinite;
}

.pi-reco-spinner i:nth-child(1) { transform: rotate(0deg);   animation-delay: -0.875s; }
.pi-reco-spinner i:nth-child(2) { transform: rotate(45deg);  animation-delay: -0.75s; }
.pi-reco-spinner i:nth-child(3) { transform: rotate(90deg);  animation-delay: -0.625s; }
.pi-reco-spinner i:nth-child(4) { transform: rotate(135deg); animation-delay: -0.5s; }
.pi-reco-spinner i:nth-child(5) { transform: rotate(180deg); animation-delay: -0.375s; }
.pi-reco-spinner i:nth-child(6) { transform: rotate(225deg); animation-delay: -0.25s; }
.pi-reco-spinner i:nth-child(7) { transform: rotate(270deg); animation-delay: -0.125s; }
.pi-reco-spinner i:nth-child(8) { transform: rotate(315deg); animation-delay: 0s; }

@keyframes piRecoSpin {
    0%   { opacity: 1; }
    100% { opacity: .15; }
}

.pi-reco-loading-text {
    font-size: 12px;
    color: #6b7785;
}

@media (prefers-reduced-motion: reduce) {
    .pi-reco-spinner i { animation: none; opacity: .5; }
    .pi-reco-aside-box.is-visible,
    .pi-reco-loading { animation: none; }
}

.pi-reco-aside-heading {
    font-size: 12.5px;
    font-weight: 700;
    color: #1a2533;
    opacity: .9;
    margin-bottom: 8px;
}

.pi-reco-aside-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pi-reco-aside-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f5f9ff;
    border: 1px solid #cfe2f9;
    border-radius: 8px;
    padding: 6px 8px;
}

.pi-reco-aside-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    color: #1a2533;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pi-reco-aside-add-btn {
    flex: none;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: #1565c0;
    transition: opacity .15s, transform .1s;
}

.pi-reco-aside-add-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.pi-reco-aside-add-btn:active {
    transform: translateY(0);
}

@media (max-width: 360px) {
    /* Only on genuinely very narrow screens: shrink padding/text a touch
       instead of wrapping the button onto its own line, so every item
       still lines up the same way regardless of name length. */
    .pi-reco-aside-add-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
}
