/* Category Rows Layout - Oraimo Style */
/* This file styles the category-based product layout with horizontal scrolling rows */

/* Category Section */
.category-section {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

.category-count {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.category-view-all {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-view-all:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

/* Products Row Container */
.products-row-container {
    position: relative;
    margin: 0 -0.5rem;
}

.products-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.products-row::-webkit-scrollbar {
    display: none;
}

/* Product Card in Row - Compact Design */
.product-card-row {
    flex: 0 0 220px;
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-100);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.product-card-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--gray-200);
}

/* Product Image in Row */
.product-image-row {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: var(--gray-50);
    flex-shrink: 0;
}

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

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

/* Product Content in Row */
.product-content-row {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title-row {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.product-title-row:hover {
    color: var(--primary);
}

/* Product Features in Row - Compact */
.product-features-row {
    margin-bottom: 0.75rem;
}

.feature-item-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.feature-icon-row {
    width: 12px;
    height: 12px;
    color: var(--gray-500);
    flex-shrink: 0;
}

/* Price Section in Row */
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.current-price-row {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.original-price-row {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.discount-percentage-row {
    font-size: 0.625rem;
    color: #dc2626;
    font-weight: 600;
    background: #fef2f2;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Action Buttons in Row */
.product-actions-row {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
}

.product-card-row:hover .product-actions-row {
    opacity: 1;
    transform: translateY(0);
}

.btn-primary-row, .btn-secondary-row {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    min-height: 44px;
    border: none;
    text-decoration: none;
}

.btn-primary-row {
    background: var(--gray-900);
    color: var(--white);
}

.btn-primary-row:hover {
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary-row {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary-row:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Quick Actions in Row */
.quick-actions-row {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 4;
}

.product-card-row:hover .quick-actions-row {
    opacity: 1;
    transform: translateX(0);
}

.quick-action-btn-row {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.quick-action-btn-row:hover {
    background: var(--gray-900);
    color: var(--white);
    transform: scale(1.1);
}

.quick-action-btn-row.wishlist:hover {
    background: #dc2626;
}

.quick-action-btn-row.quick-view:hover {
    background: #059669;
}

/* Stock Badge in Row */
.product-card-row .stock-badge-row {
    position: absolute !important;
    bottom: 0.5rem !important;
    left: 0.5rem !important;
    top: auto !important;
    right: auto !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.25rem !important;
    font-size: 0.625rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1;
    z-index: 3;
    color: var(--white);
    box-shadow: none !important;
}

.product-card-row .stock-badge-row.in-stock {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.product-card-row .stock-badge-row.out-of-stock {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

/* Product Badges in Row */
.product-badges-row {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.25rem;
    z-index: 3;
}

.product-badge-row {
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1;
    color: var(--white);
}

.product-badge-row.new {
    background: linear-gradient(135deg, #10b981, #059669);
}

.product-badge-row.sale {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.product-badge-row.hot {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Scroll Arrows for Category Rows */
.category-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 5;
    opacity: 0;
    visibility: hidden;
}

.category-scroll-arrow:hover {
    border-color: var(--gray-400);
    color: var(--gray-900);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.products-row-container:hover .category-scroll-arrow {
    opacity: 1;
    visibility: visible;
}

.category-scroll-arrow.left {
    left: -20px;
}

.category-scroll-arrow.right {
    right: -20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-section {
        padding: 0 0.5rem;
        margin-bottom: 2rem;
    }
    
    .category-header {
        margin-bottom: 1rem;
        padding: 0 0.25rem;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .products-row {
        gap: 0.75rem;
        padding: 0.25rem;
    }
    
    .product-card-row {
        flex: 0 0 240px;
        min-height: 340px;
    }
    
    .product-image-row {
        height: 160px;
    }
    
    .product-content-row {
        padding: 0.75rem;
    }
    
    .product-title-row {
        font-size: 0.875rem;
    }
    
    .current-price-row {
        font-size: 1.125rem;
    }
    
    .btn-primary-row, .btn-secondary-row {
        padding: 0.625rem 0.875rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .category-scroll-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .category-scroll-arrow.left {
        left: -18px;
    }
    
    .category-scroll-arrow.right {
        right: -18px;
    }
}

@media (max-width: 480px) {
    .product-card-row {
        flex: 0 0 200px;
        min-height: 320px;
    }
    
    .product-image-row {
        height: 140px;
    }
    
    .product-content-row {
        padding: 0.625rem;
    }
    
    .product-title-row {
        font-size: 0.8125rem;
    }
    
    .current-price-row {
        font-size: 1rem;
    }
}

/* Loading Animation for Category Rows */
.category-section.loading {
    opacity: 0.7;
    pointer-events: none;
}

.products-row.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Empty State */
.category-section.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.category-section.empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.category-section.empty .empty-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.category-section.empty .empty-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Category Navigation Styles */
.category-navigation {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.category-navigation::-webkit-scrollbar {
    height: 6px;
}

.category-navigation::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.category-navigation::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.category-navigation::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.category-nav-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-nav-item:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.category-nav-item.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.category-nav-item.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Mobile responsive category navigation */
@media (max-width: 768px) {
    .category-navigation {
        padding: 0.75rem 0;
        gap: 0.375rem;
    }
    
    .category-nav-item {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Category section scroll behavior */
.category-section {
    scroll-margin-top: 100px;
}

/* Smooth scrolling for category navigation */
html {
    scroll-behavior: smooth;
}
