/* ========== KATALOG TEMA WIDGET STYLES ========== */
.inv-katalog-tema-widget {
    width: 100%;
}

/* ========== 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;
}

/* ========== 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%;
    position: relative;
}

.inv-filter-tab.active {
    transform: translateY(-1px);
}

/* STYLE UNTUK COUNTER DALAM TAB */
.inv-filter-counter {
  margin-left: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EDF1FC;
  color: #002855;
  padding: 0.3em;
  border-radius: 25px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.inv-filter-tab.active .inv-filter-counter {
    background-color: #1976d2;
    color: white;
}

/* ========== 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);
}

.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 */
}

.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;
}

.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;
}

.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 ========== */
.inv-theme-buttons {
    display: flex;
    flex-direction: row;
    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-filter-tab {
        display: flex;
        gap: 4px;
    }
    
    .inv-filter-counter {
        margin-left: 0;
        margin-top: 2px;
        font-size: 10px;
        min-width: 24px;
        height: 18px;
    }
    
    .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;
    }
} */

/* ========== 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;
    }
}

/* ========== COMING SOON STYLES ========== */
.inv-coming-soon {
    opacity: 0.85;
}

.inv-coming-soon .inv-theme-card {
    filter: grayscale(30%);
}

.inv-coming-soon-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 3;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inv-coming-soon-image {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.inv-coming-soon-notice {
    margin: 10px 0;
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

.inv-btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.inv-btn-disabled:hover {
    transform: none !important;
}