/* ============================================================
   Package Builder Styles - SwiftPlus
   ============================================================ */

.pb-container {
    max-width: 1400px;
    margin: 90px auto 40px;
    padding: 0 24px;
}

.pb-header {
    text-align: center;
    margin-bottom: 32px;
}

.pb-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.pb-header p {
    color: #64748b;
    font-size: 15px;
}

/* Builder Layout */
.pb-builder-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* Components Panel */
.pb-components-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.pb-category-section {
    border-bottom: 1px solid #e2e8f0;
}

.pb-category-section:last-child {
    border-bottom: none;
}

.pb-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s;
}

.pb-category-header:hover {
    background: #f1f5f9;
}

.pb-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pb-category-icon {
    font-size: 24px;
}

.pb-category-icon-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
}

.pb-category-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.pb-required-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
}

.pb-category-toggle {
    background: none;
    border: none;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: transform 0.2s;
}

.pb-category-section.collapsed .pb-category-toggle {
    transform: rotate(-90deg);
}

.pb-category-section.collapsed .pb-category-content {
    display: none;
}
/* Selected Category Header */
.pb-selected-category {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.pb-selected-category:first-of-type {
    margin-top: 0;
}

/* Category Content */
.pb-category-content {
    padding: 20px;
    background: white;
}

.pb-category-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

/* Component Grid */
.pb-component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.pb-component-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.pb-component-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.pb-component-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.pb-component-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pb-component-image {
    position: relative;
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pb-component-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #e2e8f0;
}

.pb-default-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #22c55e;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 100px;
}

.pb-component-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pb-component-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pb-original-price {
    font-size: 11px;
    color: #64748b;
    text-decoration: line-through;
}

.pb-final-price {
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
}

.pb-outofstock {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #dc2626;
    margin-top: 6px;
}

/* Summary Panel */
.pb-summary-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
    position: sticky;
    top: 90px;
}

.pb-summary-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pb-summary-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.pb-clear-all {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 13px;
    cursor: pointer;
}

.pb-clear-all:hover {
    text-decoration: underline;
}

.pb-selected-components {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.pb-empty-message {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 40px 20px;
    margin: 0;
}

.pb-selected-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 10px;
}

.pb-selected-item.pb-required-missing {
    background: #fef3c7;
}

.pb-selected-item-info {
    flex: 1;
    min-width: 0;
}

.pb-selected-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pb-required-missing .pb-selected-item-name {
    color: #92400e;
}

.pb-selected-item-cat {
    font-size: 11px;
    color: #64748b;
}

.pb-selected-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
}

.pb-remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: transform 0.2s;
}

.pb-remove-item:hover {
    transform: scale(1.1);
}

.pb-summary-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.pb-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.pb-total-price {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
}

.pb-customer-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.pb-customer-info input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.pb-customer-info input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pb-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pb-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pb-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pb-note {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    margin: 12px 0 0 0;
}

/* Empty State */
.pb-empty-state {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.pb-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pb-empty-state h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.pb-empty-state p {
    color: #64748b;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.pb-cta-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.pb-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .pb-builder-wrapper {
        grid-template-columns: 1fr;
    }
    
    .pb-summary-panel {
        position: static;
        max-height: none;
    }
    
    .pb-container {
        padding: 0 16px;
    }
}

@media (max-width: 640px) {
    .pb-component-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .pb-component-card {
        padding: 8px;
    }
    
    .pb-component-info h4 {
        font-size: 12px;
    }
    
    .pb-header h1 {
        font-size: 24px;
    }
    
    .pb-category-title h3 {
        font-size: 14px;
    }
    
    .pb-category-icon-img {
        width: 28px;
        height: 28px;
    }
}