/* Appalmed Marketplace Styles */

/* Small Hero Variant */
.hero--small {
    min-height: 40vh;
}

@media (min-width: 768px) {
    .hero--small {
        min-height: 45vh;
    }
}

/* Search Section */
.marketplace-search {
    padding: var(--space-8) 0;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-light);
}

.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-primary);
    transition: var(--transition-all);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.search-label {
    position: absolute;
    top: -10px;
    left: var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    padding: 0 var(--space-2);
}

.search-clear {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-grey-200);
    border: none;
    font-size: var(--font-size-xl);
    line-height: 1;
    color: var(--color-grey-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-all);
}

.search-clear.visible {
    opacity: 1;
}

.search-clear:hover {
    background: var(--color-grey-300);
    color: var(--color-grey-800);
}

/* Products Grid Section */
.marketplace-products {
    padding: var(--space-16) 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-8);
    }
}

/* Product Card */
.product-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-neu-sm);
    transition: var(--transition-all);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-neu-lg);
    transform: translateY(-4px);
}

.product-card__image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: var(--color-bg-secondary);
    overflow: hidden;
}

.product-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-4);
    transition: var(--transition-transform);
}

.product-card:hover .product-card__img {
    transform: scale(1.05);
}

.product-card__content {
    padding: var(--space-6);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card__header {
    margin-bottom: var(--space-3);
}

.product-card__name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
    line-height: var(--line-height-tight);
}

.product-card__brand {
    font-size: var(--font-size-base);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

.product-card__details {
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.product-card__category {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.product-card__category::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary-light);
}

.product-card__quantity {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.product-card__price-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background-color: var(--color-grey-100);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-grey-600);
    margin-bottom: var(--space-4);
}

.product-card__footer {
    margin-top: auto;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    grid-column: 1 / -1;
    color: var(--color-text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    border-left-color: var(--color-primary);
    margin-bottom: var(--space-4);
    animation: spin 1s linear infinite;
}

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

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-4);
    text-align: center;
    color: var(--color-text-secondary);
}

.no-results svg {
    color: var(--color-grey-400);
    margin-bottom: var(--space-4);
}

.no-results h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.no-results p {
    margin-bottom: var(--space-6);
    max-width: 400px;
}

/* Pre-owned Section */
.marketplace-preowned {
    padding: var(--space-16) 0;
    background-color: var(--color-bg-secondary);
}

.preowned-placeholder {
    background: var(--color-bg-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-neu-base);
}

.preowned-placeholder__icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-6);
    color: var(--color-grey-400);
}

.preowned-placeholder__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

.preowned-placeholder__text {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.preowned-placeholder__cta {
    display: inline-block;
}

@media (max-width: 640px) {
    .preowned-placeholder {
        padding: var(--space-8) var(--space-4);
    }
    
    .preowned-placeholder__title {
        font-size: var(--font-size-xl);
    }
    
    .preowned-placeholder__text {
        font-size: var(--font-size-base);
    }
}
