/* PC Builder: Product grid layout */
.devzilla-pc-builder-container .component-products .products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.devzilla-pc-builder-container .product-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,24,40,0.06);
}

.devzilla-pc-builder-container .product-item-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.devzilla-pc-builder-container .product-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.devzilla-pc-builder-container .product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.devzilla-pc-builder-container .product-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.devzilla-pc-builder-container .product-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.devzilla-pc-builder-container .product-short-description {
  font-size: 12px;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

.devzilla-pc-builder-container .product-price {
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
}

.devzilla-pc-builder-container .product-stock {
  font-size: 12px;
  font-weight: 600;
}

.devzilla-pc-builder-container .product-stock.in-stock { color: #059669; }
.devzilla-pc-builder-container .product-stock.out-of-stock { color: #b91c1c; }

.devzilla-pc-builder-container .product-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.devzilla-pc-builder-container .product-actions .button {
  width: 100%;
  text-align: center;
}

.devzilla-pc-builder-container .products-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.devzilla-pc-builder-container .category-search-input {
  width: 100%;
  max-width: 320px;
}

.devzilla-pc-builder-container .products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.devzilla-pc-builder-container .products-pagination .page-info {
  font-size: 13px;
  color: #374151;
}

/* Responsive tweaks */
@media (max-width: 1200px) {
  .devzilla-pc-builder-container .component-products .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .devzilla-pc-builder-container .component-products .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .devzilla-pc-builder-container .component-products .products-grid {
    grid-template-columns: 1fr;
  }
}
/* Main Container */
.devzilla-pc-builder-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Header */
.pc-builder-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pc-builder-header h2 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 28px;
}

.builder-description {
    margin: 0;
    color: #646970;
    font-size: 16px;
}

/* Main Content Layout */
.pc-builder-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.components-selection {
    flex: 2;
    min-width: 300px;
}

.build-summary {
    flex: 1;
    min-width: 300px;
}

/* Component Category */
.component-category {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-title {
    margin: 0;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
    color: #23282d;
}

.category-description {
    margin: 0;
    padding: 0 20px 15px;
    color: #646970;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

/* Component Selector */
.component-selector {
    padding: 15px 20px;
}

.component-dropdown {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    color: #444;
    background-color: #fff;
    cursor: pointer;
}

.selected-component {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-top: 10px;
}

.selected-component-placeholder {
    color: #999;
    text-align: center;
    padding: 20px 0;
}

.selected-component-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.selected-component-image {
    width: 80px;
    height: 80px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.selected-component-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.selected-component-details {
    flex-grow: 1;
}

.selected-component-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #23282d;
}

.selected-component-price {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.selected-component-stock {
    font-size: 13px;
    margin-bottom: 10px;
}

.selected-component-stock.in-stock {
    color: #46b450;
}

.selected-component-stock.out-of-stock {
    color: #dc3232;
}

.selected-component-actions {
    display: flex;
    gap: 10px;
}

/* Products Grid */
.products-loading {
    text-align: center;
    padding: 20px;
    color: #646970;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px 0;
}

.product-item {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-image {
    height: 160px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.product-details {
    padding: 15px;
}

.product-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 8px;
    font-size: 16px;
}

.product-stock {
    font-size: 13px;
    margin-bottom: 12px;
}

.product-stock.in-stock {
    color: #46b450;
}

.product-stock.out-of-stock {
    color: #dc3232;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .button {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    font-size: 13px;
}

/* Build Summary */
.build-summary-inner {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    position: sticky;
    top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.build-summary h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    color: #23282d;
}

.selected-components-list {
    min-height: 200px;
    margin-bottom: 20px;
}

.no-components {
    color: #999;
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

.selected-component-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    align-items: flex-start;
}

.selected-component-item:last-child {
    border-bottom: none;
}

.component-item-image {
    width: 50px;
    height: 50px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.component-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.component-item-details {
    flex-grow: 1;
}

.component-item-title {
    margin: 0 0 3px 0;
    font-size: 14px;
    line-height: 1.4;
}

.component-item-price {
    font-size: 13px;
    color: #0073aa;
    font-weight: 500;
}

.component-item-category {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.component-item-actions {
    margin-left: auto;
}

.remove-component {
    color: #a00;
    text-decoration: none;
    display: inline-block;
    padding: 2px;
    line-height: 1;
}

.remove-component:hover {
    color: #dc3232;
}

/* Build Total */
.build-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.total-price {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.total-label {
    color: #444;
}

.total-amount {
    color: #0073aa;
    font-size: 20px;
}

.build-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.build-actions .button {
    flex: 1;
    text-align: center;
    padding: 10px;
}

/* Compatibility Check */
.build-compatibility {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.build-compatibility h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #444;
}

.compatibility-notes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compatibility-note {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 13px;
    line-height: 1.4;
}

.compatibility-note .dashicons {
    margin-right: 8px;
    margin-top: 2px;
}

.compatibility-note.compatible .dashicons {
    color: #46b450;
}

.compatibility-note.warning .dashicons {
    color: #ffb900;
}

.compatibility-note.error .dashicons {
    color: #dc3232;
}

/* Notices */
.pc-builder-notices {
    margin-top: 20px;
}

/* Buttons */
.button {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    min-height: 30px;
    margin: 0;
    padding: 0 12px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    -webkit-appearance: none;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    background: #f7f7f7;
    border-color: #ccc;
    color: #555;
    text-shadow: none;
    vertical-align: top;
    transition: all 0.2s ease;
}

.button:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #23282d;
}

.button.primary {
    background: #0073aa;
    border-color: #006291;
    color: #fff;
    text-shadow: 0 -1px 1px #006291, 1px 0 1px #006291, 0 1px 1px #006291, -1px 0 1px #006291;
}

.button.primary:hover {
    background: #008ec2;
    border-color: #006291;
    color: #fff;
}

.button:disabled,
.button[disabled] {
    color: #a7aaad;
    background: #f6f7f7 !important;
    border-color: #dcdcde !important;
    text-shadow: none !important;
    cursor: default;
    transform: none !important;
}

/* Responsive */
@media (max-width: 782px) {
    .pc-builder-content {
        flex-direction: column;
    }
    
    .components-selection,
    .build-summary {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    background: url(../images/spinner-2x.gif) no-repeat;
    background-size: 20px 20px;
    float: none;
    opacity: .7;
    filter: alpha(opacity=70);
    width: 20px;
    height: 20px;
    margin: 0 5px 0 0;
    vertical-align: middle;
    animation: spin 1s linear infinite;
}
