/* ============================================================
   Woo Remote Products – Display CSS
   ============================================================ */

/* ── Reset / Base ────────────────────────────────────────── */
.wrp-wrapper *,
.wrp-wrapper *::before,
.wrp-wrapper *::after {
    box-sizing: border-box;
}

.wrp-wrapper {
    --wrp-primary:    #0071a1;
    --wrp-secondary:  #f3f4f6;
    --wrp-text:       #1a1a1a;
    --wrp-muted:      #6b7280;
    --wrp-border:     #e5e7eb;
    --wrp-radius:     8px;
    --wrp-gap:        20px;
    --wrp-sale-color: #e63946;
    --wrp-feat-color: #f59e0b;
    --wrp-star-on:    #f59e0b;
    --wrp-star-off:   #d1d5db;
    --wrp-btn-bg:     #0071a1;
    --wrp-btn-text:   #ffffff;
    --wrp-card-bg:    #ffffff;
    --wrp-title:      var(--wrp-text);
    --wrp-price:      var(--wrp-text);
    font-family: inherit;
    color: var(--wrp-text);
    margin: 0 0 30px;
}

.wrp-section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ── Grid Layout ─────────────────────────────────────────── */
.wrp-layout-grid .wrp-products {
    display: grid;
    gap: var(--wrp-gap);
    grid-template-columns: repeat(var(--wrp-cols, 4), 1fr);
}
.wrp-cols-1 { --wrp-cols: 1; }
.wrp-cols-2 { --wrp-cols: 2; }
.wrp-cols-3 { --wrp-cols: 3; }
.wrp-cols-4 { --wrp-cols: 4; }
.wrp-cols-5 { --wrp-cols: 5; }
.wrp-cols-6 { --wrp-cols: 6; }

/* ── List Layout ─────────────────────────────────────────── */
.wrp-layout-list .wrp-products {
    display: flex;
    flex-direction: column;
    gap: var(--wrp-gap);
}
.wrp-layout-list .wrp-product-card {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}
.wrp-layout-list .wrp-product-image {
    width: 160px;
    flex-shrink: 0;
}
.wrp-layout-list .wrp-product-body {
    flex: 1;
}

/* ── Masonry Layout ──────────────────────────────────────── */
.wrp-layout-masonry .wrp-products {
    columns: var(--wrp-cols, 4);
    column-gap: var(--wrp-gap);
}
.wrp-layout-masonry .wrp-product-card {
    break-inside: avoid;
    margin-bottom: var(--wrp-gap);
}

/* ── Product Card ────────────────────────────────────────── */
.wrp-product-card {
    background: var(--wrp-card-bg);
    border: 1px solid var(--wrp-border);
    border-radius: var(--wrp-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.wrp-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

/* ── Product Image ───────────────────────────────────────── */
.wrp-product-image {
    position: relative;
    overflow: hidden;
    background: var(--wrp-secondary);
}
.wrp-img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.wrp-product-card:hover .wrp-img {
    transform: scale(1.04);
}
.wrp-img-square    { aspect-ratio: 1 / 1; }
.wrp-img-portrait  { aspect-ratio: 3 / 4; }
.wrp-img-landscape { aspect-ratio: 4 / 3; }

/* ── Badges ──────────────────────────────────────────────── */
.wrp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-radius: 4px;
    color: #fff;
    z-index: 2;
}
.wrp-badge-sale       { background: var(--wrp-sale-color); }
.wrp-badge-featured   { background: var(--wrp-feat-color); top: 10px; left: 10px; }
.wrp-badge-outofstock { background: #6b7280; top: 10px; right: 10px; left: auto; }

/* ── Product Body ────────────────────────────────────────── */
.wrp-product-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.wrp-product-category {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--wrp-primary);
}
.wrp-product-tags,
.wrp-product-sku {
    color: var(--wrp-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}
.wrp-partner-disclosure {
    color: var(--wrp-muted);
    font-size: 0.82rem;
    margin: 0 0 18px;
}
.wrp-partner-disclosure p { margin: 0; }

.wrp-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.wrp-product-title a {
    color: var(--wrp-title);
    text-decoration: none;
}
.wrp-product-title a:hover {
    color: var(--wrp-primary);
}

/* ── Stars ───────────────────────────────────────────────── */
.wrp-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wrp-stars { font-size: 15px; line-height: 1; }
.wrp-star-full  { color: var(--wrp-star-on); }
.wrp-star-half  { color: var(--wrp-star-on); opacity: 0.6; }
.wrp-star-empty { color: var(--wrp-star-off); }
.wrp-rating-count { font-size: 12px; color: var(--wrp-muted); }

/* ── Price ───────────────────────────────────────────────── */
.wrp-product-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wrp-price);
    margin-top: auto;
}
.wrp-product-price del {
    color: var(--wrp-muted);
    font-weight: 400;
    font-size: 0.88rem;
    margin-right: 4px;
}
.wrp-product-price ins {
    text-decoration: none;
    color: var(--wrp-sale-color);
}
.wrp-product-price .woocommerce-Price-amount { /* WC price HTML compatibility */
    font-weight: inherit;
}

/* ── Short Description ───────────────────────────────────── */
.wrp-product-desc {
    font-size: 0.83rem;
    color: var(--wrp-muted);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ── Buttons ─────────────────────────────────────────────── */
.wrp-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--wrp-radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
}
.wrp-btn-cart {
    background: var(--wrp-btn-bg);
    color: var(--wrp-btn-text);
    border: none;
}
.wrp-btn-cart:hover {
    background: #005580;
    transform: translateY(-1px);
}
.wrp-btn-disabled {
    background: var(--wrp-secondary);
    color: var(--wrp-muted);
    cursor: not-allowed;
}

/* ── Pagination ──────────────────────────────────────────── */
.wrp-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.wrp-page-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: var(--wrp-radius);
    border: 1px solid var(--wrp-border);
    background: #fff;
    color: var(--wrp-text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}
.wrp-page-btn:hover,
.wrp-page-btn.wrp-page-active {
    background: var(--wrp-primary);
    color: #fff;
    border-color: var(--wrp-primary);
}
.wrp-page-info {
    font-size: 0.8rem;
    color: var(--wrp-muted);
    margin-left: 6px;
}

.wrp-total-count {
    font-size: 0.8rem;
    color: var(--wrp-muted);
    margin-top: 8px;
}

/* ── Error / No Products ─────────────────────────────────── */
.wrp-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 14px 18px;
    border-radius: var(--wrp-radius);
    border-left: 4px solid #ef4444;
    font-size: 0.9rem;
}
.wrp-no-products {
    color: var(--wrp-muted);
    font-style: italic;
    text-align: center;
    padding: 30px;
}

/* ── Theme: Minimal ──────────────────────────────────────── */
.wrp-theme-minimal .wrp-product-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid var(--wrp-border);
}
.wrp-theme-minimal .wrp-product-card:hover {
    transform: none;
    box-shadow: none;
}
.wrp-theme-minimal .wrp-btn-cart {
    background: transparent;
    color: var(--wrp-primary);
    border: 1px solid var(--wrp-primary);
}
.wrp-theme-minimal .wrp-btn-cart:hover {
    background: var(--wrp-primary);
    color: #fff;
}

/* ── Theme: Card (elevated) ──────────────────────────────── */
.wrp-theme-card .wrp-product-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.wrp-theme-card .wrp-product-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
}

/* ── Theme: Dark ─────────────────────────────────────────── */
.wrp-theme-dark {
    --wrp-text:    #f9fafb;
    --wrp-muted:   #9ca3af;
    --wrp-border:  #374151;
    --wrp-secondary: #1f2937;
    --wrp-btn-bg:  #3b82f6;
}
.wrp-theme-dark .wrp-product-card {
    background: #111827;
    border-color: var(--wrp-border);
}
.wrp-theme-dark .wrp-page-btn {
    background: #1f2937;
    color: var(--wrp-text);
    border-color: var(--wrp-border);
}

/* ── Responsive ──────────────────────────────────────────── */
@media ( max-width: 1199px ) {
    .wrp-cols-6 { --wrp-cols: 4; }
    .wrp-cols-5 { --wrp-cols: 3; }
}
@media ( max-width: 900px ) {
    .wrp-cols-6,
    .wrp-cols-5,
    .wrp-cols-4 { --wrp-cols: 3; }
    .wrp-layout-masonry .wrp-products { columns: 3; }
}
@media ( max-width: 600px ) {
    .wrp-cols-6,
    .wrp-cols-5,
    .wrp-cols-4,
    .wrp-cols-3 { --wrp-cols: 2; }
    .wrp-layout-list .wrp-product-card { flex-direction: column; }
    .wrp-layout-list .wrp-product-image { width: 100%; }
    .wrp-layout-masonry .wrp-products { columns: 2; }
}
@media ( max-width: 400px ) {
    .wrp-cols-2,
    .wrp-cols-3,
    .wrp-cols-4,
    .wrp-cols-5,
    .wrp-cols-6 { --wrp-cols: 1; }
    .wrp-layout-masonry .wrp-products { columns: 1; }
}

/* ── Source label (show_source_label="1") ── */
.wrp-source-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--wrp-muted);
    margin-bottom: 6px;
}
/* ── Pagination ellipsis ── */
.wrp-page-ellipsis {
    display: inline-block;
    padding: 7px 6px;
    color: var(--wrp-muted);
    font-size: 0.85rem;
}
