/* ============================================================
   WC Random Category Products v4.0
   Author: Vivek Kumar | codingindialab.com
   ============================================================ */

.wcrp-wrapper {
    --wcrp-accent:       #D04A6C;
    --wcrp-btn-bg:       #D04A6C;
    --wcrp-btn-txt:      #ffffff;
    --wcrp-card-bg:      #ffffff;
    --wcrp-page-bg:      #fff0f3;
    --wcrp-title:        #222222;
    --wcrp-price:        #D04A6C;
    --wcrp-badge-bg:     #D04A6C;
    --wcrp-badge-txt:    #ffffff;
    --wcrp-heading:      #222222;
    --wcrp-loadmore-bg:  #D04A6C;
    --wcrp-loadmore-txt: #ffffff;
}

.wcrp-wrapper {
    width: 100%;
    padding: 24px;
    background: var(--wcrp-page-bg);
    border-radius: 12px;
    box-sizing: border-box;
    font-family: inherit;
}

/* ── Section Heading ──────────────────────────────────────── */
.wcrp-section-heading {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--wcrp-heading);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--wcrp-accent);
    display: inline-block;
}

/* ── Grid — Desktop columns ───────────────────────────────── */
.wcrp-grid {
    display: grid;
    gap: 20px;
}

.wcrp-col-1 { grid-template-columns: repeat(1, 1fr); }
.wcrp-col-2 { grid-template-columns: repeat(2, 1fr); }
.wcrp-col-3 { grid-template-columns: repeat(3, 1fr); }
.wcrp-col-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Tablet breakpoint ────────────────────────────────────── */
@media (max-width: 991px) {
    .wcrp-col-3,
    .wcrp-col-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile breakpoint — use admin setting ────────────────── */
/* mobile_columns = 2 (default) */
@media (max-width: 600px) {
    .wcrp-col-1.wcrp-mcol-1,
    .wcrp-col-2.wcrp-mcol-1,
    .wcrp-col-3.wcrp-mcol-1,
    .wcrp-col-4.wcrp-mcol-1 {
        grid-template-columns: repeat(1, 1fr);
        gap: 14px;
    }
.wcrp-btn{padding: 6px 14px !important;}
    .wcrp-col-1.wcrp-mcol-2,
    .wcrp-col-2.wcrp-mcol-2,
    .wcrp-col-3.wcrp-mcol-2,
    .wcrp-col-4.wcrp-mcol-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Fallback — no mcol class means 2 col */
    .wcrp-col-2:not([class*="wcrp-mcol-"]),
    .wcrp-col-3:not([class*="wcrp-mcol-"]),
    .wcrp-col-4:not([class*="wcrp-mcol-"]) {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .wcrp-wrapper { padding: 14px; }
}

/* ── Product card ─────────────────────────────────────────── */
.wcrp-product-card {
    background: var(--wcrp-card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.22s ease;
    border: 1px solid rgba(208,74,108,0.10);
}

.wcrp-product-card:hover {
    box-shadow: 0 8px 28px rgba(208,74,108,0.18);
    transform: translateY(-4px);
}

/* ── Hidden state (mobile load-more) ─────────────────────── */
.wcrp-product-card.wcrp-hidden-load {
    display: none !important;
}

/* Fade-in animation when revealed */
@keyframes wcrpFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.wcrp-product-card.wcrp-reveal-anim {
    animation: wcrpFadeUp 0.35s ease both;
}

/* ── Thumbnail ────────────────────────────────────────────── */
.wcrp-thumb {
    display: block;
    overflow: hidden;
    background: #f8f8f8;
}

.wcrp-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.wcrp-product-card:hover .wcrp-thumb img {
    transform: scale(1.06);
}

@media (max-width: 600px) {
    .wcrp-thumb img { height: 150px; }
}

/* ── Product info ─────────────────────────────────────────── */
.wcrp-product-info {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

/* Title */
.wcrp-product-title {
    font-size: 0.92em;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--wcrp-title);
}

.wcrp-product-title a {
    color: inherit;
    text-decoration: none;
}

.wcrp-product-title a:hover {
    color: var(--wcrp-accent);
}

/* ── Price row ────────────────────────────────────────────── */
.wcrp-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}

.wcrp-price .woocommerce-Price-amount,
.wcrp-price > .amount {
    font-size: 1em;
    font-weight: 700;
    color: var(--wcrp-price) !important;
}

.wcrp-price del,
.wcrp-price del .woocommerce-Price-amount {
    color: #aaa !important;
    font-size: 0.82em;
    font-weight: 400 !important;
}

.wcrp-price ins {
    text-decoration: none;
}

/* ── Discount badge ───────────────────────────────────────── */
.wcrp-badge {
    display: inline-block;
    background: var(--wcrp-badge-bg);
    color: var(--wcrp-badge-txt);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ── Add to Cart button ───────────────────────────────────── */
.wcrp-atc {
    margin-top: auto;
}

.wcrp-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    background: var(--wcrp-btn-bg) !important;
    color: var(--wcrp-btn-txt) !important;
    padding: 11px 14px;
    border-radius: 8px !important;
    font-size: 0.88em !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer;
    border: none !important;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(208,74,108,0.25);
    transition: opacity 0.2s ease, transform 0.15s ease !important;
}

.wcrp-btn:hover {
    opacity: 0.88 !important;
    transform: translateY(-1px) !important;
    color: var(--wcrp-btn-txt) !important;
}

.wcrp-btn svg { flex-shrink: 0; }

/* ── Load More button ─────────────────────────────────────── */
.wcrp-loadmore-wrap {
    text-align: center;
    margin-top: 20px;
}

.wcrp-loadmore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--wcrp-loadmore-bg);
    color: var(--wcrp-loadmore-txt);
    border: none;
    border-radius: 10px;
    padding: 13px 32px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(208,74,108,0.28);
    transition: opacity 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.3px;
}

.wcrp-loadmore-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
}

.wcrp-loadmore-btn svg { flex-shrink: 0; }

/* ── Notice ───────────────────────────────────────────────── */
.wcrp-notice {
    color: #888;
    font-style: italic;
    padding: 14px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
