/* Typography Overrides */
.category-page,
.category-breadcrumb,
.category-kicker,
.category-title,
.category-description,
.category-meta,
.category-toolbar,
.product-card-modern,
.btn-details {
    font-family: 'Outfit', sans-serif !important;
}

/* Space Grotesk typography for numbers, kicker details, and tag badges */
.category-meta-badge,
.product-type-badge,
.product-package-badge,
.product-campaign-badge-card,
.product-campaign-urgency-badge,
.product-price,
.product-price-original {
    font-family: 'Space Grotesk', sans-serif !important;
}

.category-page {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.category-hero {
    position: relative;
    padding: 64px 0 42px;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(var(--theme-primary-rgb), 0.18), transparent 70%),
        radial-gradient(1200px 600px at 100% 0%, rgba(0,0,0,0.12), transparent 80%),
        linear-gradient(180deg, rgba(0,0,0,0.58), rgba(0,0,0,0.56));
    color: var(--theme-white);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}

.category-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
    pointer-events: none;
}

.category-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
}

.category-breadcrumb {
    justify-content: center;
    margin-bottom: 18px;
}

.category-breadcrumb .breadcrumb-item,
.category-breadcrumb .breadcrumb-item.active,
.category-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.75);
}

.category-breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,0.88) !important;
    text-decoration: none;
}

.category-breadcrumb .breadcrumb-item a:hover {
    color: var(--theme-white);
    text-decoration: underline;
}

.category-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: var(--theme-white);
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 18px;
    backdrop-filter: blur(8px);
}

.category-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 14px;
    color: var(--theme-white);
    text-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.category-description {
    font-size: 1.04rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.86);
    max-width: 760px;
    margin: 0 auto 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.22);
}

.category-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.category-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--theme-white);
    font-size: 0.88rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.category-content {
    padding: 44px 0 64px;
}

.category-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-toolbar-left h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--theme-dark);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.category-toolbar-left p {
    margin: 0;
    color: var(--theme-muted);
    font-size: 0.95rem;
}

.category-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--theme-muted);
    font-size: 0.92rem;
}

.category-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--theme-soft);
    color: var(--theme-primary);
    font-weight: 700;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.12);
}

.product-grid {
    row-gap: 1.5rem;
}

.product-card-modern {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #eaeef2 !important;
    border-radius: 16px !important;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.product-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(var(--theme-primary-rgb), 0.15) !important;
}

.product-card-modern .card-img-top-wrapper {
    aspect-ratio: 4 / 3 !important;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
}

.product-card-modern .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card-modern:hover .card-img-top {
    transform: scale(1.04);
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1rem !important; /* Compact padding matching design */
}

.product-card-topline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.product-type-badge,
.product-package-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.product-type-badge {
    background: rgba(var(--theme-primary-rgb), 0.08);
    color: var(--theme-primary);
}

.product-package-badge {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #e9ecef;
}

.product-campaign-badge-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 30px;
    background: rgba(var(--theme-primary-rgb), 0.08) !important;
    color: var(--theme-primary) !important;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.15) !important;
}

.product-campaign-urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 30px;
    background: rgba(220, 38, 38, 0.06);
    color: #c62828;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.product-card-modern .card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--theme-dark, #1a1e21);
    min-height: 38px;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-card-modern .card-title a {
    color: inherit;
    text-decoration: none;
}

.product-card-modern .card-title a:hover {
    color: var(--theme-primary);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.75rem;
    color: var(--theme-muted, #6c757d);
    margin-bottom: 0.6rem;
}

.product-meta span {
    display: inline-flex;
    align-items: center;
}

.product-meta i {
    color: var(--theme-muted);
}

.product-price-wrap {
    margin-top: auto;
    margin-bottom: 1rem;
    min-height: 38px;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.product-card-modern .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-price, var(--theme-primary));
}

.product-card-modern .product-price-original {
    text-decoration: line-through;
    color: var(--theme-muted, #6c757d);
    font-size: 0.82rem;
}

.product-price-note {
    color: var(--theme-muted, #6c757d);
    font-size: 0.8rem;
}

.btn-details {
    margin-top: auto;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.55rem;
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #ffffff;
    transition: all 0.25s ease;
}

.btn-details:hover {
    background-color: var(--theme-primary-hover, var(--theme-primary));
    border-color: var(--theme-primary-hover, var(--theme-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--theme-primary-rgb), 0.2);
}

/* Fallback Card Styling when image fails */
.card-img-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.75) 100%);
    text-align: left;
}

.card-img-fallback-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.35rem;
}

.card-img-fallback-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}



.empty-category-box {
    max-width: 760px;
    margin: 0 auto;
    background: var(--theme-white);
    border: 1px solid var(--theme-border);
    border-radius: 28px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.04);
    padding: 42px 24px;
    text-align: center;
}

.empty-category-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--theme-primary-rgb), 0.08);
    color: var(--theme-primary);
    font-size: 28px;
    margin-bottom: 16px;
}

.empty-category-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--theme-dark);
    margin-bottom: 10px;
}

.empty-category-text {
    color: var(--theme-muted);
    line-height: 1.8;
    max-width: 620px;
    margin: 0 auto 22px;
}

@media (max-width: 767.98px) {
    .category-hero {
        padding: 44px 0 30px;
    }

    .category-content {
        padding: 32px 0 48px;
    }

    .product-card-body {
        padding: 16px;
    }

    .category-toolbar {
        align-items: flex-start;
    }
}
