:root {
    --allegro-orange: #00a884; /* Favi Teal/Green */
    --allegro-orange-dark: #008f6f;
    --allegro-orange-light: #33b99d;
    --text-primary: #1a1a1a;
    --text-secondary: #757575;
    --border-color: #e8e8e8;
    --bg-light: #f5f6f8;
    --white: #ffffff;
    --success: #00a884;
    --shadow: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    letter-spacing: -0.5px;
}

.logo:hover {
    opacity: 0.9;
}

.logo-x {
    font-size: 26px;
    font-weight: 800;
    color: var(--allegro-orange);
    display: inline-block;
}

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

/* Menu Button */
.menu-button {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 101;
    flex-shrink: 0;
}

.menu-icon {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-button:hover .menu-icon {
    background-color: var(--allegro-orange);
}

/* Search Bar */
.search-container {
    flex: 1;
    min-width: 200px;
}

.search-form {
    display: flex;
    gap: 8px;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    min-width: 0;
}

.search-input:focus {
    outline: none;
    border-color: var(--allegro-orange);
}

/* Autocomplete */
.autocomplete-container {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-container.show {
    display: block;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--bg-light);
    gap: 12px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: var(--bg-light);
}

.autocomplete-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.autocomplete-content {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.autocomplete-category .autocomplete-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.autocomplete-name {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-category .autocomplete-name {
    font-weight: 600;
}

.autocomplete-name mark,
.autocomplete-name em {
    background-color: var(--allegro-orange-light);
    font-weight: 600;
    font-style: normal;
    padding: 0 2px;
    border-radius: 2px;
}

.autocomplete-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.autocomplete-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-button {
    padding: 12px 20px;
    background: var(--allegro-orange);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
    white-space: nowrap;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.3);
}

.search-button:hover {
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.4);
    transform: translateY(-1px);
}

.search-button:active {
    transform: scale(0.98) translateY(0);
}

/* Category Select */
.category-select,
.category-select-header {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--white);
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 180px;
    max-width: 250px;
}

.category-select:focus,
.category-select-header:focus {
    outline: none;
    border-color: var(--allegro-orange);
}

.category-select-header {
    min-width: 120px;
    max-width: 150px;
    font-size: 14px;
}

.search-with-category {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--allegro-orange);
    color: var(--white);
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.close-menu-button {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-menu-content {
    padding: 16px;
}

.menu-loading,
.menu-error {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.menu-link {
    display: block;
    padding: 14px 40px 14px 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.menu-link:hover {
    color: var(--allegro-orange);
}

.menu-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-arrow:hover {
    color: var(--allegro-orange);
}

.menu-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.menu-back {
    background: transparent;
    border: none;
    color: var(--allegro-orange);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-breadcrumb-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Filters */
.filters {
    background-color: var(--white);
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow);
}

.filters-content {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.filter-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    min-height: 44px;
    background-color: var(--white);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23767676' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Main Content */
.main {
    padding: 32px 0;
    background-color: var(--white);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 16px;
    font-size: 14px;
}

.breadcrumb-link {
    color: var(--allegro-orange);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--allegro-orange-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    user-select: none;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Filters Row */
.filters-row {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group-sort {
    margin-left: auto;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    min-height: 44px;
}

.price-input::placeholder {
    color: var(--text-secondary);
}

.price-separator {
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-button {
    padding: 10px 24px;
    background: var(--allegro-orange);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
    box-shadow: 0 2px 6px rgba(0, 168, 132, 0.25);
}

.filter-button:hover {
    box-shadow: 0 4px 10px rgba(0, 168, 132, 0.35);
    transform: translateY(-1px);
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.active-filters .filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: #FFF4E6;
    border: 1px solid var(--allegro-orange);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
}

.filter-tag span {
    color: var(--text-primary);
}

.filter-tag-remove {
    background: none;
    border: none;
    color: var(--allegro-orange);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.filter-tag-remove:hover {
    background-color: var(--allegro-orange);
    color: var(--white);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.results-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    min-height: 40px;
    background-color: var(--white);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.product-card {
    background: var(--white);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    background: var(--white);
}

.product-card:active {
    transform: translateY(0) scale(0.99);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--bg-light);
    display: block;
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 36px;
}

.product-price-container {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-old-price {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    background-clip: text;
}

.product-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--allegro-orange);
    color: var(--white);
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: box-shadow 0.3s, transform 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 168, 132, 0.25);
}

.product-button:hover {
    box-shadow: 0 4px 10px rgba(0, 168, 132, 0.35);
    transform: translateY(-1px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    min-height: 44px;
    min-width: 44px;
    text-decoration: none;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

.pagination-button:hover:not(.disabled):not(.active) {
    background-color: var(--allegro-orange);
    color: var(--white);
    border-color: var(--allegro-orange);
}

.pagination-button:active:not(.disabled):not(.active) {
    transform: scale(0.95);
}

.pagination-button.active {
    background-color: var(--allegro-orange);
    color: var(--white);
    border-color: var(--allegro-orange);
    cursor: default;
}

.pagination-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--allegro-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

/* Footer */
.footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Mobile autocomplete adjustments */
@media (max-width: 575px) {
    .header-content {
        flex-wrap: nowrap;
    }

    .search-container {
        min-width: 0;
    }

    .logo {
        font-size: 20px;
    }

    .autocomplete-container {
        max-height: 300px;
    }

    .autocomplete-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .autocomplete-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .autocomplete-price {
        font-size: 13px;
        align-self: flex-end;
    }

    /* Mobile filters adjustments */
    .breadcrumbs {
        font-size: 12px;
    }

    .filters-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group-sort {
        margin-left: 0;
    }

    .price-inputs {
        display: flex;
        width: 100%;
    }

    .price-input {
        flex: 1;
        width: 0;
        min-width: 0;
    }

    .filter-button {
        width: 100%;
    }

    /* Home page mobile adjustments */
    .logo-home {
        font-size: 24px;
    }

    .search-section {
        padding: 20px 0;
    }

    .search-form-home {
        flex-direction: column;
        gap: 8px;
    }

    .search-with-category {
        flex-direction: column;
    }

    .category-select {
        width: 100%;
        max-width: 100%;
    }

    .category-select-header {
        display: none;
    }

    .search-input-home {
        width: 100%;
    }

    .search-button-home {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Tablets (Portrait) */
@media (min-width: 576px) {
    .container {
        padding: 0 20px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .product-image {
        height: 200px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-info {
        padding: 14px;
    }

    .logo {
        font-size: 26px;
    }
}

/* Tablets (Landscape) and Small Desktops */
@media (min-width: 768px) {
    .header {
        padding: 15px 0;
    }

    .header-content {
        gap: 24px;
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 28px;
    }

    .search-container {
        max-width: 600px;
    }

    .search-form {
        gap: 10px;
    }

    .search-input {
        padding: 12px 20px;
    }

    .search-button {
        padding: 12px 30px;
    }

    .filters {
        padding: 20px;
        margin: 20px 0;
    }

    .filters-content {
        gap: 15px;
        flex-wrap: nowrap;
    }

    .filter-group {
        min-width: 150px;
    }

    .main {
        padding: 20px 0;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .product-image {
        height: 220px;
    }

    .product-info {
        padding: 15px;
    }

    .product-name {
        font-size: 14px;
        min-height: 40px;
    }

    .product-price {
        font-size: 24px;
    }

    .product-old-price {
        font-size: 16px;
    }

    .pagination {
        gap: 10px;
    }

    .pagination-button {
        padding: 10px 15px;
    }

    /* Hover effects only on desktop */
    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--shadow);
    }

    .product-button:hover {
        background: var(--allegro-orange-dark);
    }

    .product-card:active {
        transform: translateY(-2px) scale(0.98);
    }
}

/* Large Desktops */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .product-image {
        height: 240px;
    }
}

/* Extra Large Screens */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .product-image {
        height: 250px;
    }
}

/* iPhone SE and smaller */
@media (max-width: 375px) {
    .logo {
        font-size: 20px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .search-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .product-image {
        height: 160px;
    }

    .product-name {
        font-size: 12px;
        min-height: 32px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-currency {
        font-size: 13px;
    }

    .product-info {
        padding: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles here if needed */
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 0;
    }

    .product-image {
        height: 140px;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Print styles */
@media print {
    .header,
    .filters,
    .pagination,
    .footer {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-card {
        break-inside: avoid;
    }
}

/* ==================== HOME PAGE STYLES ==================== */

/* Hero Section */
.hero {
    background: var(--white);
    color: var(--text-primary);
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.hero::before {
    display: none;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.95;
    position: relative;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Search Section on Home Page */
.search-section {
    padding: 30px 0;
    background-color: var(--bg-light);
}

.search-form-home {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-input-home {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    min-width: 0;
}

.search-input-home:focus {
    outline: none;
    border-color: var(--allegro-orange);
}

.search-button-home {
    padding: 16px 32px;
    background-color: var(--allegro-orange);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.search-button-home:hover {
    background-color: var(--allegro-orange-dark);
}

.search-button-home:active {
    transform: scale(0.98);
}

/* Sections */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--allegro-orange);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--allegro-orange-dark);
}

/* Recent Searches */
.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tag {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.search-tag:hover {
    background-color: var(--allegro-orange);
    color: var(--white);
    border-color: var(--allegro-orange);
    transform: translateY(-2px);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    border: none;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    height: 450px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.category-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--allegro-orange-light);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.category-link:hover .category-name {
    color: #5B21B6;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-count {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.category-tag-cloud {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    align-content: flex-start;
    line-height: 2;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--allegro-orange) var(--bg-light);
}

.category-tag-cloud::-webkit-scrollbar {
    width: 6px;
}

.category-tag-cloud::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.category-tag-cloud::-webkit-scrollbar-thumb {
    background: var(--allegro-orange);
    border-radius: 3px;
}

.category-tag-cloud::-webkit-scrollbar-thumb:hover {
    background: var(--allegro-orange-dark);
}

.tag-cloud-item {
    display: inline-flex;
    align-items: baseline;
    padding: 4px 10px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-cloud-item:hover {
    background: var(--allegro-orange-light);
    border-color: var(--allegro-orange);
    color: var(--white);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.2);
}

.tag-cloud-item .tag-count {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-left: 4px;
    font-weight: 400;
}

.tag-cloud-item:hover .tag-count {
    color: var(--allegro-orange);
}

/* Messages */
.empty-message,
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.error-message {
    color: #dc3545;
}

/* Mobile optimizations for homepage */
@media (max-width: 767px) {
    .hero {
        padding: 30px 0;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .section {
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 20px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-card {
        height: 400px;
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Tablet */
@media (min-width: 768px) {
    .hero {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Subcategories section */
.subcategories-section {
    margin: 24px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.subcategories-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subcategory-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.subcategory-link:hover {
    background-color: var(--allegro-orange-light);
    border-color: var(--allegro-orange);
    color: var(--allegro-orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.15);
}

.subcategory-count {
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.subcategory-link:hover .subcategory-count {
    color: var(--allegro-orange-dark);
}

@media (max-width: 768px) {
    .subcategories-section {
        margin: 16px 0;
        padding: 16px;
    }

    .subcategory-link {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Additional Product Info */
.product-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-stock {
    background: #e6f6f3;
    color: #00a884;
    border: 1px solid #00a884;
}

.badge-smart {
    background: #00569d;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
}

.badge-smart::before {
    content: 'smart';
    font-style: italic;
    text-transform: lowercase;
}

.product-omnibus {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.product-chart-container {
    height: 30px;
    width: 100%;
    margin-top: 12px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 2px;
}

.chart-bar {
    flex: 1;
    background-color: #00a88433;
    min-width: 4px;
    border-radius: 2px 2px 0 0;
    transition: background-color 0.2s;
    cursor: help;
}

.chart-bar:hover {
    background-color: #00a884;
}
