/* ============================================================================
   COMPONENT STYLES - TECHCRAFT SOLUTIONS
   Reusable UI Components and Interactive Elements
   ============================================================================ */

/* ===== BUTTON COMPONENTS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border: var(--border-width-2) solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-out);
  position: relative;
  overflow: hidden;
  line-height: 1;
  white-space: nowrap;
}

/* Button Sizes */
.btn-sm {
  height: var(--btn-height-sm);
  padding: 0 var(--btn-padding-x-sm);
  font-size: var(--btn-font-size-sm);
}

.btn {
  height: var(--btn-height-base);
  padding: 0 var(--btn-padding-x-base);
  font-size: var(--btn-font-size-base);
}

.btn-lg {
  height: var(--btn-height-lg);
  padding: 0 var(--btn-padding-x-lg);
  font-size: var(--btn-font-size-lg);
}

.btn-xl {
  height: var(--btn-height-xl);
  padding: 0 var(--btn-padding-x-xl);
  font-size: var(--btn-font-size-xl);
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-600);
  border-color: var(--color-primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--text-inverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.product-card-item {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.product-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-content {
    padding: 20px;
}

.product-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.product-card-model {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 15px;
    font-family: var(--font-english);
}

.product-card-specs {
    list-style: none;
    margin-bottom: 20px;
}

.product-card-specs li {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

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

/* Product Filters */
.product-filters {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Product Comparison */
.comparison-tool {
    background: var(--gray-50);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comparison-selected {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.comparison-item {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: 2px solid var(--primary-red);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comparison-remove {
    background: none;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-weight: bold;
}

/* Specifications Table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.spec-table th,
.spec-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.spec-table th {
    background-color: var(--gray-50);
    font-weight: 600;
    color: var(--gray-800);
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table tr:hover {
    background-color: var(--gray-50);
}

/* Form Components */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--primary-red);
    font-size: 14px;
    margin-top: 5px;
}

.form-success {
    color: var(--success-green);
    font-size: 14px;
    margin-top: 5px;
}

/* Quote Basket Items */
.basket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.basket-item-info {
    flex: 1;
}

.basket-item-model {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    font-family: var(--font-english);
}

.basket-item-name {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 2px;
}

.basket-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.quantity-btn {
    background: var(--gray-200);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.quantity-btn:hover {
    background: var(--gray-300);
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 2px;
    font-size: 12px;
}

.basket-item-remove {
    background: none;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 18px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--gray-600);
}

.breadcrumb-item a {
    color: var(--gray-600);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-red);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.pagination-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-close:hover {
    color: var(--primary-red);
}

/* Download Links */
.download-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--gray-50);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    transition: background-color 0.3s ease;
}

.download-link:hover {
    background: var(--gray-100);
    color: var(--primary-red);
}

.download-icon {
    font-size: 18px;
    color: var(--primary-red);
}

.download-info {
    flex: 1;
}

.download-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.download-size {
    font-size: 12px;
    color: var(--gray-500);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid var(--primary-red);
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid var(--accent-orange);
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid var(--primary-blue);
    color: #1e40af;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for components */
@media (max-width: 768px) {
    .comparison-selected {
        flex-direction: column;
    }

    .spec-table {
        font-size: 14px;
    }

    .spec-table th,
    .spec-table td {
        padding: 10px;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .download-links {
        gap: 8px;
    }

    .download-link {
        padding: 8px 12px;
    }
}