/* Item Grid Layout */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-large);
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-large);
}

.item-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-medium);
    padding: var(--spacing-small) var(--spacing-medium);
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.items-per-page, .sort-control {
    display: flex;
    align-items: center;
}

.items-per-page label, .sort-control label {
    margin-right: var(--spacing-small);
    font-weight: bold;
    color: var(--text-color);
}

.item-card {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    position: relative;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(139, 119, 85, 0.2);
}

.item-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.item-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image img {
    transform: scale(1.05);
}

.item-image.no-image {
    color: #999;
    font-style: italic;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-details {
    padding: var(--spacing-medium);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-name {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: var(--spacing-small);
    color: var(--text-color);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-catchcopy {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: var(--spacing-small);
    font-style: italic;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-meta {
    margin-bottom: var(--spacing-small);
}

.item-meta p {
    margin: var(--spacing-small) 0;
    display: flex;
    justify-content: space-between;
}

.item-price .value {
    color: #d9534f;
    font-weight: bold;
}

.item-weight .value, .item-shop .value {
    font-weight: bold;
}

.item-cost-performance {
    margin-bottom: var(--spacing-medium);
    padding-top: var(--spacing-small);
    border-top: 1px dashed var(--border-color);
}

.cp-value {
    display: flex;
    justify-content: space-between;
}

.cp-value .value {
    font-weight: bold;
    color: var(--secondary-color);
}

.item-link {
    display: block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-top: auto;
}

.item-link:hover {
    background-color: var(--primary-hover);
    color: white;
    text-decoration: none;
}

.no-results {
    text-align: center;
    padding: var(--spacing-large);
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .item-image {
        height: 150px;
    }
    
    .item-list-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-small);
    }
}

@media (max-width: 480px) {
    .item-grid {
        grid-template-columns: 1fr;
    }
}
