/**
 * CGPSCedu — Shop Product Cards  v5.0
 * Applies to: Shop/Archive page + Related products section
 * Completely separate from style.css to avoid conflicts.
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHOP TOOLBAR
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cgpsc-shop-hero {
    background: linear-gradient(135deg, #0a1628 0%, #162d5a 100%);
    color: #fff;
    text-align: center;
    padding: 52px 24px 44px;
    margin-bottom: 40px;
}
.cgpsc-shop-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900;
    margin: 12px 0 10px;
    color: #fff;
}
.cgpsc-shop-hero h1 em { color: #e8b84b; font-style: normal; }
.cgpsc-shop-hero p { font-size: 15px; color: rgba(255,255,255,.7); margin: 0; }
.cgpsc-hero-badge {
    display: inline-block;
    background: rgba(232,184,75,.18);
    border: 1px solid rgba(232,184,75,.4);
    color: #e8b84b;
    border-radius: 999px;
    padding: 5px 16px;
    font-size: 12.5px;
    font-weight: 700;
}
.cgpsc-shop-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cgpsc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.woocommerce-result-count { font-size: 13px; color: #7b83a6; margin: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   GRID — 3 columns desktop
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
ul.cgpsc-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARD — Desktop
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cgpsc-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eaecf2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s, box-shadow .22s;
    position: relative;
    box-shadow: 0 2px 12px rgba(10,22,40,.06);
}
.cgpsc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(10,22,40,.13);
    border-color: #e8b84b;
}
/* Gold accent line at bottom on hover */
.cgpsc-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e8b84b, #f5d06e);
    transform: scaleX(0);
    transition: transform .22s;
}
.cgpsc-card:hover::after { transform: scaleX(1); }

/* Image wrapper */
.cgpsc-card__img-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f0f2f8;
    text-decoration: none;
}
.cgpsc-card__img-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform .3s !important;
}
.cgpsc-card:hover .cgpsc-card__img-wrap img { transform: scale(1.04); }

/* Badges */
.cgpsc-badge {
    position: absolute;
    top: 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cgpsc-badge--sale { left: 10px; background: #e8b84b; color: #0a1628; }
.cgpsc-badge--cat  { right: 10px; background: rgba(10,22,40,.75); color: #fff; }

/* Body */
.cgpsc-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.cgpsc-card__title { margin: 0; }
.cgpsc-card__title a {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0a1628;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.cgpsc-card__title a:hover { color: #c49a2e; }
.cgpsc-card__excerpt {
    font-size: 13px;
    color: #7b83a6;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cgpsc-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #eaecf2;
    flex-wrap: wrap;
}
.cgpsc-card__price {
    font-size: 18px;
    font-weight: 900;
    color: #c49a2e;
    line-height: 1;
}
.cgpsc-card__price del { font-size: 13px; color: #aaa; font-weight: 400; margin-right: 4px; }
.cgpsc-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e8b84b, #f5d06e);
    color: #0a1628;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .18s;
    box-shadow: 0 3px 10px rgba(232,184,75,.3);
}
.cgpsc-card__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232,184,75,.45);
    background: linear-gradient(135deg, #f5d06e, #e8b84b);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RELATED PRODUCTS (uses WC default ul.products)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body.single-product ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.single-product ul.products li.product {
    background: #fff !important;
    border-radius: 14px !important;
    border: 1px solid #eaecf2 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform .2s, box-shadow .2s !important;
    box-shadow: 0 2px 10px rgba(10,22,40,.06) !important;
    padding: 0 !important;
}
body.single-product ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 32px rgba(10,22,40,.12) !important;
}
body.single-product ul.products li.product img {
    width: 100% !important; height: 180px !important;
    object-fit: cover !important; display: block !important;
}
body.single-product ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important; font-weight: 700 !important;
    color: #0a1628 !important; padding: 12px 14px 6px !important; margin: 0 !important;
}
body.single-product ul.products li.product span.price {
    padding: 0 14px 10px !important; color: #c49a2e !important;
    font-weight: 800 !important; font-size: 15px !important; display: block !important;
}
body.single-product ul.products li.product a.button {
    margin: 0 14px 14px !important;
    display: block !important;
    text-align: center !important;
    padding: 9px !important;
    background: linear-gradient(135deg, #e8b84b, #f5d06e) !important;
    color: #0a1628 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    border: none !important;
}

/* WooCommerce Pagination */
.woocommerce-pagination { margin-top: 40px; text-align: center; }
.woocommerce-pagination ul {
    display: inline-flex; gap: 6px; list-style: none; padding: 0; margin: 0;
}
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    font-size: 13.5px; font-weight: 700; color: #0a1628; text-decoration: none;
    border: 1.5px solid #eaecf2; transition: all .15s;
}
.woocommerce-pagination ul li a:hover { background: #0a1628; color: #fff; border-color: #0a1628; }
.woocommerce-pagination ul li span.current { background: linear-gradient(135deg, #e8b84b, #f5d06e); color: #0a1628; border-color: #e8b84b; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* 1024px: 2 columns */
@media (max-width: 1024px) {
    ul.cgpsc-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 18px !important; }
    body.single-product ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}

/* 768px: 2 columns, smaller hero */
@media (max-width: 768px) {
    .cgpsc-shop-hero { padding: 36px 20px 28px; }
    .cgpsc-shop-wrap { padding: 0 16px; }
}

/* 480px: 1 column, horizontal card */
@media (max-width: 480px) {
    ul.cgpsc-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Horizontal card layout on mobile */
    .cgpsc-card {
        flex-direction: row !important;
        min-height: 110px !important;
        align-items: stretch !important;
    }
    .cgpsc-card__img-wrap {
        width: 110px !important;
        min-width: 110px !important;
        flex-shrink: 0 !important;
        aspect-ratio: unset !important;
        border-radius: 0 !important;
    }
    .cgpsc-card__body { padding: 10px 12px !important; gap: 5px !important; }
    .cgpsc-card__title a { font-size: 13.5px !important; -webkit-line-clamp: 2 !important; }
    .cgpsc-card__excerpt { display: none !important; }
    .cgpsc-card__footer { padding-top: 8px !important; }
    .cgpsc-card__price { font-size: 15px !important; }
    .cgpsc-card__btn { font-size: 11.5px !important; padding: 6px 12px !important; }
    .cgpsc-card:hover { transform: none !important; }
    .cgpsc-card::after { display: none !important; }

    body.single-product ul.products { grid-template-columns: 1fr !important; }
}
