/* ================================================
   Jartides Product Archive — style.css
   Exact match to provided screenshots
   ================================================ */

/* ── Reset & Base ── */
.jpa-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.jpa-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Category Tabs ── */
.jpa-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.jpa-cat-btn {
    padding: 7px 22px;
    border-radius: 999px;
    border: 1.5px solid #d0d5dd;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.jpa-cat-btn:hover {
    border-color: #2563EB;
    color: #2563EB;
}

.jpa-cat-btn.active {
    background: #EFF6FF;
    border-color: #2563EB;
    color: #2563EB;
    font-weight: 600;
}

/* ── Tags Row ── */
.jpa-tags-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.jpa-tags-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    padding-top: 4px;
    white-space: nowrap;
}

.jpa-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jpa-tag-btn {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #d0d5dd;
    background: #fff;
    font-size: 12.5px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.5;
}

.jpa-tag-btn:hover {
    border-color: #1A6DE3;
    background: #1A6DE3;
    color: #fff;
}

.jpa-tag-btn.active {
    background: #1A6DE3;
    border-color: #1A6DE3;
    color: #fff;
}

/* ── Filter Bar ── */
.jpa-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.jpa-sort-wrap {
    position: relative;
}

.jpa-sort-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 36px 8px 14px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    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='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    cursor: pointer;
    min-width: 130px;
}

.jpa-sort-select:focus {
    outline: none;
    border-color: #2563EB;
}

.jpa-price-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    padding: 6px 12px;
    background: #fff;
}

.jpa-price-icon {
    font-size: 14px;
    color: #6b7280;
    margin-right: 4px;
}

.jpa-dollar {
    font-size: 13px;
    color: #6b7280;
}

.jpa-price-input {
    width: 72px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #374151;
    background: transparent;
}

.jpa-price-input::placeholder {
    color: #9ca3af;
}

.jpa-price-dash {
    color: #9ca3af;
    font-size: 14px;
}

.jpa-count-wrap {
    margin-left: auto;
}

#jpa-product-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* ── Grid ── */
.jpa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .jpa-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .jpa-grid { grid-template-columns: repeat(2, 1fr); }
    .jpa-filter-bar { flex-wrap: wrap; }
    .jpa-count-wrap { margin-left: 0; }
}
@media (max-width: 480px) {
    .jpa-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ── Product Card ── */
.jpa-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.jpa-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* ── Card Image Wrap ── */
.jpa-card__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    overflow: hidden;
}

.jpa-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.3s ease;
}

.jpa-card:hover .jpa-card__image-wrap img {
    transform: scale(1.04);
}

.jpa-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Badges ── */
.jpa-badge {
    position: absolute;
    top: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 2;
    line-height: 1.4;
}

.jpa-badge--new {
    left: 10px;
    background: #2563EB;
    color: #fff;
}

.jpa-badge--bestseller {
    left: 10px;
    background: #2563EB;
    color: #fff;
}

.jpa-badge--backorder {
    left: 10px;
    background: #2563EB;
    color: #fff;
}

.jpa-badge--discount {
    right: 10px;
    background: #16a34a;
    color: #fff;
}

/* ── Wishlist ── */
.jpa-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.15s ease;
    padding: 0;
}

.jpa-wishlist:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.jpa-wishlist svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

/* when discount badge is also present, push heart left of it */
.jpa-badge--discount ~ .jpa-wishlist,
.jpa-wishlist:has(~ .jpa-badge--discount) {
    right: 46px;
}

/* ── Out of Stock Bar ── */
.jpa-out-of-stock-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #dc2626;
    color: #fff;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 5px 0;
    z-index: 2;
}

/* ── Card Body ── */
.jpa-card__body {
    padding: 12px 14px 8px;
    flex: 1;
}

.jpa-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 3px;
}

.jpa-card__title a {
    text-decoration: none;
    color: inherit;
}

.jpa-card__title a:hover {
    color: #2563EB;
}

.jpa-card__subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 5px;
}

/* ── Stars ── */
.jpa-card__rating {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 6px;
}

.jpa-star {
    font-size: 13px;
    line-height: 1;
}

.jpa-star--full  { color: #f59e0b; }
.jpa-star--half  { color: #f59e0b; opacity: 0.6; }
.jpa-star--empty { color: #d1d5db; }

.jpa-card__review-count {
    font-size: 11px;
    color: #6b7280;
    margin-left: 3px;
}

/* ── Price ── */
.jpa-card__price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-top: 4px;
}

.jpa-card__price .woocommerce-Price-amount {
    font-weight: 700;
    color: #111827;
}

.jpa-card__price del {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 5px;
}

.jpa-card__price del .woocommerce-Price-amount {
    color: #9ca3af;
    font-weight: 400;
}

/* ── Card Footer ── */
.jpa-card__footer {
    display: flex;
    gap: 8px;
    padding: 10px 14px 14px;
}

/* ── Buttons ── */
.jpa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.15s ease;
    line-height: 1;
    white-space: nowrap;
}

.jpa-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Add to Cart — blue */
.jpa-btn--cart {
    flex: 1;
    background: #2563EB;
    color: #fff;
}

.jpa-btn--cart:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Select Size — blue */
.jpa-btn--select {
    flex: 1;
    background: #2563EB;
    color: #fff;
}

.jpa-btn--select:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Notify Me — orange */
.jpa-btn--notify {
    flex: 1;
    background: #f97316;
    color: #fff;
}

.jpa-btn--notify:hover {
    background: #ea6c0a;
    color: #fff;
}

/* View — white/outlined */
.jpa-btn--view {
    background: #fff;
    color: #374151;
    border: 1.5px solid #d0d5dd;
    padding: 9px 16px;
    flex-shrink: 0;
}

.jpa-btn--view:hover {
    border-color: #2563EB;
    color: #2563EB;
}

/* ── No Products ── */
.jpa-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 15px;
}

/* ── Loading spinner ── */
.jpa-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.jpa-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: jpa-spin 0.7s linear infinite;
}

@keyframes jpa-spin {
    to { transform: rotate(360deg); }
}

/* ── WooCommerce price override cleanup ── */
.jpa-card__price .price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.jpa-card__price ins {
    text-decoration: none;
}

/* ── Featured Products Section ── */
.jpa-featured-wrap {
    width: 100%;
}

.jpa-featured-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
    text-align: center;
}

/* Column overrides for featured shortcode */
.jpa-grid--cols-1 { grid-template-columns: repeat(1, 1fr); }
.jpa-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.jpa-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.jpa-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.jpa-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.jpa-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1100px) {
    .jpa-grid--cols-5,
    .jpa-grid--cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .jpa-grid--cols-3,
    .jpa-grid--cols-4,
    .jpa-grid--cols-5,
    .jpa-grid--cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .jpa-grid--cols-2,
    .jpa-grid--cols-3,
    .jpa-grid--cols-4,
    .jpa-grid--cols-5,
    .jpa-grid--cols-6 { grid-template-columns: repeat(2, 1fr); }
}
