/* =============================================
   CP4U Shop Page — Custom Styles
   ============================================= */

/* ---- Full width override for Astra ---- */
.woocommerce-page #content,
.woocommerce-page .site-content,
.woocommerce-page .ast-container,
.woocommerce-page #primary,
.woocommerce-page .content-area {
    max-width: 100% !important;
    width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Hide sidebar */
.woocommerce-page #secondary,
.woocommerce-page .widget-area {
    display: none !important;
}

/* Hide WC default elements we don't need */
.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce-breadcrumb {
    display: none !important;
}

/* ---- Main shop wrapper ---- */
.cp4u-shop-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 40px 60px;
    box-sizing: border-box;
}

/* ---- Header row ---- */
.cp4u-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 2px solid #e6f7ef;
    padding-bottom: 16px;
}

.cp4u-shop-title {
    font-size: 32px !important;
    font-weight: 500 !important;
    color: #295230 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    text-transform: capitalize !important;
}

.cp4u-shop-count {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ---- 4-column grid ---- */
.cp4u-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

/* ---- Product Card ---- */
.cp4u-shop-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    min-width: 0;
}

.cp4u-shop-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    color: inherit !important;
    text-decoration: none !important;
}

/* Badge */
.cp4u-shop-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #00b843;
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    line-height: 1.4;
}

/* Image */
.cp4u-shop-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9fafb;
    flex-shrink: 0;
}

.cp4u-shop-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 14px;
    box-sizing: border-box;
    display: block;
    transition: transform 0.3s ease;
}

.cp4u-shop-card:hover .cp4u-shop-img-wrap img {
    transform: scale(1.04);
}

/* Body */
.cp4u-shop-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    text-align: center;
}

/* Product name */
.cp4u-shop-name {
    font-size: 15px;
    font-weight: 600;
    color: #00b843;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    min-height: 2.6em;
}

.cp4u-shop-card:hover .cp4u-shop-name {
    text-decoration: underline;
}

/* Sizes */
.cp4u-shop-sizes {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    text-align: center;
}

/* Stars */
.cp4u-shop-stars-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cp4u-shop-stars {
    position: relative;
    display: inline-block;
    font-size: 15px;
    color: #d1d5db;
    white-space: nowrap;
    line-height: 1;
}

.cp4u-shop-stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    color: #f59e0b;
    white-space: nowrap;
}

.cp4u-shop-review-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Price */
.cp4u-shop-price {
    color: #00b843;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.2;
    margin: 4px 0;
    text-align: center;
}

.cp4u-shop-price small {
    font-size: 13px;
    font-weight: 400;
}

.cp4u-shop-price small b {
    font-weight: 700;
}

/* Button */
.cp4u-shop-btn {
    width: 100%;
    background: #00b843;
    border-radius: 50px;
    color: #fff !important;
    display: block;
    margin-top: auto;
    padding: 10px 12px;
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.2s ease;
    box-sizing: border-box;
    text-decoration: none !important;
    margin-top: 12px;
}

.cp4u-shop-card:hover .cp4u-shop-btn {
    background: #295230;
}

/* ---- Pagination ---- */
.cp4u-shop-pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.cp4u-shop-pagination .woocommerce-pagination ul {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.cp4u-shop-pagination .woocommerce-pagination ul li a,
.cp4u-shop-pagination .woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
    background: #fff;
}

.cp4u-shop-pagination .woocommerce-pagination ul li a:hover {
    background: #e6f7ef;
    border-color: #00b843;
    color: #295230;
}

.cp4u-shop-pagination .woocommerce-pagination ul li span.current {
    background: #00b843;
    border-color: #00b843;
    color: #fff;
}

/* ---- No products ---- */
.cp4u-shop-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .cp4u-shop-grid { grid-template-columns: repeat(3, 1fr); }
    .cp4u-shop-wrap { padding: 24px 24px 48px; }
}

@media (max-width: 700px) {
    .cp4u-shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cp4u-shop-wrap { padding: 16px 16px 40px; }
    .cp4u-shop-title { font-size: 24px !important; }
    .cp4u-shop-name { font-size: 13px; }
    .cp4u-shop-price { font-size: 15px; }
    .cp4u-shop-btn { font-size: 12px; padding: 8px 10px; }
}
