/**
 * EZDIGI Tool Affiliater - Frontend CSS
 */

.ez-affiliater-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}
.ez-aff-tabs {
    display: flex;
    justify-content: center;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}
.ez-aff-tab-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    padding: 12px 24px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    outline: none;
}
.ez-aff-tab-btn:hover {
    color: #3b82f6;
}
.ez-aff-tab-btn.active {
    color: #3b82f6;
}
.ez-aff-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #3b82f6;
    border-radius: 3px;
}
.ez-aff-tab-content {
    display: none;
    animation: ezFadeIn 0.4s ease-in-out;
}
.ez-aff-tab-content.active {
    display: block;
}
.ez-aff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
.ez-aff-grid.ez-aff-cols-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
@media (max-width: 1024px) {
    .ez-aff-grid,
    .ez-aff-grid.ez-aff-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .ez-aff-grid,
    .ez-aff-grid.ez-aff-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* 3-Column Layout for larger product imagery */
.ez-aff-grid.ez-aff-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
@media (max-width: 1024px) {
    .ez-aff-grid.ez-aff-cols-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
@media (max-width: 768px) {
    .ez-aff-grid.ez-aff-cols-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
@media (max-width: 480px) {
    .ez-aff-grid.ez-aff-cols-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
.ez-aff-edit-shortcut {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: #fff !important;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.ez-aff-card:hover .ez-aff-edit-shortcut,
.ez-video-card:hover .ez-aff-edit-shortcut,
.ez-aff-img-wrapper:hover .ez-aff-edit-shortcut,
.ez-video-cover-section:hover .ez-aff-edit-shortcut {
    opacity: 1;
    pointer-events: auto;
}
.ez-aff-edit-shortcut:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: translate(-50%, -50%);
    color: #fff !important;
}
.ez-aff-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
}
.ez-aff-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.ez-aff-img-wrapper {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background: #ffffff;
}
.ez-aff-img-wrapper img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transition: transform 0.5s ease !important;
}
.ez-aff-img-wrapper img.ez-aff-crop-left {
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    top: 0 !important;
    left: 0 !important;
    object-fit: fill !important;
}
.ez-aff-img-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}
.ez-aff-card:hover .ez-aff-img-link img {
    transform: scale(1.05) !important;
}
.ez-aff-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.ez-aff-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px 0;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ez-aff-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.ez-aff-title a:hover {
    color: #ff5722;
}
.ez-aff-price-wrapper {
    margin-top: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.ez-aff-price {
    font-size: 16px;
    font-weight: 700;
    color: #ea580c;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.ez-aff-card-no-btn .ez-aff-price-wrapper {
    margin-bottom: 0;
}
.ez-aff-card-no-btn .ez-aff-info {
    padding-bottom: 16px;
}
.ez-aff-buttons {
    margin-top: auto;
    display: flex;
    gap: 10px;
}
.ez-btn {
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.ez-btn-buy {
    background: linear-gradient(135deg, #ff8c00, #ff4500);
    color: #fff;
    box-shadow: 0 2px 4px rgba(255, 69, 0, 0.2);
}
.ez-btn-buy:hover {
    background: linear-gradient(135deg, #ff7b00, #e03d00);
    box-shadow: 0 4px 6px rgba(255, 69, 0, 0.3);
    color: #fff !important;
}
.ez-btn-review {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    flex-grow: 0;
    flex-shrink: 0;
    width: 38px;
    padding: 8px 0;
}
.ez-btn-review:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.ez-aff-empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    grid-column: 1 / -1;
}
@keyframes ezFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
    .ez-aff-tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    .ez-aff-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .ez-aff-card {
        margin-bottom: 0;
    }
    .ez-aff-title {
        font-size: 13px;
        height: 36px;
        margin-bottom: 10px;
    }
    .ez-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    .ez-btn-review {
        width: 32px;
        padding: 6px 0;
    }
    .ez-aff-buttons {
        flex-direction: row;
        gap: 6px;
    }
}

/* Video Review grid styling */
.ez-video-review-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .ez-video-review-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .ez-video-review-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 640px) {
    .ez-video-review-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .ez-video-card {
        margin-bottom: 0;
    }
}
.ez-video-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
}
.ez-video-cover-section {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #000;
}
.ez-video-player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ez-video-cover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.5s ease, filter 0.3s ease;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: scale(1.15);
    z-index: 1;
}
.ez-video-cover-img.ez-video-hq-fallback {
    transform: scale(1.35) !important;
}
.ez-video-player-wrapper:hover .ez-video-cover-img {
    transform: scale(1.18);
    filter: brightness(0.85);
}
.ez-video-player-wrapper:hover .ez-video-cover-img.ez-video-hq-fallback {
    transform: scale(1.38) !important;
    filter: brightness(0.85);
}
.ez-video-overlay-info {
    display: none !important;
}
.ez-video-play-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
    pointer-events: none;
}
.ez-video-play-btn svg {
    display: block;
    width: 100%;
    height: 100%;
}
.ez-video-player-wrapper.playing {
    cursor: default;
}
.ez-video-player-wrapper iframe,
.ez-video-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.ez-video-player-wrapper.ez-pip-active {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    width: 250px !important;
    height: 444px !important;
    padding-bottom: 0 !important;
    z-index: 99999 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    border-radius: 12px !important;
    border: 2px solid #ef4444 !important;
}

/* --- Video Card Product Attachment & 1:1 Left-Crop --- */
.ez-video-products-list {
    position: relative;
    height: 104px;
    overflow: hidden;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    width: 100%;
}

.ez-video-product-link-btn {
    padding: 12px 14px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    border-top: 1px solid #f1f5f9;
    text-decoration: none !important;
    color: #1e293b !important;
    background: #ffffff !important;
    transition: background-color 0.2s, color 0.2s;
    height: 104px;
    min-height: 104px;
    max-height: 104px;
    box-sizing: border-box !important;
    width: 100% !important;
}

.ez-video-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-top: none !important;
    padding-right: 36px !important;
    box-sizing: border-box;
}

.ez-video-slide.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ez-video-product-thumb-wrapper {
    width: 76px !important;
    height: 76px !important;
    min-width: 76px !important;
    min-height: 76px !important;
    max-width: 76px !important;
    max-height: 76px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0 !important;
    background: #ffffff !important;
    aspect-ratio: 1 / 1 !important;
}

.ez-video-product-thumb {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

.ez-video-product-thumb.ez-aff-crop-left {
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    object-fit: cover !important;
    object-position: left top !important;
    border-radius: 0 !important;
}

.ez-video-product-info {
    flex-grow: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
    overflow: hidden !important;
}

.ez-video-product-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #1e293b !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ez-video-btn-buy {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, #ff8c00, #ff4500) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 5px rgba(255, 69, 0, 0.25) !important;
    transition: all 0.2s ease !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-decoration: none !important;
}

.ez-video-product-link-btn:hover {
    background-color: #f8fafc !important;
}

.ez-video-product-link-btn:hover .ez-video-product-title {
    color: #ef4444 !important;
}

.ez-video-product-link-btn:hover .ez-video-btn-buy {
    background: linear-gradient(135deg, #ff7b00, #e03d00) !important;
    box-shadow: 0 4px 8px rgba(255, 69, 0, 0.35) !important;
    transform: translateY(-1px) !important;
}

.ez-video-slider-nav {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.ez-video-slider-nav button {
    background: rgba(0,0,0,0.05) !important;
    border: none !important;
    border-radius: 4px !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    color: #64748b !important;
    transition: all 0.2s !important;
}

.ez-video-slider-nav button:hover {
    background: rgba(0,0,0,0.12) !important;
    color: #ef4444 !important;
}

/* Standalone Video Reviews Container */
.ez-video-review-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.ez-video-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ef4444;
    padding-bottom: 10px;
    margin-bottom: 25px;
}
.ez-video-review-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    text-transform: uppercase;
}
.ez-video-review-channel-link {
    font-size: 14px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ez-video-long-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    transition: all 0.2s ease;
    pointer-events: auto !important;
    white-space: nowrap;
}
.ez-video-long-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    color: #fff;
}

/* --- Centered Infinite Scroll / Load More Styling --- */
.ez-aff-load-more-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 35px auto 25px auto !important;
    padding: 0 !important;
    text-align: center !important;
    clear: both !important;
    grid-column: 1 / -1 !important;
}

.ez-aff-load-more-btn {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    cursor: default;
    min-height: 24px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.ez-aff-load-more-btn.loading {
    opacity: 1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    padding: 10px 22px !important;
    border-radius: 9999px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    gap: 10px !important;
    cursor: default !important;
    pointer-events: none !important;
}

.ez-aff-load-more-btn:not(.loading) {
    height: 10px;
}

.ez-aff-spinner {
    width: 16px !important;
    height: 16px !important;
    border: 2.5px solid #e2e8f0 !important;
    border-top-color: #ef4444 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: ezAffSpin 0.7s linear infinite !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.ez-aff-load-text {
    font-size: 13px !important;
    color: #475569 !important;
    letter-spacing: 0.2px !important;
}

.ez-aff-load-error {
    font-size: 12px !important;
    color: #ef4444 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

@keyframes ezAffSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Equal-Width Tabs for Elementor Nested Tabs & EZ Tabs --- */
.elementor-widget-n-tabs .e-n-tabs-heading,
.e-n-tabs-heading {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.elementor-widget-n-tabs .e-n-tabs-heading .e-n-tab-title,
.e-n-tabs-heading .e-n-tab-title {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    width: auto !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.elementor-widget-n-tabs .e-n-tabs-heading .e-n-tab-title .e-n-tab-title-text,
.e-n-tabs-heading .e-n-tab-title .e-n-tab-title-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    white-space: nowrap !important;
}

@media (max-width: 600px) {
    .elementor-widget-n-tabs .e-n-tabs-heading .e-n-tab-title,
    .e-n-tabs-heading .e-n-tab-title {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .elementor-widget-n-tabs .e-n-tabs-heading .e-n-tab-title .e-n-tab-title-text,
    .e-n-tabs-heading .e-n-tab-title .e-n-tab-title-text {
        font-size: 11px !important;
    }
}

