/* ========== KATALOG TEMA WIDGET STYLES ========== */
.inv-katalog-tema-widget {
    width: 100%;
    min-height: 400px;
}

/* ========== ELEMENTOR EDITOR FIXES ==========  */
.elementor-editor-active .inv-katalog-tema-widget,
.elementor-editor-preview .inv-katalog-tema-widget {
    pointer-events: auto !important;
}

.elementor-editor-active .inv-themes-grid,
.elementor-editor-preview .inv-themes-grid {
    display: grid !important;
    width: 100% !important;
    /* HAPUS gap dan grid-template-columns dari sini */
    /* Biarkan dikontrol melalui Elementor */
}

/* ========== FILTER TABS ========== */
.inv-filter-tabs {
    display: grid;
    margin-bottom: 20px;
    width: 100%;
}

.inv-filter-tab {
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.inv-filter-tab.active {
    transform: translateY(-1px);
}

/* ========== THEMES GRID ========== */
.inv-themes-grid {
    display: grid;
    width: 100%;
    min-height: 200px;
}

/* ========== THEME CARD ========== */
.inv-theme-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.inv-theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* PERBAIKAN: Header dengan rasio 3:2 */
.inv-theme-header {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
    /* Rasio 3:2 = (2/3)*100% = 66.67% */
    padding-top: 66.67%; /* 3:2 Aspect Ratio */
    height: 0; /* Important untuk aspect ratio */
}

/* PERBAIKAN: Image container */
.inv-theme-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.inv-theme-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.inv-theme-image img:hover {
    transform: scale(1.05);
}

/* ========== BADGES ========== */
.inv-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 2;
    line-height: 1;
}

.inv-color-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.inv-theme-badges {
    display: flex;
    gap: 6px;
    padding: 10px 12px 0;
    flex-wrap: wrap;
    min-height: 32px;
    align-items: center;
}

.inv-theme-badge {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.inv-category-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.inv-style-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ========== THEME CONTENT ========== */
.inv-theme-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 140px; 
}

.inv-theme-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

/* PERBAIKAN: Layout harga default untuk desktop - STYLE YANG LEBIH KUAT */
.inv-theme-price {
    margin-bottom: 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inv-price-regular {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
}

.inv-price-sale {
    font-size: 14px;
    font-weight: bold;
    color: #ff4757;
    white-space: nowrap;
}

/* ========== BUTTONS LAYOUT ========== */
/* DEFAULT: Tombol sejajar (horizontal) di Desktop */
.inv-theme-buttons {
    display: flex;
    flex-direction: row; /* Explicit horizontal */
    gap: 5px;
    margin-top: auto;
    flex-shrink: 0;
}

.inv-theme-button {
    border: none;
    padding: 5px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 1;
}

.inv-btn-preview {
    background: #007bff;
    color: white;
}

.inv-btn-preview:hover {
    background: #0056b3;
}

.inv-btn-order {
    background: #28a745;
    color: white;
}

.inv-btn-order:hover {
    background: #218838;
}

/* ========== LOAD MORE ========== */
.inv-loadmore-container {
    text-align: center;
    margin-top: 30px;
    display: none;
}

.inv-loadmore-container.active {
    display: block;
}

.inv-loadmore-btn {
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 160px;
    background: #007bff;
    color: white;
}

.inv-loadmore-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.inv-loadmore-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.inv-no-themes {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ========== RESPONSIVE MOBILE & TABLET ========== */
/* Hanya atur layout kolom di mobile, JANGAN atur gap di sini */
@media screen and (max-width: 768px) {
    .inv-theme-badges-mobile {
        display: none;
    }
    
    /* PERBAIKAN: Harga di mobile menjadi dua baris terpisah */
    .inv-theme-price {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    
    .inv-price-regular {
        font-size: 12px !important;
    }
    
    .inv-price-sale {
        font-size: 14px !important;
    }
    
    /* Konten tema */
    .inv-theme-content {
        min-height: 130px;
        padding: 8px 6px;
    }
    
    .inv-theme-title {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    /* Tombol vertikal di mobile */
    .inv-theme-buttons {
        flex-direction: column !important;
    }
    
    .inv-theme-button {
        width: 100% !important;
        min-height: 36px;
        font-size: 13px !important;
    }
    
    /* Mobile layout - hanya kolom, gap dikontrol Elementor */
    .inv-filter-tabs {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .inv-themes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* RASIO TETAP 3:2 DI MOBILE */
    .inv-theme-header {
        padding-top: 66.67% !important;
        height: 0 !important;
    }
}

/* Layar sangat kecil */
@media screen and (max-width: 480px) {
    .inv-price-regular {
        font-size: 10px !important;
    }
    
    .inv-price-sale {
        font-size: 12px !important;
    }
    
    .inv-theme-content {
        min-height: 140px !important;
    }
    
    .inv-theme-title {
        font-size: 12px !important;
    }
    
    .inv-theme-button {
        min-height: 34px !important;
        font-size: 11px !important;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) and (min-width: 769px) {
    .inv-filter-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .inv-themes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* RASIO TETAP 3:2 DI TABLET */
    .inv-theme-header {
        padding-top: 66.67%;
        height: 0;
    }
}

/* Desktop Large - HAPUS height spesifik */
/* @media (min-width: 1200px) {
    .inv-theme-header {
        height: 200px;
    }
} */

/* ========== COUNTER DATA STYLES ========== */
.inv-theme-counter {
    margin: 15px 0;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #2271b1;
    font-size: 14px;
    color: #555;
    border: 1px solid #e2e8f0;
}

.inv-counter-text {
    font-weight: 600;
}

.inv-counter-active-filter {
    color: #2271b1;
    font-weight: 600;
    margin-left: 5px;
}

/* Responsive untuk counter */
@media (max-width: 768px) {
    .inv-theme-counter {
        font-size: 13px;
        padding: 8px 12px;
        margin: 10px 0;
    }
}

/* ========== UTILITY STYLES ========== */
.inv-theme-badges,
.inv-theme-price {
    white-space: nowrap;
    overflow: hidden;
}

.inv-theme-badges {
    display: flex;
    flex-wrap: nowrap;
}

/* Placeholder untuk Elementor Editor */
.elementor-editor-active .inv-theme-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Tablet breakpoint in Elementor editor */
@media (max-width: 1024px) {
    .elementor-editor-active .inv-themes-grid,
    .elementor-editor-preview .inv-themes-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .elementor-editor-active .inv-filter-tabs,
    .elementor-editor-preview .inv-filter-tabs {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile breakpoint in Elementor editor */
@media (max-width: 768px) {
    .elementor-editor-active .inv-themes-grid,
    .elementor-editor-preview .inv-themes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .elementor-editor-active .inv-filter-tabs,
    .elementor-editor-preview .inv-filter-tabs {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}