/* Single Product */
.single-product .site-content .ast-container {
    max-width: 1320px;
}

.cnx-product-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.cnx-product-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.cnx-product-page__content,
.cnx-commercial-slot {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.cnx-product-page__content {
    padding: 24px;
}

.cnx-product-page__header h1 {
    margin: 0 0 20px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.2;
}

.cnx-product-page__body {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
    gap: 24px;
}

.cnx-product-gallery__main {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    padding: 16px;
    height: 340px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.cnx-product-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.cnx-product-gallery__thumbs {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.cnx-product-gallery__thumbs img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    object-position: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 6px;
}

.cnx-product-info__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
}

.cnx-product-info__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.95rem;
}

.cnx-product-info__meta a {
    color: inherit;
    text-decoration: none;
}

.cnx-product-info h2 {
    margin: 0 0 14px;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    line-height: 1.3;
}

.cnx-product-info__price {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.cnx-product-info__amount {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.cnx-product-info__amount del {
    color: #94a3b8;
    font-size: 1rem;
}

.cnx-product-info__discount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c2410c;
    font-weight: 700;
}

.cnx-product-info__rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 14px;
    color: #334155;
    font-weight: 700;
}

.cnx-product-info__description {
    color: #475569;
    line-height: 1.75;
    margin-bottom: 16px;
}

.cnx-product-info__cta {
    min-width: 190px;
}

.cnx-commercial-slot {
    position: sticky;
    top: 24px;
    padding: 20px;
}

.cnx-commercial-slot__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cnx-commercial-slot h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.cnx-commercial-slot__badge,
.cnx-ad-card__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #c2410c;
    background: rgba(249, 115, 22, 0.12);
}

.cnx-commercial-slot__subtitle {
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.6;
}

.cnx-commercial-slot p {
    color: #64748b;
    margin: 0;
}

.cnx-ad-list {
    display: grid;
    gap: 12px;
}

.cnx-ad-card,
.cnx-commercial-widget {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 14px;
}

.cnx-ad-card h4,
.cnx-commercial-widget__title {
    margin: 10px 0 6px;
    font-size: 1rem;
    line-height: 1.35;
}

.cnx-ad-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
}

.cnx-ad-card__cta {
    display: inline-flex;
    margin-top: 10px;
    font-size: 0.86rem;
    color: #f97316;
    font-weight: 700;
    text-decoration: none;
}

.cnx-commercial-widget {
    margin-top: 0;
}

.cnx-related-products {
    margin-top: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    padding: 20px;
}

.cnx-related-products--woo .related {
    margin: 0;
}

.cnx-related-products--woo .related > h2 {
    margin: 0 0 14px;
    font-size: 1.35rem;
    line-height: 1.25;
}

.cnx-related-products--woo ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.cnx-related-products--woo ul.products li.product {
    float: none;
    width: auto;
    margin: 0 !important;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.cnx-related-products--woo ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cnx-related-products--woo ul.products li.product a img {
    display: block;
    height: 110px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 8px;
    object-fit: contain;
    object-position: center;
}

.cnx-related-products--woo ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.92rem;
    line-height: 1.35;
}

.cnx-related-products--woo ul.products li.product .button {
    width: 100%;
    margin-top: auto;
}

.cnx-related-products--woo ul.products li.product .price {
    display: none !important;
}

.cnx-related-products__head h3 {
    margin: 0 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.35rem;
}

.cnx-related-products__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.cnx-related-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cnx-related-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    height: 150px;
    padding: 10px;
    overflow: hidden;
}

.cnx-related-card__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.cnx-related-card h4 {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.35;
}

.cnx-related-card h4 a {
    color: #1e293b;
    text-decoration: none;
}

.cnx-related-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cnx-related-card__price {
    font-weight: 700;
    color: #334155;
}

.cnx-related-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ─── Product page responsive breakpoints (must be at end of product.css to win cascade) ─── */

@media (max-width: 1024px) {
    .cnx-product-page__layout {
        grid-template-columns: 1fr;
    }

    .cnx-commercial-slot {
        position: static;
        display: none;
    }
}

@media (max-width: 900px) {
    .cnx-product-page {
        padding: 16px 14px 88px;
        overflow-x: hidden;
    }

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

    .cnx-product-page__content {
        padding: 16px;
    }

    .cnx-product-page__header h1 {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin-bottom: 12px;
    }

    /* h2 repeats the product name — redundant when stacked */
    .cnx-product-info h2 {
        display: none;
    }

    .cnx-product-gallery__main {
        height: 260px;
    }

    .cnx-product-gallery__thumbs img {
        height: 68px;
    }

    .cnx-product-info__amount {
        font-size: 1.5rem;
    }

    .cnx-product-info__cta {
        width: 100%;
        justify-content: center;
        font-size: 1.05rem;
    }

    .cnx-related-products--woo ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cnx-related-products--woo ul.products li.product a img {
        height: 86px;
    }

    .cnx-related-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .cnx-product-page__header h1 {
        font-size: 1.25rem;
    }

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

    .cnx-breadcrumb {
        font-size: 0.78rem;
    }

    .cnx-related-products--woo ul.products,
    .cnx-related-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cnx-related-products--woo ul.products li.product {
        padding: 10px;
    }

    .cnx-related-products--woo ul.products li.product a img {
        height: 78px;
    }
}

@media (max-width: 1100px) and (min-width: 901px) {
    .single-product .cnx-related-products--woo ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
