/* frontend/static/css/pages/categories.css */

/* Hero / Search Section */
.hero-search {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    padding: 80px 0;
    text-align: center;
}

.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-wrapper input {
    flex: 1;
    padding: 18px 24px;
    border: none;
    font-size: 16px;
    outline: none;
    font-family: inherit;
}

.search-wrapper input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: var(--white);
    border: none;
    padding: 0 28px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #f0f0f0;
}

/* ── Product Suggestions ──────────────────────────────────── */

.suggestions-section {
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 100%);
    padding: 48px 0 52px;
    border-bottom: 1px solid var(--border);
}

.suggestions-groups-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.suggestions-group {
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border);
    min-width: 0; /* prevent blowout in grid cell */
}

/* ── Group title bar ────────────────── */

.suggestions-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 2px solid;
}

.suggestions-title--green { border-bottom-color: #86efac; }
.suggestions-title--red   { border-bottom-color: #fca5a5; }

.suggestions-title__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestions-title--green .suggestions-title__icon {
    background: #dcfce7;
    color: #166534;
}

.suggestions-title--red .suggestions-title__icon {
    background: #fee2e2;
    color: #991b1b;
}

.suggestions-title > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggestions-title strong {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.1;
}

.suggestions-title--green strong { color: #166534; }
.suggestions-title--red   strong { color: #991b1b; }

.suggestions-title em {
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

/* ── Horizontal track ───────────────── */

.suggestions-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.suggestions-track::-webkit-scrollbar { height: 3px; }
.suggestions-track::-webkit-scrollbar-track { background: transparent; }
.suggestions-track::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* ── Magazine-style card ────────────── */

.suggestion-card {
    position: relative;
    flex: 0 0 155px;
    height: 220px;
    scroll-snap-align: start;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    background: #1a1a2e;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    transition: transform 0.25s, box-shadow 0.25s;
    display: block;
}

.suggestion-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

/* gradient overlay — bottom-to-top dark fade */
.suggestion-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.78) 0%,
        rgba(0, 0, 0, 0.18) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ── Image fills the whole card ──────── */

.suggestion-card__img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.suggestion-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.38s ease;
}

.suggestion-card:hover .suggestion-card__img-wrap img {
    transform: scale(1.09);
}

.suggestion-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.3;
    background: #1a1a2e;
}

/* ── Top badge ───────────────────────── */

.suggestion-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.suggestion-card--green .suggestion-card__badge {
    background: rgba(220, 252, 231, 0.9);
    color: #166534;
}

.suggestion-card--red .suggestion-card__badge {
    background: rgba(254, 226, 226, 0.9);
    color: #991b1b;
}

/* ── Text overlay at bottom ──────────── */

.suggestion-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 12px 12px 14px;
}

.suggestion-card__title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px;
    line-height: 1.35;
}

.suggestion-card__price {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    opacity: 0.92;
}

/* ── Responsive ──────────────────────── */

@media (max-width: 768px) {
    .suggestions-groups-wrap {
        grid-template-columns: 1fr;
    }
    .suggestion-card {
        flex: 0 0 140px;
        height: 196px;
    }
}

/* Categories Grid - Simple Cards */
.categories-section {
    padding: 60px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}
.category-card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.category-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
}

.category-placeholder {
    width: 80px;
    height: 80px;
    background: var(--light-gray);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

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

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-gradient-start);
}

@media (max-width: 768px) {
    .category-img, .category-placeholder {
        width: 60px;
        height: 60px;
    }
    .category-name {
        font-size: 16px;
    }
}