/* ========== EDUCATIONAL KITS MARKETPLACE STYLES ========== */

:root {
    --kit-primary: #6366f1;
    --kit-primary-hover: #4f46e5;
    --kit-accent: #f59e0b;
    --kit-bg-soft: #f8fafc;
    --kit-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --kit-card-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.kits-main-content {
    background-color: var(--kit-bg-soft);
    padding-bottom: 5rem;
}

/* Hero Section */
.kits-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    padding: 6rem 1.5rem;
    text-align: center;
    color: white;
    margin-bottom: -4rem;
    position: relative;
    overflow: hidden;
    /* Background image support */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark overlay for text readability when banner image is present */
.kits-hero.has-banner-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(30, 27, 75, 0.85) 0%,
            rgba(49, 46, 129, 0.75) 50%,
            rgba(30, 27, 75, 0.85) 100%);
    z-index: 1;
}

/* Decorative gradient blob - only show when no banner image */
.kits-hero:not(.has-banner-image)::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    transform: rotate(30deg);
}

/* Additional decorative element for banner images */
.kits-hero.has-banner-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(248, 250, 252, 1) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.kits-hero-content {
    position: relative;
    z-index: 5;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #e0e7ff;
}

.kits-page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.kits-page-subtitle {
    font-size: 1.25rem;
    color: #c7d2fe;
    line-height: 1.6;
}

/* Filter Bar */
.kits-filter-bar {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
    z-index: 20;
}

/* Search and Filter Toggle Row */
.search-filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.kit-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3.25rem;
    border: 2px solid #f1f5f9;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.kit-search-input:focus {
    outline: none;
    border-color: var(--kit-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

/* Filter Toggle Button */
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    color: #64748b;
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-toggle-btn:hover {
    border-color: var(--kit-primary);
    color: var(--kit-primary);
    background: rgba(99, 102, 241, 0.04);
}

.filter-toggle-btn.active {
    border-color: var(--kit-primary);
    color: var(--kit-primary);
    background: rgba(99, 102, 241, 0.08);
}

.filter-toggle-btn svg {
    flex-shrink: 0;
}

.filter-label-text {
    display: inline;
}

.filter-count-badge {
    background: var(--kit-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}

/* Collapsible Filter Panel */
.kit-filters-panel {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    animation: slideDown 0.2s ease-out;
}

.kit-filters-panel.open {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kit-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kit-filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.925rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.kit-filter-select:focus {
    outline: none;
    border-color: var(--kit-primary);
    background: white;
}

.kit-filter-select:hover {
    border-color: #cbd5e1;
}

/* Clear Filters Button */
.clear-filters-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 10px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: #fee2e2;
}

/* Results Header */
.kits-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-count {
    font-weight: 600;
    color: #475569;
}

.kit-sorting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kit-sorting label {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Sort Select - Silver/Gray styling for better blending */
.kit-sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.kit-sort-select:hover {
    border-color: #cbd5e1;
    background: white;
}

.kit-sort-select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}


/* Custom Kit Grid and Cards */
.kits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.kit-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
    display: flex;
    flex-direction: column;
}

.kit-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.kit-image-box {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.kit-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hover Action Buttons Overlay */
.kit-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if not on button */
}

/* Enable pointer events on buttons themselves */
.kit-actions-overlay button {
    pointer-events: auto;
}

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

.btn-kit-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.btn-kit-action:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-kit-cart:hover {
    background: var(--kit-primary);
    color: white;
}

.btn-kit-wishlist:hover {
    background: #fce7f3;
    color: #ec4899;
}

.btn-kit-wishlist.active {
    background: #fce7f3;
    color: #ec4899;
}

.btn-kit-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Kit Content - Compact */
.kit-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.kit-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    /* Medium weight */
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

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

.kit-price-box {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2px;
}

.kit-price {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    /* Non-bold */
    color: #dc2626;
    /* Red color */
}

.kit-old-price {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
}

/* Empty State */
.kits-empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-icon {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.btn-reset {
    background: var(--kit-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: var(--kit-primary-hover);
    transform: translateY(-2px);
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */

/* Fluid Typography for Hero Section */
.kits-page-title {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
}

.kits-page-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.25rem);
}

/* Large Tablet (1024px and below) */
@media (max-width: 1024px) {
    .kits-filter-bar {
        padding: 1rem 1.25rem;
    }

    .search-filter-row {
        flex-wrap: wrap;
    }

    .search-wrapper {
        flex: 1 1 calc(100% - 120px);
        min-width: 200px;
    }

    .filter-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }

    .kit-card-content {
        padding: 0.875rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .kits-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .kits-hero {
        padding: 5rem 1.25rem;
        min-height: 300px;
    }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
    .kits-hero {
        padding: 4rem 1rem;
        min-height: 280px;
        margin-bottom: -3rem;
    }

    .kits-filter-bar {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
    }

    .search-filter-row {
        gap: 0.75rem;
    }

    .search-wrapper {
        flex: 1 1 100%;
        order: 1;
    }

    .filter-toggle-btn {
        order: 2;
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .filter-label-text {
        display: inline;
    }

    .kit-filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-item {
        width: 100%;
        flex: none;
    }

    .kit-filter-select {
        width: 100%;
        padding: 0.75rem;
    }

    .kit-search-input {
        padding: 0.75rem 0.75rem 0.75rem 2.75rem;
        font-size: 0.925rem;
    }

    .kits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .kit-card-content {
        padding: 0.75rem;
    }

    .kit-title {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .kit-price {
        font-size: 0.95rem;
    }

    .kit-old-price {
        font-size: 0.7rem;
    }

    /* Action buttons - keep hover behavior, just adjust sizes for mobile */
    .btn-kit-action {
        width: 32px;
        height: 32px;
    }

    .btn-kit-action svg {
        width: 14px;
        height: 14px;
    }


    /* Results header stacking */
    .kits-results-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

    .kit-sorting {
        width: 100%;
        justify-content: space-between;
    }

    .kit-sort-select {
        flex: 1;
        max-width: 200px;
    }

    /* Container padding */
    .kits-main-content .container {
        padding: 0 1rem !important;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .kits-hero {
        padding: 3rem 0.75rem;
        min-height: 220px;
        margin-bottom: -2.5rem;
    }

    .kits-filter-bar {
        padding: 1rem;
        border-radius: 16px;
        gap: 0.75rem;
    }

    .kit-filter-select {
        padding: 0.75rem;
        font-size: 0.875rem;
        border-radius: 12px;
    }

    .kit-search-input {
        padding: 0.75rem 0.75rem 0.75rem 2.75rem;
        font-size: 0.875rem;
        border-radius: 12px;
    }

    .search-icon {
        left: 1rem;
        width: 18px;
        height: 18px;
    }

    .kits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kit-card {
        border-radius: 12px;
    }

    .kit-card-content {
        padding: 0.625rem;
        gap: 0.25rem;
    }

    .kit-title {
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .kit-price {
        font-size: 0.875rem;
    }

    .kit-price-box {
        gap: 0.35rem;
    }

    .btn-kit-action {
        width: 28px;
        height: 28px;
    }

    .btn-kit-action svg {
        width: 12px;
        height: 12px;
    }

    .kit-actions-overlay {
        padding: 8px;
    }

    /* Results info compact */
    .results-count {
        font-size: 0.875rem;
    }

    .kit-sorting label {
        font-size: 0.875rem;
    }

    /* Container padding */
    .kits-main-content .container {
        padding: 0 0.75rem !important;
    }

    /* Empty state compact */
    .kits-empty-state {
        padding: 3rem 1.5rem;
    }

    .kits-empty-state h3 {
        font-size: 1.1rem;
    }

    .kits-empty-state p {
        font-size: 0.875rem;
    }

    .btn-reset {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        border-radius: 10px;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .kits-hero {
        padding: 2.5rem 0.5rem;
        min-height: 200px;
    }

    .kits-grid {
        gap: 8px;
    }

    .kit-card-content {
        padding: 0.5rem;
    }

    .kit-title {
        font-size: 0.75rem;
    }

    .kit-price {
        font-size: 0.8rem;
    }

    .btn-kit-action {
        width: 26px;
        height: 26px;
    }

    .btn-kit-action svg {
        width: 11px;
        height: 11px;
    }
}