/* Ash Archive View - Product Card Styles (based on SferaLine Design) */

ul.products li.product {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    flex: none !important;
}

.ash-products-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 16px !important;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* Product Card */
.ash-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    height: 100%;
}

.ash-product-card:hover {
    border-color: #f68a34 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    transform: none !important;
}

/* Image */
.ash-card-image-link {
    position: relative;
    display: block;
    min-height: 140px;
    background: #fff;
}

.ash-product-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: #fff;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    aspect-ratio: 1 / 1;
}

/* Sale Badge */
.ash-sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f68a34;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 1;
}

/* Card Body */
.ash-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
    position: relative;
}

/* Title */
.ash-card-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
    line-height: 1.4;
    color: #1d1d1f;
}

.ash-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.ash-card-title a:hover {
    color: #f68a34;
}

/* Brand */
.ash-card-brand {
    font-size: 11px;
    color: #86868b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Specs */
.ash-card-specs {
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 10px;
    min-height: 70px;
    max-height: 70px;
    overflow: hidden;
}

/* Specs Info Icon */
.ash-specs-icon {
    position: absolute;
    top: 3px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.ash-specs-icon:hover {
    background: #f68a34;
    color: #fff;
}

/* Specs Overlay */
.ash-specs-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    padding: 14px;
    border-radius: 0 0 12px 12px;
    overflow-y: auto;
    z-index: 9999;
    font-size: 11px;
}

.ash-specs-overlay.active {
    display: block;
}

/* Когда оверлей активен - отключить pointer-events у всего под ним */
.ash-card-body:has(.ash-specs-overlay.active) > *:not(.ash-specs-overlay) {
    pointer-events: none;
}

.ash-specs-overlay .ash-spec-item {
    margin-bottom: 6px;
    -webkit-line-clamp: unset;
}

.ash-spec-label {
    font-weight: 600;
}

.ash-specs-overlay .ash-specs-loading {
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

/* Custom scrollbar for specs overlay */
.ash-specs-overlay::-webkit-scrollbar {
    width: 4px;
}

.ash-specs-overlay::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 2px;
}

.ash-specs-overlay::-webkit-scrollbar-thumb {
    background: #f68a34;
    border-radius: 2px;
}

.ash-specs-overlay::-webkit-scrollbar-thumb:hover {
    background: #e07b2f;
}

.ash-spec-item {
    color: #6b7280;
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.ash-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    margin-top: auto;
    min-height: 32px;
    position: relative;
}

/* Price */
.ash-card-price {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.ash-card-price span {
    font-size: 12px;
    font-weight: 400;
    color: #86868b;
}

/* Sale prices - стакаем друг над другом */
.ash-card-price.has-sale {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ash-old-price {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
}

.ash-sale-price {
    color: #dc2626;
    font-weight: 700;
    font-size: 16px;
}

/* Stock - оверлей в правом нижнем углу фото */
.ash-card-stock {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 2;
}

.ash-card-stock.in-stock {
    background: #ecfdf5;
    color: #059669;
}

.ash-card-stock.on-backorder {
    background: #fef3e2;
    color: #d97706;
}

.ash-card-stock.out-of-stock {
    background: #fef2f2;
    color: #dc2626;
}

/* Button */
.ash-card-btn {
    width: 100%;
    padding: 10px 14px;
    background: #f68a34;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ash-card-btn:hover {
    background: #e07b2f;
}

.ash-card-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .ash-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ash-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .ash-product-card img {
        height: 120px;
        padding: 12px;
    }
    
    /* Скрываем спеки на мобилке, оставляем только иконку "i" */
    .ash-card-specs {
        display: none;
    }
}
