/* Ekartela Container */
.ekartela-container {
    max_width: 100%;
    margin: 0 0 30px 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Tabs Navigation Bar */
.ekartela-tabs {
    display: flex;
    gap: 0;
    /* Continuous look */
    margin-bottom: 0;
    padding: 10px 10px 0 10px;
    background: #fdfdfd;
    /* Very subtle grey for tab track */
    border: 1px solid #ebebeb;
    border-bottom: none;
    /* REMOVE BOTTOM BORDER HERE */
    border-radius: 16px 16px 0 0;
    /* Rounded top for whole container */
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 5;
    /* Sit above content */
}

.ekartela-tab-link {
    background: transparent;
    border: 1px solid transparent;
    /* Reserve space for border */
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    /* Rounded tabs */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    margin-right: 5px;
    bottom: -1px;
    /* Push down to overlap content border */
    z-index: 1;
}

.ekartela-tab-link:hover {
    color: #444;
    background: rgba(0, 0, 0, 0.02);
}

.ekartela-tab-link.active {
    background: #fff;
    /* Solid white to mask line */
    color: #222;
    font-weight: 600;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
    /* Soft subtle lift */
    border: 1px solid #ebebeb;
    border-bottom: 1px solid #fff;
    /* White bottom border masks the content line */
    z-index: 10;
    /* Highest z-index to stay on top */
}

/* Tabs Content Box */
.ekartela-content {
    background: #fff;
    border: 1px solid #ebebeb;
    border-top: 1px solid #ebebeb;
    /* RESTORE TOP BORDER */
    margin-top: -1px;
    /* Pull up to meet tabs */
    border-radius: 0 0 16px 16px;
    /* Rounded bottom */
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    /* Premium Soft Shadow */
    min-height: 200px;
    position: relative;
    z-index: 1;
}

.ekartela-tab-pane {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ekartela-tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Grid Layout */
.ekartela-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    /* Desktop: 10 items per row, but responsive */
    gap: 10px;
    /* Reduced gap slightly to fit 10 items better */
}

/* Grid Item */
.ekartela-item {
    cursor: pointer;
    text-align: center;
    position: relative;
    /* Context for tooltip */
    transition: z-index 0s;
    /* Instant z-index change */
}

/* Remove hover movement but Lift Z-Index */
.ekartela-item:hover {
    z-index: 1000;
    /* Ensure it stays on top of everything (tabs, other items) */
}

.ekartela-swatch {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    /* Softer, larger radius */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    /* Stronger shadow requested */
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    position: relative;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
}

.ekartela-item:hover .ekartela-swatch,
.ekartela-item.selected .ekartela-swatch {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    /* transform: scale(1.02); removed scale effect too if requested "efekt olmasın" */
    border-color: #ddd;
}

.ekartela-tooltip-swatch {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.ekartela-tooltip-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
}

@keyframes zoomInTooltip {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Item Name */
.ekartela-name {
    display: block;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s;
}

.ekartela-item:hover .ekartela-name,
.ekartela-item.selected .ekartela-name {
    color: #111;
    font-weight: 600;
}

/* No Image Placeholder */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f7f7f7;
    color: #bbb;
    font-size: 11px;
    border-radius: 16px;
}

.no-image::after {
    content: 'Görsel Yok';
}

/* Product Results */
.ekartela-results {
    margin-top: 25px;
    /* Reduced from 50px */
    border-top: 2px dashed #f0f0f0;
    padding-top: 25px;
    /* Reduced from 50px */
    display: none;
    /* Hidden by default */
}

/* Product List Layout */
.ekartela-product-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 35px;
}

.ekartela-product {
    background: #fff;
    border: 1px solid #f0f0f0;
    padding: 25px;
    border-radius: 20px;
    /* Very soft corners */
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ekartela-product:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    transform: translateY(-8px);
    border-color: #eaeaea;
}

.ekartela-product img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 10px;
    mix-blend-mode: multiply;
}

.ekartela-product h2 {
    font-size: 15px;
    margin: 10px 0;
    color: #333;
    line-height: 1.5;
    height: 45px;
    overflow: hidden;
}

.ekartela-product .price {
    display: block;
    color: #111;
    font-weight: 700;
    font-size: 17px;
    margin-top: 15px;
    opacity: 0.9;
}

/* Popup Loader */
.ekartela-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.ekartela-popup-content {
    background: #fff;
    padding: 30px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid #eee;
}

.ekartela-popup-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.ekartela-popup-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ekartela-container {
        margin: 0 0 20px 0;
    }

    .ekartela-content {
        padding: 20px 10px;
        /* Less padding on mobile */
    }

    /* 6 Columns for Colors */
    .ekartela-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        /* User requested 6 items */
        gap: 8px;
        /* Tighter gap */
    }

    .ekartela-swatch {
        border-radius: 8px;
        /* Smaller radius for small items */
        margin-bottom: 5px;
    }

    .ekartela-name {
        font-size: 10px;
        /* Smaller text */
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        /* Prevent wrapping if too long */
    }

    /* 2 Columns for Products */
    .ekartela-product-list {
        grid-template-columns: repeat(2, 1fr);
        /* User requested 2 items */
        gap: 15px;
    }

    .ekartela-product {
        padding: 15px;
        border-radius: 12px;
    }

    .ekartela-product h2 {
        font-size: 13px;
        height: 36px;
    }

    .ekartela-product .price {
        font-size: 14px;
        margin-top: 5px;
    }
}

/* DETAIL POPUP STYLES (Added) */
.ekartela-detail-content {
    padding: 40px 30px 30px 30px;
    width: 400px;
    /* Fixed width for better layout */
    max-width: 90vw;
}

#ekartela-detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: color 0.2s;
}

#ekartela-detail-close:hover {
    color: #333;
}

.ekartela-detail-image {
    width: 200px;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    background-color: #f0f0f0;
    /* Default bg */
}

.ekartela-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 25px 0;
}

.ekartela-btn-primary {
    background: #111;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    display: block;
}

.ekartela-btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}