/* Premium Affiliate Products Redesign */

.tem-premium-section {
    padding: 46px 0;
    background-color: #f9f9fa;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tem-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Premium Centered Header */
.tem-section-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tem-header-content {
    max-width: 700px;
}

.tem-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #e6f7f0;
    color: #0b9e61;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.tem-header-content h2 {
    font-weight: 500;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    color: #0F172A;
    margin-bottom: 16px;
    line-height: 1.2;
}

.tem-subtitle {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    font-weight: 400;
    margin: 0 auto !important;
    text-align: center !important;
    max-width: 830px !important;
}

.tem-header-action {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.tem-view-all-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 28px !important;
    border: none !important;
    background-color: #0F172A !important;
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 30px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.tem-view-all-btn:hover {
    background: #1E293B !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25) !important;
}

@media (max-width: 1024px) {
    .tem-header-action {
        position: relative;
        top: auto;
        transform: none;
        margin-top: 24px;
    }
}

/* Premium Carousel Wrapper */
.tem-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
}

.tem-carousel-btn {
    display: none !important;
}

/* 2-Row Grid Layout: 4 Columns Desktop, 3 Columns Tablet, 2x2 Carousel Pages Mobile */
.tem-product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    overflow: visible !important;
    padding: 12px 0 !important;
    width: 100%;
    margin: 0 !important;
}

.tem-carousel-page {
    display: contents !important;
}

.tem-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    height: 100%;
}

@media (max-width: 1024px) {
    .tem-product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    .tem-carousel-wrapper {
        position: relative !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    /* 2 by 2 Horizontal Swipeable Carousel (Used in homepage/shortcode carousel wrapper) */
    .tem-carousel-wrapper .tem-product-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        padding: 4px 0 10px 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0 !important;
    }

    .tem-carousel-wrapper .tem-product-grid::-webkit-scrollbar {
        display: none !important;
    }

    .tem-carousel-page {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, auto) !important;
        gap: 10px !important;
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
        box-sizing: border-box !important;
        padding: 0 2px !important;
    }

    /* Standard / Archive Product Grid: Smooth Vertical Scrolling Feed on Mobile */
    .tem-product-grid:not(.tem-carousel-wrapper .tem-product-grid),
    .tem-archive-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        padding: 8px 0 24px 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
    }

    .tem-card {
        scroll-snap-align: start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 16px !important;
        box-sizing: border-box !important;
        background: #fff;
    }

    .tem-card-img-wrap {
        padding-top: 72% !important;
    }

    .tem-card-content {
        padding: 8px 8px 10px 8px !important;
    }

    .tem-card-title {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
    }

    .tem-card-desc {
        font-size: 0.7rem !important;
        margin-bottom: 5px !important;
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .tem-card-price-row {
        margin-bottom: 5px !important;
        min-height: 20px !important;
    }

    .tem-buy-btn {
        padding: 5px 8px !important;
        font-size: 0.72rem !important;
        border-radius: 6px !important;
    }

    .tem-container {
        padding: 0 14px !important;
    }

    .tem-premium-section {
        padding: 26px 0 !important;
    }

    .tem-section-header {
        margin-bottom: 14px !important;
    }

    .tem-header-content h2 {
        font-size: clamp(20px, 5.2vw, 23px) !important;
        font-weight: 500 !important;
        color: #0F172A !important;
        line-height: 1.25 !important;
        letter-spacing: -0.3px !important;
        margin-bottom: 6px !important;
    }

    .tem-subtitle {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }
}

.tem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.tem-card-img-wrap {
    position: relative;
    padding-top: 72%;
    /* 4:3 Aspect Ratio for prominent, larger product images */
    overflow: hidden;
    background-color: #f4f4f4;
}

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

.tem-card:hover .tem-card-img {
    transform: scale(1.05);
}

.tem-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 2;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tem-card-content {
    padding: 11px 14px 13px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.tem-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0b1c2c;
    margin: 0 0 4px 0;
    line-height: 1.25;
}

@media (max-width: 768px) {
    .tem-card-content {
        padding: 8px 8px 10px 8px !important;
    }

    .tem-card-title {
        font-size: 0.8rem !important;
        margin-bottom: 3px !important;
        line-height: 1.2 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tem-badge {
        font-size: 0.6rem !important;
        padding: 3px 7px !important;
        top: 8px !important;
        left: 8px !important;
    }
}

.tem-card-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .tem-card-desc {
        font-size: 0.72rem !important;
        margin-bottom: 6px !important;
        line-height: 1.25 !important;
    }
}

/* Pricing & Affiliate Logo Section */
.tem-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 24px;
    margin-top: auto;
}

.tem-prices {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
}

.tem-price-regular {
    color: #999;
    text-decoration: line-through;
    font-size: 0.78rem;
}

.tem-price-sale {
    color: #0b9e61;
    /* matching green theme */
    font-weight: 700;
    font-size: 0.92rem;
}

.tem-affiliate-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 90px;
    padding-right: 6px;
}

.tem-affiliate-logo {
    max-width: 75px;
    max-height: 32px;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .tem-card-price-row {
        margin-bottom: 8px !important;
        min-height: 24px !important;
    }

    .tem-price-regular {
        font-size: 0.7rem !important;
    }

    .tem-price-sale {
        font-size: 0.82rem !important;
    }

    .tem-affiliate-logo-wrap {
        max-width: 65px !important;
        padding-right: 3px !important;
    }

    .tem-affiliate-logo {
        max-width: 52px !important;
        max-height: 24px !important;
    }
}

.tem-discount {
    display: none;
}

.tem-buy-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #0b1c2c;
    color: #fff;
    padding: 8px 0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

@media (max-width: 768px) {
    .tem-buy-btn {
        padding: 6px 0 !important;
        font-size: 0.75rem !important;
    }
}

/* Make card content clickable without overlaying slider */
.tem-card-content {
    position: relative;
    z-index: 5;
    padding: 11px 14px 13px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.tem-buy-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #0b1c2c;
    color: #fff;
    padding: 7px 0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 6;
}

.tem-buy-btn:hover {
    background: #333;
    color: #fff;
}

/* ==========================================================================
   Product Card Multiple Image Slider Styles
   ========================================================================== */
.tem-card-img-wrap {
    position: relative !important;
    padding-top: 72% !important;
    overflow: hidden !important;
    background-color: #f4f4f4;
    z-index: 15 !important;
    user-select: none;
    -webkit-user-select: none;
}

.tem-card-img-wrap .tem-slide-link,
.tem-card-img-wrap .tem-img-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.tem-card-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    z-index: 10 !important;
}

.tem-card-slider-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    height: 100% !important;
    transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1) !important;
    will-change: transform;
}

.tem-card-slide {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.tem-card-slide .tem-slide-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    z-index: 5 !important;
}

.tem-card-slide img.tem-card-img,
.tem-card-img-wrap img.tem-card-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.45s ease !important;
    display: block !important;
}

.tem-card:hover .tem-card-slide img.tem-card-img,
.tem-card:hover .tem-card-img-wrap img.tem-card-img {
    transform: scale(1.05);
}

/* Slider Nav Arrows */
.tem-slider-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #1e293b !important;
    font-size: 12px !important;
    cursor: pointer !important;
    z-index: 40 !important;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease !important;
    padding: 0 !important;
    outline: none !important;
    pointer-events: auto !important;
}

.tem-card:hover .tem-slider-arrow {
    opacity: 1 !important;
}

@media (max-width: 1024px) {
    .tem-slider-arrow {
        opacity: 0.95 !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

.tem-slider-prev {
    left: 8px !important;
}

.tem-slider-next {
    right: 8px !important;
}

.tem-slider-arrow:hover {
    background: #ffffff !important;
    color: #0b9e61 !important;
    transform: translateY(-50%) scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.tem-slider-arrow:active {
    transform: translateY(-50%) scale(0.92) !important;
}

/* Slider Dots */
.tem-slider-dots {
    position: absolute !important;
    bottom: 8px !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    z-index: 40 !important;
    pointer-events: auto !important;
}

.tem-slider-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.65) !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    display: inline-block !important;
    outline: none !important;
    pointer-events: auto !important;
}

.tem-slider-dot:hover {
    background: #ffffff !important;
    transform: scale(1.25) !important;
}

.tem-slider-dot.active {
    background: #ffffff !important;
    width: 18px !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

/* Ensure Badge is on top of slider */
.tem-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 35 !important;
    pointer-events: none !important;
}