/* =============================================
   CATALOG.CSS — Katalog aplikasi premium (tabbed + horizontal scroll)
   Mengatur tampilan tab kategori, scroll container, kartu aplikasi, pricing, dan tombol pesan.
   ============================================= */

/* --- Apps Catalog Section --- */
.apps-catalog {
    padding: var(--section-padding) 0;
    position: relative;
    background: linear-gradient(180deg, var(--sky-200) 0%, var(--sky-300) 50%, var(--sky-300) 100%);
    overflow: visible;
    /* Prevent clipping of scaled cards */
}

.apps-catalog .section-desc {
    color: var(--sky-700);
}

.apps-catalog .text-gradient {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dekorasi awan di section catalog */
.dc-11 {
    width: 280px;
    height: 280px;
    top: 10%;
    right: -90px;
    background: rgba(255, 255, 255, 0.12);
}

.dc-12 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    left: -50px;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Category Tabs (tombol pill kategori) --- */
.catalog-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding: 4px 20px;
    /* Tambah padding agar shadow di ujung tidak terpotong */
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    /* Ubah ke start agar bisa scroll */
    flex-wrap: nowrap;
    /* Jangan wrap agar horizontal scroll */
}

/* Responsive adjustment: Center tabs on desktop if few items */
@media (min-width: 768px) {
    .catalog-tabs {
        justify-content: center;
    }
}

.catalog-tabs::-webkit-scrollbar {
    display: none;
}

.catalog-tab {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    color: var(--sky-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.catalog-tab:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--sky-400);
    transform: translateY(-2px);
}

/* Tab aktif (terpilih) */
.catalog-tab.active {
    background: var(--gradient-button);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
}

/* --- Scroll Wrapper (container horizontal scroll + tombol navigasi) --- */
.catalog-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tombol navigasi kiri/kanan */
.catalog-scroll-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--cloud-white);
    color: var(--sky-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
    z-index: 5;
}

.catalog-scroll-btn:hover {
    background: var(--gradient-button);
    color: var(--cloud-white);
    transform: scale(1.1);
    box-shadow: var(--shadow-cloud);
}

/* Area scroll horizontal */
.catalog-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 60px calc(50% - 150px);
    /* Centers first/last item */
    /* 150px = half of 300px card width */

    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding: 0;
    /* Let scroll-snap-align: center handle it */

    flex: 1;
    align-items: center;
    /* Offset snap */
    flex: 1;
    align-items: stretch;
    position: relative;
    /* Ensure offsetLeft calculation is relative to this container */
}

.catalog-scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Catalog Card (kartu aplikasi individual) --- */
.catalog-card {
    flex-shrink: 0;
    width: 300px;
    min-height: 340px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);

    /* Transition: Transform VERY FAST for responsiveness */
    transition: transform 0.1s linear, box-shadow 0.3s ease, filter 0.3s ease, opacity 0.3s ease;

    display: flex;
    flex-direction: column;
    will-change: transform, opacity, filter;
    transform-origin: center center;
    border: 1px solid rgba(255, 255, 255, 0.6);

    /* Scroll Snap Logic */
    scroll-snap-align: center;
    /* Always snap to center */
    scroll-snap-stop: always;

    /* Pastikan kartu selalu tampil default, tapi bisa di-hide oleh class .hidden */
    opacity: 1;
    transform: translateZ(0);
    visibility: visible;
}

/* Kartu tersembunyi (Filter Mode) */
.catalog-card.hidden {
    display: none !important;
}

.catalog-card:hover {
    transform: translateY(-6px) !important;
    /* Force override inline styles if any */
    box-shadow: var(--shadow-cloud-hover);
}

/* --- Card Header (icon + nama aplikasi) --- */
.catalog-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.app-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: var(--transition-bounce);
    background: white;
    /* Default bg if image transparent */
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.catalog-card:hover .app-icon {
    transform: scale(1.1) rotate(3deg);
}

.catalog-card-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--deep-blue);
    margin: 0;
    line-height: 1.3;
}

.catalog-subtitle {
    font-size: 12px;
    color: var(--sky-600);
    font-weight: 500;
}

/* --- Plan Rows (baris harga paket) --- */
.catalog-plans {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
    flex-grow: 1;
}

.plan-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(14, 165, 233, 0.15);
    gap: 8px;
    flex-wrap: wrap;
}

.plan-row:last-child {
    border-bottom: none;
}

.plan-name {
    font-size: 13px;
    color: var(--sky-700);
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.plan-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--deep-blue);
    white-space: nowrap;
}

/* Label "No Garansi" */
.no-garansi {
    font-size: 10px;
    font-style: normal;
    color: #ef4444;
    font-weight: 600;
    background: #fef2f2;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* --- Note Badge (badge catatan: garansi, info, warning) --- */
.catalog-note {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.4;
}

.catalog-note.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.catalog-note.warn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.catalog-note.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* --- Order Button (tombol pesan via WhatsApp) --- */
.catalog-order-btn {
    display: block;
    text-align: center;
    padding: 10px 20px;
    background: var(--gradient-button);
    color: white;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    margin-top: auto;
}

.catalog-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    filter: brightness(1.1);
}

/* --- Pricing Section (section harga lama, dipertahankan untuk kompatibilitas) --- */
.pricing {
    padding: var(--section-padding) 0;
    position: relative;
    background: linear-gradient(180deg, var(--sky-300) 0%, var(--sky-200) 50%, var(--sky-200) 100%);
}

.pricing .section-desc {
    color: var(--sky-700);
}

.pricing .text-gradient {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dc-7 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -100px;
    background: rgba(255, 255, 255, 0.15);
}

.dc-8 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: -60px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Pricing Scroll Container --- */
.pricing-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;

    /* Center Alignment Logic */
    padding: 80px calc(50% - 160px);
    /* Increased vertical padding for scale */
    /* 160px = half of 320px card width */

    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding: 0;

    align-items: center;
}

.pricing-scroll-container::-webkit-scrollbar {
    display: none;
}


.pricing-card {
    /* Fixed size for scroll items */
    width: 320px;
    min-height: 480px;
    flex-shrink: 0;

    position: relative;
    background: var(--cloud-white);
    border-radius: var(--radius-lg);
    padding: 48px 36px 40px;
    text-align: center;
    box-shadow: var(--shadow-cloud);

    /* Transition same as catalog */
    transition: transform 0.1s linear, filter 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;

    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Scroll snap logic */
    scroll-snap-align: center;
    will-change: transform, opacity, filter;
    transform-origin: center center;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-cloud-hover);
}

.pricing-card.popular {
    background: linear-gradient(135deg, var(--sky-500) 0%, var(--sky-600) 100%);
    transform: scale(1.05);
    box-shadow: 0 25px 60px rgba(14, 165, 233, 0.4);
    z-index: 2;
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-10px);
}

.popular-badge {
    position: absolute;
    top: 20px;
    right: -30px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 6px 40px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    transform: rotate(45deg);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.pricing-header {
    margin-bottom: 32px;
}

.pricing-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-button);
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
    transition: var(--transition-bounce);
}

.pricing-card.popular .pricing-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.pricing-icon svg {
    color: var(--cloud-white);
}

.pricing-card:hover .pricing-icon {
    transform: scale(1.1) rotate(10deg);
}

.pricing-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 16px;
}

.pricing-card.popular .pricing-header h3 {
    color: var(--cloud-white);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--sky-600);
}

.price-amount {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.pricing-card.popular .price-currency {
    color: rgba(255, 255, 255, 0.8);
}

.pricing-card.popular .price-amount {
    background: linear-gradient(135deg, #fff, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 14px;
    color: var(--sky-600);
}

.pricing-card.popular .price-period {
    color: rgba(255, 255, 255, 0.7);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    text-align: left;
    flex: 1;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    color: var(--sky-800);
    border-bottom: 1px solid var(--sky-100);
}

.pricing-card.popular .pricing-features li {
    color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.pricing-features li svg {
    flex-shrink: 0;
    color: var(--sky-500);
}

.pricing-card.popular .pricing-features li svg {
    color: rgba(255, 255, 255, 0.9);
}

.pricing-features li.disabled {
    opacity: 0.4;
}

.pricing-features li.disabled svg {
    color: var(--sky-400);
}

.btn-outline-pricing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    color: var(--sky-600);
    background: transparent;
    border: 2px solid var(--sky-300);
    border-radius: var(--radius-full);
    cursor: none;
    transition: var(--transition-bounce);
    text-decoration: none;
    width: 100%;
}

.btn-outline-pricing:hover {
    background: var(--gradient-button);
    color: var(--cloud-white);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--shadow-cloud);
}

/* --- Wave Divider (Apps Catalog → About) --- */
.apps-catalog .wave-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
    pointer-events: none;
    transform: rotate(180deg);
}

.apps-catalog .wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

.apps-catalog .wave-divider .shape-fill {
    fill: var(--sky-500);
}