.grimfaste-products-wrap {
    --grimfaste-bg: linear-gradient(160deg, #090c18 0%, #0b1022 60%, #0f152c 100%);
    --grimfaste-accent: #ffb429;
    --grimfaste-text: #f5f7ff;
    --grimfaste-muted: #b0b7ca;
    --grimfaste-card-border: rgba(255, 180, 41, 0.35);
    --grimfaste-card-bg: rgba(7, 10, 23, 0.86);
    --grimfaste-button-bg: linear-gradient(90deg, #ff9d00 0%, #ffc247 100%);
    --grimfaste-button-text: #121621;
    margin: 1.5rem auto;
    padding: 1.25rem 1rem;
    border-radius: 16px;
    background: var(--grimfaste-bg);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
    max-width: 940px;
}

.grimfaste-products-wrap.grimfaste-products-single {
    max-width: 620px;
}

.grimfaste-products-heading {
    margin: 0 0 1rem;
    color: var(--grimfaste-text);
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    line-height: 1.2;
    text-align: center;
    font-weight: 700;
}

.grimfaste-product-grid {
    display: grid;
    gap: 0.65rem;
}

.grimfaste-product-grid.grimfaste-columns-1 {
    grid-template-columns: 1fr;
}

.grimfaste-product-grid.grimfaste-columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grimfaste-product-grid.grimfaste-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grimfaste-product-grid.grimfaste-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grimfaste-product-card {
    border: 1px solid var(--grimfaste-card-border);
    border-radius: 14px;
    background: var(--grimfaste-card-bg);
    color: var(--grimfaste-text);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.grimfaste-product-image-wrap {
    padding: 0.7rem 0.7rem 0;
}

.grimfaste-product-image {
    width: 100%;
    height: clamp(96px, 11vw, 140px);
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

.grimfaste-product-image--placeholder {
    width: 100%;
    height: clamp(96px, 11vw, 140px);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grimfaste-muted);
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
}

.grimfaste-product-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.grimfaste-product-title {
    margin: 0;
    color: var(--grimfaste-text);
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 700;
}

.grimfaste-product-price {
    color: var(--grimfaste-accent);
    font-weight: 700;
    font-size: 1.05rem;
}

.grimfaste-product-rating {
    color: var(--grimfaste-muted);
    font-size: 0.85rem;
}

.grimfaste-product-description {
    margin: 0;
    color: var(--grimfaste-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.grimfaste-product-features {
    margin: 0;
    padding-left: 1rem;
    color: var(--grimfaste-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.grimfaste-product-features li {
    margin: 0 0 0.35rem;
}

.grimfaste-product-cta,
.grimfaste-affiliate-link {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--grimfaste-button-bg);
    color: var(--grimfaste-button-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.grimfaste-product-cta:hover,
.grimfaste-affiliate-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.grimfaste-product-disclosure {
    margin: 0.15rem 0 0;
    color: rgba(176, 183, 202, 0.8);
    font-size: 0.72rem;
    line-height: 1.35;
}

.grimfaste-template-simple .grimfaste-product-card {
    text-align: center;
}

.grimfaste-template-simple .grimfaste-product-description,
.grimfaste-template-simple .grimfaste-product-price,
.grimfaste-template-simple .grimfaste-product-rating,
.grimfaste-template-simple .grimfaste-product-features {
    display: none;
}

.grimfaste-template-detailed .grimfaste-product-card {
    display: grid;
    grid-template-columns: minmax(190px, 35%) minmax(0, 1fr);
}

.grimfaste-template-detailed .grimfaste-product-image-wrap {
    padding: 1rem;
}

.grimfaste-template-detailed .grimfaste-product-body {
    padding: 1.2rem 1.2rem 1rem 0.5rem;
}

.grimfaste-template-light.grimfaste-products-wrap {
    --grimfaste-bg: transparent;
    --grimfaste-accent: #111827;
    --grimfaste-text: #1f2937;
    --grimfaste-muted: #6b7280;
    --grimfaste-card-border: #d7dde6;
    --grimfaste-card-bg: #ffffff;
    --grimfaste-button-bg: linear-gradient(180deg, #ce4fe8 0%, #a12acb 100%);
    --grimfaste-button-text: #ffffff;
    max-width: none;
    margin: 1.5rem 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.grimfaste-template-light.grimfaste-products-wrap.grimfaste-products-single {
    max-width: 560px;
}

.grimfaste-template-light .grimfaste-products-heading {
    color: #111827;
    text-align: left;
    margin-bottom: 1rem;
}

.grimfaste-template-light .grimfaste-product-grid {
    gap: 1rem;
}

.grimfaste-template-light .grimfaste-product-card {
    border-color: #d7dde6;
    background: #ffffff;
    color: #1f2937;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.grimfaste-template-light .grimfaste-product-image-wrap {
    padding: 1rem 1rem 0;
}

.grimfaste-template-light .grimfaste-product-image,
.grimfaste-template-light .grimfaste-product-image--placeholder {
    height: clamp(160px, 17vw, 220px);
    border-radius: 8px;
}

.grimfaste-template-light .grimfaste-product-image--placeholder {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #6b7280;
}

.grimfaste-template-light .grimfaste-product-body {
    padding: 0.95rem 1rem 1rem;
    gap: 0.7rem;
}

.grimfaste-template-light .grimfaste-product-title {
    color: #1f2937;
    font-size: 0.96rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.grimfaste-template-light .grimfaste-product-price,
.grimfaste-template-light .grimfaste-product-rating,
.grimfaste-template-light .grimfaste-product-description,
.grimfaste-template-light .grimfaste-product-features {
    display: none;
}

.grimfaste-template-light .grimfaste-product-footer {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.grimfaste-template-light .grimfaste-product-source {
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
}

.grimfaste-template-light .grimfaste-product-cta {
    width: auto;
    min-height: 36px;
    padding: 0.45rem 1.05rem;
    border-radius: 8px;
    font-size: 0.82rem;
}

.grimfaste-template-light .grimfaste-product-disclosure {
    color: #6b7280;
    font-size: 0.7rem;
    margin-top: 0.15rem;
}

.grimfaste-products-single .grimfaste-product-card {
    max-width: 460px;
    margin: 0 auto;
}

@media (max-width: 960px) {
    .grimfaste-product-grid.grimfaste-columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grimfaste-product-grid.grimfaste-columns-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grimfaste-template-detailed .grimfaste-product-card {
        grid-template-columns: 1fr;
    }

    .grimfaste-template-detailed .grimfaste-product-body {
        padding: 1rem;
    }

    .grimfaste-template-light .grimfaste-product-image,
    .grimfaste-template-light .grimfaste-product-image--placeholder {
        height: clamp(150px, 26vw, 200px);
    }
}

@media (max-width: 640px) {
    .grimfaste-products-wrap {
        padding: 1rem 0.8rem;
        border-radius: 16px;
    }

    .grimfaste-product-grid.grimfaste-columns-4,
    .grimfaste-product-grid.grimfaste-columns-3,
    .grimfaste-product-grid.grimfaste-columns-2 {
        grid-template-columns: 1fr;
    }

    .grimfaste-product-title {
        font-size: 0.95rem;
    }

    .grimfaste-template-light.grimfaste-products-wrap {
        padding: 0;
    }

    .grimfaste-template-light .grimfaste-product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .grimfaste-template-light .grimfaste-product-cta {
        width: 100%;
    }
}
