/* ==========================================================================
   WP Catalog - Shop Grid Styles
   ========================================================================== */

/* ---------- Breadcrumb ---------- */
.wpc-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 28px;
    letter-spacing: 0.3px;
}

.wpc-breadcrumb a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wpc-breadcrumb a:hover {
    color: #111;
}

.wpc-breadcrumb-sep {
    margin: 0 8px;
    color: #ccc;
}

.wpc-breadcrumb-current {
    color: #111;
    font-weight: 500;
}

/* ---------- Product Grid ---------- */
.wpc-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Product Card ---------- */
.wpc-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.wpc-product-card.wpc-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay per column */
.wpc-product-card:nth-child(4n+2) { transition-delay: 0.08s; }
.wpc-product-card:nth-child(4n+3) { transition-delay: 0.16s; }
.wpc-product-card:nth-child(4n+4) { transition-delay: 0.24s; }

.wpc-product-card.wpc-visible:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.wpc-product-link {
    display: block;
    flex: 1;
}

.wpc-product-link,
.wpc-product-link:hover,
.wpc-product-link:focus,
.wpc-product-link:visited,
.wpc-product-link *,
.wpc-product-link:hover * {
    text-decoration: none !important;
    color: inherit;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* ---------- Product Image (2:3 portrait ratio) ---------- */
.wpc-product-image {
    position: relative;
    width: 100%;
    padding-top: 150%; /* 2:3 ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.wpc-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wpc-product-card:hover .wpc-product-image img {
    transform: scale(1.05);
}

/* ---------- Product Info ---------- */
.wpc-product-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 4px 8px;
    gap: 12px;
}

.wpc-product-title {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wpc-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--wpc-price-color, #e74c3c);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Checkout Button ---------- */
.wpc-checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin: auto 4px 4px;
    background-color: var(--wpc-button-color, #25d366);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.wpc-checkout-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none !important;
}

.wpc-checkout-btn:active {
    transform: translateY(0);
}

.wpc-checkout-btn svg {
    flex-shrink: 0;
}

/* ---------- No Products ---------- */
.wpc-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ---------- Pagination ---------- */
.wpc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding: 0 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wpc-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    text-decoration: none !important;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wpc-page-link:hover {
    border-color: #888;
    background: #f5f5f5;
    color: #111;
}

.wpc-page-current {
    background: #222;
    color: #fff !important;
    border-color: #222;
    cursor: default;
    font-weight: 600;
}

.wpc-page-current:hover {
    background: #222;
    border-color: #222;
}

.wpc-page-dots {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: #999;
    font-size: 14px;
}

.wpc-page-prev,
.wpc-page-next {
    font-size: 13px;
    font-weight: 500;
}

/* ---------- Filter / Sort Bar ---------- */
.wpc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 28px;
    padding: 16px 20px;
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #eee;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wpc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpc-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpc-filter-select {
    height: 40px;
    box-sizing: border-box;
    padding: 0 32px 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #333;
    min-width: 150px;
    transition: border-color 0.2s ease;
}

.wpc-filter-select:hover {
    border-color: #bbb;
}

.wpc-filter-select:focus {
    outline: none;
    border-color: #888;
}

.wpc-search-group {
    flex: 1;
    min-width: 200px;
}

.wpc-search-wrap {
    display: flex;
    gap: 0;
}

.wpc-search-input {
    flex: 1;
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease;
}

.wpc-search-input:focus {
    outline: none;
    border-color: #888;
}

.wpc-search-input::placeholder {
    color: #bbb;
}

.wpc-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    box-sizing: border-box;
    padding: 0 14px;
    background: #222;
    color: #fff;
    border: 1px solid #222;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wpc-search-btn:hover {
    background: #444;
    border-color: #444;
}

.wpc-filter-reset {
    align-self: flex-end;
}

.wpc-reset-btn {
    display: inline-block;
    padding: 8px 14px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.wpc-reset-btn:hover {
    color: #d63638;
    border-color: #d63638;
    background: #fef1f1;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .wpc-shop-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .wpc-shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 12px;
    }

    .wpc-product-info {
        flex-direction: column;
        gap: 4px;
        padding: 10px 2px 6px;
    }

    .wpc-product-title {
        font-size: 13px;
    }

    .wpc-product-price {
        font-size: 13px;
    }

    .wpc-checkout-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .wpc-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 16px;
    }

    .wpc-filter-group {
        width: 100%;
    }

    .wpc-filter-select {
        width: 100%;
        min-width: 0;
    }

    .wpc-search-group {
        min-width: 0;
    }

    .wpc-filter-reset {
        align-self: stretch;
        text-align: center;
    }

    .wpc-reset-btn {
        display: block;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wpc-shop-grid {
        gap: 12px;
        padding: 0 8px;
    }

    .wpc-breadcrumb {
        font-size: 12px;
        margin-bottom: 20px;
        padding: 0 8px;
    }

    .wpc-filter-bar {
        padding: 12px;
        margin-bottom: 20px;
        border-radius: 8px;
    }

    .wpc-filter-label {
        font-size: 10px;
    }

    .wpc-filter-select,
    .wpc-search-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .wpc-search-btn {
        padding: 10px 14px;
    }
}
