.pcb-container {
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
}

.pcb-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.pcb-tab {
    background: #f1f1f1;
    border: none;
    padding: 10px 20px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: 15px 15px 0 0;
    font-weight: 600;
}

.pcb-tab.active {
    background: #8fc440;
    color: white;
}

.pcb-tab-content {
    display: none;
    padding: 20px 0;
}

.pcb-tab-content.active {
    display: block;
}

.pcb-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 0px;
}

.pcb-component-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s ease;
}

.pcb-component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.pcb-card-header {
    background: #777777;
    padding: 15px 20px;
    color: white;
    text-align: center;
}

.pcb-card-header h3 {
    margin: 0;
    font-size: 18px;
}

.pcb-card-body {
    padding: 20px;
}

.pcb-selected-preview {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    min-height: 80px;
}

.pcb-selected-info {
    flex: 1;
    text-align: center;
}

.pcb-select-button {
    width: 100%;
    padding: 12px;
    background: #8fc440;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.pcb-select-button:hover {
    background: #79a536;
}

.pcb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.pcb-modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.pcb-close-modal {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 30px;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.pcb-close-modal:hover {
    color: #d63031;
}

/* استایل هدر ثابت مودال */
.pcb-modal-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pcb-modal-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    text-align: center;
    color: #333;
}

/* استایل بخش جستجو - بدون دکمه */
.pcb-search-box {
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#pcb-search-input {
    width: 100%;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    direction: rtl;
    height: 46px;
    box-sizing: border-box;
}

#pcb-search-input:focus {
    outline: none;
}

.pcb-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.pcb-parts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pcb-part-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    height: 280px;
    display: flex;
    flex-direction: column;
}

.pcb-part-item:hover {
    background: #f9f9f9;
    border-color: #8fc440;
    transform: translateY(-5px);
}

.pcb-part-image {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pcb-part-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.pcb-product-link {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s;
}

.pcb-product-link:hover {
    background: #8fc440;
    transform: scale(1.1);
}

.pcb-product-link .dashicons {
    font-size: 16px;
    width: auto;
    height: auto;
}

.pcb-part-details {
    text-align: center;
    margin-top: 10px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pcb-part-details h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    line-height: 1.4;
    max-height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pcb-part-price {
    color: #c00;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

.pcb-out-of-stock {
    opacity: 0.7;
    position: relative;
}

.pcb-out-of-stock-label {
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 5px;
    display: inline-block;
}

.pcb-summary {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pcb-summary h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: #333;
    font-size: 22px;
}

.pcb-selected-parts {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.pcb-part {
    padding: 12px;
    background: white;
    border: 1px solid #eee;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pcb-part-title {
    font-weight: 600;
}

.pcb-part-price {
    color: #c00;
    font-weight: bold;
}

.pcb-total-price {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 2px solid #eee;
    text-align: left;
}

.pcb-total-price span {
    color: #c00;
}

.pcb-compatibility-errors {
    margin: 20px 0;
    padding: 20px;
    background: #fff8e5;
    border-left: 4px solid #ffbb00;
    border-radius: 6px;
}

.pcb-error {
    color: #d63638;
    margin: 10px 0;
    padding: 8px;
    background: #ffebeb;
    border-radius: 4px;
    border-right: 3px solid #d63638;
}

.pcb-success {
    color: #00a32a;
    margin: 10px 0;
    padding: 8px;
    background: #edfff3;
    border-radius: 4px;
    border-right: 3px solid #00a32a;
}

.pcb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pcb-add-to-cart {
    background: #8fc440;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.pcb-add-to-cart:hover {
    background: #7eac39;
}

.pcb-save-config-box {
    display: flex;
    gap: 10px;
    flex: 1;
}

#pcb-config-name {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 25px;
}

.pcb-save-config,
.pcb-share-config {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.pcb-save-config:hover,
.pcb-share-config:hover {
    background: #e0e0e0;
}

.pcb-hide-prices .pcb-price {
    display: none !important;
}

@media (max-width: 1200px) {
    .pcb-parts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .pcb-parts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pcb-components-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .pcb-selected-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .pcb-tabs {
        flex-wrap: wrap;
    }
    
    .pcb-tab {
        flex: 1;
        min-width: 100px;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .pcb-actions {
        flex-direction: column;
    }
    
    .pcb-parts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pcb-part-item {
        height: 250px;
    }
    
    .pcb-part-image {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .pcb-parts-grid {
        grid-template-columns: 1fr;
    }
    
    #pcb-search-input {
        padding: 10px 15px;
        font-size: 14px;
        height: 42px;
    }
    
    .pcb-part-item {
        height: 220px;
    }
    
    .pcb-part-image {
        height: 130px;
    }
    
    .pcb-part-details h4 {
        font-size: 14px;
        max-height: 40px;
    }
}