/**
 * Porter Smart Shelf — Recommendations Banner
 * Clean, store-native feel — no tech/AI branding on the storefront.
 */

/* ── Banner Container ── */
.pshelf-banner {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-left: 2px solid #e5e5e5;
    box-shadow: -4px 0 20px rgba(0,0,0,.08);
    border-radius: 10px 0 0 10px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
}

.pshelf-banner.pshelf-hidden {
    transform: translateY(-50%) translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* ── Header — subtle, store-native ── */
.pshelf-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    border-radius: 10px 0 0 0;
}

.pshelf-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: .01em;
}

.pshelf-banner-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    line-height: 1;
}

.pshelf-banner-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ── Content area ── */
.pshelf-banner-content {
    padding: 10px 12px;
}

.pshelf-loading {
    text-align: center;
    padding: 20px 12px;
    color: #aaa;
    font-size: 12px;
}

/* ── Sections ── */
.pshelf-section {
    margin-bottom: 14px;
}

.pshelf-section:last-child {
    margin-bottom: 0;
}

.pshelf-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #999;
    margin: 0 0 6px 0;
    padding: 0;
}

/* ── Product items ── */
.pshelf-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background .15s;
    border: 1px solid transparent;
}

.pshelf-item:hover {
    background: #f8f8f8;
    border-color: #eee;
}

.pshelf-product-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pshelf-product-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.pshelf-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pshelf-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pshelf-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #222;
}

.pshelf-product-reason,
.pshelf-page-reason,
.pshelf-article-excerpt {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    font-style: italic;
}

/* ── Page & article items ── */
.pshelf-page-item,
.pshelf-article-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pshelf-page-title,
.pshelf-article-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ── Widget mode (in sidebar) ── */
.pshelf-widget .pshelf-section-title {
    margin-top: 8px;
}

/* ── Mobile: bottom sheet ── */
@media (max-width: 768px) {
    .pshelf-banner {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: 50vh;
        transform: translateY(0);
        border-left: none;
        border-top: 2px solid #e5e5e5;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    }

    .pshelf-banner.pshelf-hidden {
        transform: translateY(110%);
    }

    .pshelf-banner-header {
        border-radius: 14px 14px 0 0;
    }

    .pshelf-product-item {
        flex-direction: row;
    }
}

/* ── Scrollbar ── */
.pshelf-banner::-webkit-scrollbar {
    width: 4px;
}
.pshelf-banner::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Cookie Consent Bar */
.pshelf-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a1a1a;
    color: #fff;
    padding: 16px 24px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}
.pshelf-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.pshelf-consent-text {
    margin: 0;
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}
.pshelf-consent-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.pshelf-consent-accept {
    background: #780800;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.pshelf-consent-accept:hover {
    background: #960a00;
}
.pshelf-consent-decline {
    background: transparent;
    color: #999;
    border: 1px solid #555;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s, border-color 0.2s;
}
.pshelf-consent-decline:hover {
    color: #fff;
    border-color: #999;
}
@media (max-width: 600px) {
    .pshelf-consent-inner {
        flex-direction: column;
        text-align: center;
    }
    .pshelf-consent-actions {
        width: 100%;
        justify-content: center;
    }
}
