/* ── Grid layout ────────────────────────────────────────────────────────── */
.tfc-products-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--tfc-pg-cols, 4), 1fr);
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.tfc-products-grid--cols-1 { --tfc-pg-cols: 1; }
.tfc-products-grid--cols-2 { --tfc-pg-cols: 2; }
.tfc-products-grid--cols-3 { --tfc-pg-cols: 3; }
.tfc-products-grid--cols-4 { --tfc-pg-cols: 4; }
.tfc-products-grid--cols-5 { --tfc-pg-cols: 5; }
.tfc-products-grid--cols-6 { --tfc-pg-cols: 6; }

/* ── Reset Shoptimizer hover overlay ─────────────────────────────────────── */
li.product.tfc-pg-card,
li.product.tfc-pg-card:hover {
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    transition: none !important;
}

li.product.tfc-pg-card::before,
li.product.tfc-pg-card:hover::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    background-color: transparent !important;
    content: none !important;
}

li.product.tfc-pg-card:hover img,
li.product.tfc-pg-card:not(.product-category):hover img {
    transform: none !important;
}

/* ── Card base ───────────────────────────────────────────────────────────── */
.tfc-pg-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.tfc-pg-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ── Image wrap ──────────────────────────────────────────────────────────── */
.tfc-pg-card__image-wrap {
    position: relative;
}

.tfc-pg-card__image-link {
    display: block;
    background: #f9f9f9;
    text-align: center;
    padding: 16px;
}

.tfc-pg-card__image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ── Circle CTA button ───────────────────────────────────────────────────── */
.tfc-pg-cta {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #00a651;
    color: #fff !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.18s ease, transform 0.18s ease;
    z-index: 1;
    line-height: 1;
}

.tfc-pg-cta:hover {
    background: #007d3d;
    transform: scale(1.1);
    color: #fff !important;
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.tfc-pg-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
}

.tfc-pg-card__category {
    font-size: 12px;
    color: #888;
    margin: 0 0 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tfc-pg-card__title {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 10px;
    line-height: 1.3;
}

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

.tfc-pg-card__title a:hover {
    text-decoration: underline;
}

.tfc-pg-card__price {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-top: auto;
    padding-top: 6px;
}

/* ── Quick-view overlay & modal ──────────────────────────────────────────── */
.tfc-qv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
}

.tfc-qv-overlay.is-open {
    opacity: 1;
}

body.tfc-qv-open {
    overflow: hidden;
}

.tfc-qv-modal {
    background: #fff;
    border-radius: 14px;
    max-width: 880px;
    width: 100%;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    position: relative;
    transform: translateY(24px);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.tfc-qv-overlay.is-open .tfc-qv-modal {
    transform: translateY(0);
}

.tfc-qv-inner {
    padding: 36px 32px 32px;
    position: relative;
}

/* Close button */
.tfc-qv-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    line-height: 1;
    transition: background 0.15s;
    z-index: 2;
}

.tfc-qv-close:hover {
    background: #e5e7eb;
    color: #111;
}

/* Two-column layout */
.tfc-qv-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Gallery */
.tfc-qv-main-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px;
    background: #f9fafb;
    padding: 16px;
    display: block;
    box-sizing: border-box;
}

.tfc-qv-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tfc-qv-thumb {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border: 2px solid #e5e7eb;
    border-radius: 7px;
    cursor: pointer;
    background: #f9fafb;
    padding: 4px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.tfc-qv-thumb.is-active,
.tfc-qv-thumb:hover {
    border-color: #00a651;
}

/* Body */
.tfc-qv-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    padding-right: 28px;
}

.tfc-qv-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
    margin-bottom: 14px;
}

.tfc-qv-body .tfc-product-price {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin-bottom: 14px;
}

.tfc-qv-pline-note {
    font-size: 12px;
    margin-bottom: 10px;
}

.tfc-qv-body .tfc-single-prod-variations {
    margin-bottom: 12px;
}

.tfc-qv-body .tfc-attr-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    margin-bottom: 8px;
    background: #fff;
    cursor: pointer;
}

/* Qty row */
.tfc-qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.tfc-qv-cart-note {
    font-size: 12px;
    color: #777;
}

/* Add to basket */
.tfc-qv-body .tfc-add-to-basket {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: #00a651;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    text-align: center;
}

.tfc-qv-body .tfc-add-to-basket:hover {
    background: #007d3d;
}

.tfc-qv-body .tfc-add-to-basket.disabled,
.tfc-qv-body .tfc-add-to-basket[data-disabled] {
    background: #9ca3af;
    cursor: not-allowed;
}

.tfc-qv-body .tfc-add-to-basket-err {
    color: #c0392b;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .tfc-products-grid { --tfc-pg-cols: 2; }
}

@media (max-width: 700px) {
    .tfc-qv-layout {
        grid-template-columns: 1fr;
    }

    .tfc-qv-inner {
        padding: 24px 16px 20px;
    }
}

@media (max-width: 600px) {
    .tfc-products-grid { --tfc-pg-cols: 1; }
}
