/* WooCommerce PC Builder - Android Native UI Style (Material 3) */
:root {
    --pcb-primary: #1976D2;
    --pcb-primary-dark: #1565C0;
    --pcb-primary-light: #E3F2FD;
    --pcb-accent: #00C853;
    --pcb-accent-dark: #00B248;
    --pcb-wa: #25D366;
    --pcb-wa-dark: #1EBE5B;
    --pcb-bg: #F8F9FA;
    --pcb-surface: #FFFFFF;
    --pcb-text-main: #212121;
    --pcb-text-muted: #757575;
    --pcb-border: #EEEEEE;
    --pcb-radius-card: 16px;
    --pcb-radius-sheet: 24px 24px 0 0;
    --pcb-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --pcb-shadow-bottom: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.pc-builder-container {
    max-width: 650px;
    margin: 0 auto;
    background: var(--pcb-bg);
    min-height: 100vh;
    padding-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--pcb-text-main);
    box-sizing: border-box;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* App Bar Khas Android */
.pcb-app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--pcb-surface);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--pcb-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.pcb-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--pcb-text-main);
    letter-spacing: -0.3px;
}

.pcb-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pcb-progress-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--pcb-primary);
    background: var(--pcb-primary-light);
    padding: 2px 8px;
    border-radius: 12px;
}


.pcb-app-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Action Icon Buttons & SVGs (Bulletproof across all WP themes) */
.pcb-app-bar .pcb-icon-btn,
.pcb-icon-btn {
    background: #F5F5F5;
    border: none;
    color: var(--pcb-text-main);
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    touch-action: manipulation !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
}

.pcb-app-bar .pcb-icon-btn svg,
.pcb-icon-btn svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: none !important;
    max-height: none !important;
    margin: auto !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
}

.pcb-icon-btn:active {
    transform: scale(0.92) !important;
}

.pcb-wa-icon-btn,
#pcb-top-wa-btn {
    background: #E8F8EE !important;
}

.pcb-wa-icon-btn:active,
#pcb-top-wa-btn:active {
    background: #D4F3E0 !important;
}

.pcb-wa-icon-btn svg,
#pcb-top-wa-btn svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    fill: #25D366 !important;
    stroke: none !important;
}

.pcb-reset-icon-btn,
#pcb-reset-btn {
    background: #FFF3E0 !important;
}

#pcb-reset-btn:active {
    background: #FFE0B2 !important;
}

.pcb-reset-icon-btn svg,
#pcb-reset-btn svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    fill: none !important;
    stroke: #E65100 !important;
    stroke-width: 2.5px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Cart Sync Banner */
.pcb-cart-banner {
    background: #E8F5E9;
    border: 1px solid #C8E6C9;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #2E7D32;
    font-weight: 600;
}

.pcb-cart-banner-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pcb-cart-banner-link {
    color: #1B5E20;
    text-decoration: underline;
    font-weight: 700;
}

/* Component Slots Container */
.pcb-slots-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pcb-slot-card {
    background: var(--pcb-surface);
    border-radius: var(--pcb-radius-card);
    padding: 16px;
    border: 1px solid var(--pcb-border);
    box-shadow: var(--pcb-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pcb-slot-card.is-empty {
    border: 1.5px dashed #BDBDBD;
    background: #FAFAFA;
}

.pcb-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pcb-slot-name {
    font-weight: 700;
    font-size: 14px;
    color: #424242;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pcb-slot-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pcb-badge-req {
    background: #FFEBEE;
    color: #D32F2F;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.pcb-badge-selected {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Empty State Pick Button (Touch Friendly) */
.pcb-btn-pick {
    width: 100%;
    min-height: 50px;
    padding: 14px;
    border-radius: 12px;
    background: var(--pcb-primary-light);
    color: var(--pcb-primary);
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    touch-action: manipulation;
    transition: background 0.15s ease, transform 0.1s ease;
}

.pcb-btn-pick:active {
    background: #BBDEFB;
    transform: scale(0.98);
}

/* Selected Product Details */
.pcb-item-details {
    display: flex;
    gap: 14px;
    align-items: center;
}

.pcb-item-thumb {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--pcb-border);
    flex-shrink: 0;
    background: #FFF;
}

.pcb-item-info {
    flex-grow: 1;
    min-width: 0;
}

.pcb-item-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    color: var(--pcb-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcb-item-price {
    font-size: 13px;
    color: var(--pcb-text-muted);
}

.pcb-item-subtotal {
    font-size: 15px;
    font-weight: 700;
    color: var(--pcb-primary);
    margin-top: 3px;
}

/* Quantity Stepper Khas Android */
.pcb-stepper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--pcb-border);
}

.pcb-stepper {
    display: flex;
    align-items: center;
    background: #F0F2F5;
    border-radius: 10px;
    overflow: hidden;
    height: 42px;
}

.pcb-btn-step {
    background: transparent;
    border: none;
    width: 44px;
    height: 42px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcb-text-main);
    touch-action: manipulation;
}

.pcb-btn-step:active {
    background: #E4E6EB;
}

.pcb-step-val {
    min-width: 38px;
    padding: 0 4px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}

.pcb-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcb-btn-change {
    background: none;
    border: 1px solid var(--pcb-primary);
    color: var(--pcb-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

.pcb-btn-change:active {
    background: var(--pcb-primary-light);
}

.pcb-btn-remove {
    background: none;
    border: none;
    color: #E53935;
    font-size: 13px;
    font-weight: 600;
    padding: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

/* Button Tambah Slot Lagi */
.pcb-btn-add-more {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border-radius: 10px;
    background: #FFF;
    border: 1.5px dashed var(--pcb-primary);
    color: var(--pcb-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: manipulation;
}

.pcb-btn-add-more:active {
    background: var(--pcb-primary-light);
}

/* Bottom Summary & Actions Bar (Diletakkan di bawah kategori, tidak float) */
.pcb-bottom-bar {
    position: relative;
    margin: 16px;
    margin-top: 8px;
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-card);
    padding: 18px 20px;
    box-shadow: var(--pcb-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 10;
}

.pcb-bottom-summary {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pcb-summary-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pcb-summary-label {
    font-size: 12px;
    color: var(--pcb-text-muted);
    font-weight: 500;
}


.pcb-summary-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--pcb-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.pcb-bottom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pcb-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    min-height: 48px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: manipulation;
    transition: transform 0.1s ease, background 0.15s ease;
}

.pcb-btn:active {
    transform: scale(0.96);
}

.pcb-btn-primary {
    background: var(--pcb-accent);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.35);
}

.pcb-btn-primary:active {
    background: var(--pcb-accent-dark);
}

.pcb-btn-secondary {
    background: #ECEFF1;
    color: #37474F;
    padding: 12px 14px;
}

.pcb-btn-secondary:active {
    background: #CFD8DC;
}

.pcb-btn-wa {
    background: #E8F8EE;
    color: var(--pcb-wa);
    padding: 12px 14px;
}

.pcb-btn-wa:active {
    background: #D4F3E0;
}

/* Bottom Sheet Picker Modal */
.pcb-bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.pcb-bottom-sheet {
    background: var(--pcb-surface);
    width: 100%;
    max-width: 650px;
    max-height: 88vh;
    border-radius: var(--pcb-radius-sheet);
    padding: 12px 18px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    animation: pcbSlideUp 0.28s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes pcbSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pcb-sheet-drag-pill {
    width: 44px;
    height: 5px;
    background: #E0E0E0;
    border-radius: 5px;
    margin: 4px auto 14px;
    cursor: grab;
}

.pcb-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pcb-sheet-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--pcb-text-main);
}

.pcb-sheet-stock-info {
    font-size: 12px;
    color: #2E7D32;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.pcb-sheet-close {
    background: #F5F5F5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #616161;
}

.pcb-sheet-close:active {
    background: #E0E0E0;
}

/* Search Bar in Sheet */
.pcb-sheet-search-wrap {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.pcb-sheet-search-wrap svg {
    position: absolute;
    left: 14px;
    color: var(--pcb-text-muted);
}

.pcb-sheet-search-wrap input {
    width: 100%;
    min-height: 48px;
    padding: 12px 42px;
    border-radius: 12px;
    border: 1.5px solid #EEEEEE;
    background: #F8F9FA;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pcb-sheet-search-wrap input:focus {
    background: #FFF;
    border-color: var(--pcb-primary);
}

.pcb-clear-search {
    position: absolute;
    right: 12px;
    background: #E0E0E0;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #616161;
}

/* Filter Chips (Horizontal Scrollable) */
.pcb-sheet-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pcb-sheet-chips::-webkit-scrollbar {
    display: none;
}

.pcb-chip {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 20px;
    background: #F0F2F5;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--pcb-text-main);
    cursor: pointer;
    touch-action: manipulation;
}

.pcb-chip.is-active {
    background: var(--pcb-primary);
    color: #FFF;
}

/* Product Option List */
.pcb-product-list {
    overflow-y: auto;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.pcb-product-option {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--pcb-border);
    background: #FFF;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.pcb-product-option:active {
    background: var(--pcb-primary-light);
    border-color: var(--pcb-primary);
}

.pcb-product-opt-img {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #FAFAFA;
}

.pcb-product-opt-info {
    flex-grow: 1;
    min-width: 0;
}

.pcb-product-opt-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--pcb-text-main);
}

.pcb-product-opt-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcb-product-opt-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pcb-primary);
}


.pcb-btn-opt-select {
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--pcb-primary);
    color: #FFF;
    border: none;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: manipulation;
}

.pcb-btn-opt-select:active {
    background: var(--pcb-primary-dark);
}

/* Load More in Sheet */
.pcb-load-more-wrap {
    text-align: center;
    padding: 12px 0;
}

.pcb-btn-load-more {
    background: #F0F2F5;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pcb-primary);
    cursor: pointer;
}

/* Android Snackbar / Toast Notification */
.pcb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #323232;
    color: #FFF;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.pcb-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .pcb-app-bar {
        padding: 12px 16px;
    }
    .pcb-title {
        font-size: 18px;
    }
    .pcb-slots-container {
        padding: 12px;
        gap: 10px;
    }
    .pcb-slot-card {
        padding: 14px;
    }
    .pcb-bottom-bar {
        margin: 12px;
        margin-top: 6px;
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .pcb-bottom-summary {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .pcb-summary-price {
        font-size: 18px;
    }
    .pcb-bottom-actions {
        display: flex;
        width: 100%;
        gap: 8px;
    }
    .pcb-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .pcb-btn-primary {
        flex: 1;
        justify-content: center;
    }
}
