/* =============================================
   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 #e8f2fb;
    padding-bottom: 16px;
}

.cp4u-shop-title {
    font-size: 32px !important;
    font-weight: 500 !important;
    color: #256f96 !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: #003978;
    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: #003978;
    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: #003978;
    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: #003978;
    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: #256f96;
}

/* ---- 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: #e8f2fb;
    border-color: #003978;
    color: #256f96;
}

.cp4u-shop-pagination .woocommerce-pagination ul li span.current {
    background: #003978;
    border-color: #003978;
    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; }
}


/* ═══════════════════════════════════════════════════════════════
   CP4U SUBCATEGORY GRID — shown on parent category landing pages
   Styled to match .cp4u-shop-card exactly
═══════════════════════════════════════════════════════════════ */
.cp4u-subcat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    margin-bottom: 40px;
}
.cp4u-subcat-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-subcat-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    color: inherit !important;
    text-decoration: none !important;
}
.cp4u-subcat-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9fafb;
    flex-shrink: 0;
}
.cp4u-subcat-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 14px;
    box-sizing: border-box;
    display: block;
    transition: transform 0.3s ease;
}
.cp4u-subcat-card:hover .cp4u-subcat-img img {
    transform: scale(1.04);
}
.cp4u-subcat-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    text-align: center;
}
.cp4u-subcat-name {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #003978 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    min-height: 2.6em;
}
.cp4u-subcat-card:hover .cp4u-subcat-name {
    text-decoration: underline;
}
.cp4u-subcat-desc {
    font-size: 12px !important;
    color: #9ca3af !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cp4u-subcat-btn {
    width: 100%;
    background: #003978;
    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-subcat-card:hover .cp4u-subcat-btn {
    background: #256f96;
}

@media (max-width: 1100px) {
    .cp4u-subcat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .cp4u-subcat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cp4u-subcat-name { font-size: 13px !important; }
    .cp4u-subcat-btn  { font-size: 12px; padding: 8px 10px; }
}


/* ═══════════════════════════════════════════════════════════════
   CP4U SEARCH RESULTS PAGE
═══════════════════════════════════════════════════════════════ */
.cp4u-search-header {
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

/* Inline search bar */
.cp4u-search-form {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
    min-width: 280px;
}
.cp4u-search-form:focus-within {
    border-color: #003978;
}
.cp4u-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    background: transparent !important;
    color: #171e29 !important;
    box-shadow: none !important;
    margin: 0 !important;
    min-width: 0;
}
.cp4u-search-btn {
    background: #003978;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    color: #fff;
    transition: background 0.2s;
    flex-shrink: 0;
}
.cp4u-search-btn:hover {
    background: #256f96;
}

/* Empty / no results state */
.cp4u-search-empty {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.cp4u-search-empty-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin: 0 !important;
}
.cp4u-search-empty-sub {
    font-size: 14px !important;
    color: #9ca3af !important;
    margin: 0 !important;
    max-width: 420px;
}
.cp4u-search-browse-btn {
    display: inline-block;
    margin-top: 8px;
    background: #003978;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none !important;
    transition: background 0.2s;
}
.cp4u-search-browse-btn:hover {
    background: #256f96;
}

@media (max-width: 700px) {
    .cp4u-search-form { min-width: 100%; }
    .cp4u-search-header { flex-direction: column; align-items: flex-start; }
}

/* Full-width override for Astra on search pages */
.search-results #content,
.search-results .site-content,
.search-results .ast-container,
.search-results #primary,
.search-results .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;
}
.search-results #secondary,
.search-results .widget-area {
    display: none !important;
}
