/* ============================================
   PRIETO ALIMENTOS - Produtos Page Styles
   ============================================ */

/* Page Header */
.produtos-header {
    padding-top: calc(var(--navbar-height) + var(--space-3xl));
    padding-bottom: var(--space-2xl);
    background: var(--prieto-white);
}

/* ============================================
   Search Bar
   ============================================ */
.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto var(--space-2xl);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: var(--fs-base);
    background: var(--prieto-gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    outline: none;
}

.search-input:focus {
    background: var(--prieto-white);
    border-color: var(--prieto-red);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
}

.search-icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    color: var(--prieto-gray-400);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input:focus ~ .search-icon,
.search-input-wrapper:focus-within .search-icon {
    color: var(--prieto-red);
}

.search-clear {
    position: absolute;
    right: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--prieto-gray-200);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--prieto-gray-500);
    transition: all var(--transition-fast);
}

.search-clear.visible {
    display: flex;
}

.search-clear:hover {
    background: var(--prieto-gray-300);
}

/* Search Suggestions Popup */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 360px;
    overflow-y: auto;
    background: var(--prieto-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--prieto-gray-200);
    z-index: var(--z-dropdown);
    display: none;
    padding: var(--space-sm);
}

.search-suggestions.active {
    display: block;
    animation: suggestionsIn 0.2s ease;
}

@keyframes suggestionsIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    color: var(--prieto-dark);
}

.search-suggestion-item:hover,
.search-suggestion-item.highlighted {
    background: var(--prieto-gray-100);
}

.search-suggestion-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.search-suggestion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggestion-info h4 {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.search-suggestion-info span {
    font-size: var(--fs-xs);
    color: var(--prieto-gray-400);
}

.search-no-results {
    padding: var(--space-xl);
    text-align: center;
    color: var(--prieto-gray-400);
    font-size: var(--fs-sm);
}

/* ============================================
   Category Filter Menu
   ============================================ */
.categories-wrapper {
    margin-bottom: var(--space-2xl);
    overflow: visible;
}

.categories-scroll {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding: var(--space-md) 0;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    min-width: 90px;
    border: 2px solid transparent;
    background: transparent;
}

.category-item:hover {
    background: var(--prieto-gray-100);
}

.category-item.active {
    border-color: var(--prieto-red);
    background: rgba(200, 16, 46, 0.04);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--prieto-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    overflow: hidden;
}

.category-item.active .category-icon {
    background: var(--prieto-red);
    box-shadow: 0 0 20px rgba(200, 16, 46, 0.2);
}

.category-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--prieto-gray-600);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--transition-fast);
}

.category-item.active .category-icon svg {
    stroke: var(--prieto-white);
}

.category-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--prieto-gray-600);
    text-align: center;
    transition: color var(--transition-fast);
}

.category-item.active .category-label {
    color: var(--prieto-red);
}

/* ============================================
   Products Grid
   ============================================ */
.produtos-section {
    padding-bottom: var(--space-5xl);
    background: linear-gradient(180deg, var(--prieto-white) 0%, var(--prieto-gray-100) 100%);
}

.produtos-count {
    font-size: var(--fs-sm);
    color: var(--prieto-gray-500);
    margin-bottom: var(--space-xl);
}

.produtos-count strong {
    color: var(--prieto-dark);
}

.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

/* Product Card */
.product-card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--prieto-dark);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 50px rgba(180, 180, 180, 0.2),
                0 25px 50px rgba(0, 0, 0, 0.05);
    border-color: rgba(200, 200, 200, 0.5);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--prieto-gray-100), var(--prieto-gray-200));
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.product-card-body {
    padding: var(--space-lg);
}

.product-card-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--prieto-red);
    margin-bottom: var(--space-sm);
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.product-card-desc {
    font-size: var(--fs-sm);
    color: var(--prieto-gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--prieto-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-weight {
    font-size: var(--fs-xs);
    color: var(--prieto-gray-400);
}

.product-card-link {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--prieto-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition-fast);
}

.product-card:hover .product-card-link {
    gap: 8px;
}

/* No results */
.produtos-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-4xl);
    color: var(--prieto-gray-400);
}

.produtos-empty svg {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.produtos-empty h3 {
    margin-bottom: var(--space-sm);
    color: var(--prieto-gray-600);
}

/* Skeleton Loading */
.skeleton-pulse {
    background: linear-gradient(90deg, var(--prieto-gray-100) 25%, var(--prieto-gray-200) 50%, var(--prieto-gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    display: block;
}

.product-card--skeleton {
    pointer-events: none;
}

.product-card--skeleton .product-card-image {
    background: var(--prieto-gray-100);
}

/* Product image placeholder */
.product-card-image--placeholder {
    background: linear-gradient(135deg, var(--prieto-gray-100), var(--prieto-gray-200));
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--prieto-gray-300);
}

/* Category count badge */
.category-count {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    background: var(--prieto-gray-200);
    color: var(--prieto-gray-500);
    border-radius: var(--radius-full);
    padding: 1px 6px;
    margin-top: 2px;
    line-height: 1.4;
}

.category-item.active .category-count {
    background: rgba(200, 16, 46, 0.15);
    color: var(--prieto-red);
}

/* Search suggestion thumbnail with image */
.search-suggestion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .categories-scroll {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: var(--space-sm);
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding: var(--space-sm) var(--space-md);
    }
    
    .categories-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .category-item {
        min-width: 80px;
        padding: var(--space-sm);
    }
    
    .category-icon {
        width: 48px;
        height: 48px;
    }
    
    .produtos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-md);
    }
}
