/**
 * Homepage CSS - Porównywarka Cen MED-LEK
 * Style specyficzne dla strony głównej
 */

/* ==================================================
   HERO SECTION
   ================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ab8ad 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 60px;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-secondary);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-search {
    max-width: 700px;
    margin: 0 auto 50px;
    position: relative;
}

/* Nowy styl wyszukiwarki z autocomplete - kompaktowy */
.hero-search .search-form-large {
    position: relative;
}

.hero-search .search-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 30px;
    padding: 5px 5px 5px 18px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.18);
}

.hero-search .search-icon {
    width: 20px;
    height: 20px;
    stroke: #9ca3af;
    flex-shrink: 0;
}

.hero-search .search-input-large {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 12px;
    font-size: 15px;
    font-family: var(--font-primary);
    background: transparent;
    min-width: 0;
}

.hero-search .search-input-large::placeholder {
    color: #9ca3af;
}

.hero-search .search-btn-large {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    flex-shrink: 0;
}

.hero-search .search-btn-large:hover {
    background: #000;
}

/* Autocomplete w hero - kompaktowy */
.hero-search .search-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.18);
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    display: none;
}

.hero-search .search-autocomplete.active {
    display: block;
}

/* Stary styl (zachowany dla kompatybilności) */
.hero-search-input {
    width: 100%;
    padding: 20px 60px 20px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-family: var(--font-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-search-input:focus {
    outline: none;
}

.hero-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.hero-search-btn:hover {
    background: #000;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 42px;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.hero-stat-label {
    font-size: 15px;
    opacity: 0.9;
}

/* ==================================================
   BROWSE TABS - TAXONOMY NAVIGATION
   ================================================== */
.browse-section {
    margin-bottom: 60px;
}

.browse-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--gray-color);
    padding: 8px;
    border-radius: 12px;
}

.browse-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.browse-tab:hover {
    background: white;
    color: var(--secondary-color);
}

.browse-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.browse-tab svg {
    flex-shrink: 0;
}

.browse-content {
    position: relative;
    min-height: 300px;
}

.browse-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.browse-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Taxonomy Grid */
.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.taxonomy-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.taxonomy-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(12, 222, 208, 0.15);
    transform: translateY(-2px);
}

.taxonomy-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ab8ad 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.taxonomy-icon svg {
    color: white;
    width: 24px;
    height: 24px;
}

/* Różne kolory dla różnych typów */
.taxonomy-card--purpose .taxonomy-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.taxonomy-card--type .taxonomy-icon {
    background: linear-gradient(135deg, #4834d4 0%, #686de0 100%);
}

.taxonomy-card--form .taxonomy-icon {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
}

.taxonomy-card--brand .taxonomy-icon {
    background: linear-gradient(135deg, #6ab04c 0%, #78e08f 100%);
}

.taxonomy-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.taxonomy-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taxonomy-count {
    font-size: 13px;
    color: var(--text-light);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: var(--secondary-color);
}

.view-all-link::after {
    content: '\2192';
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    font-size: 15px;
}

/* Section Alt Background */
.section--alt {
    background: var(--gray-color);
    padding: 60px 0;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

/* ==================================================
   CATEGORIES GRID (legacy)
   ================================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 80px;
}

.category-card {
    background: white;
    border-radius: var(--border-radius-card);
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

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

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ab8ad 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.category-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

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

.category-count {
    font-size: 14px;
    color: var(--text-light);
}

/* ==================================================
   PRODUCTS GRID
   ================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.badge-new {
    background: #0cded0;
}

.badge-discount {
    background: #ff4757;
}

.badge-popular {
    background: #ffa502;
}

.product-image-wrapper {
    background: var(--gray-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    text-decoration: none;
}

.product-image-wrapper img.product-image {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-image-wrapper:hover img.product-image {
    transform: scale(1.05);
}

.product-placeholder {
    color: #ccc;
    font-size: 14px;
    text-align: center;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-name a:hover {
    color: var(--primary-color);
}

.product-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.rating-count {
    font-size: 12px;
    color: var(--text-light);
}

.product-price {
    margin-bottom: 12px;
}

.price-main {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.price-old {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-right: 8px;
}

.price-range {
    font-size: 12px;
    color: var(--text-light);
}

.product-shops {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-view {
    flex: 1;
    padding: 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.btn-view:hover {
    background: #000;
}

/* ==================================================
   HOW IT WORKS
   ================================================== */
.how-it-works {
    background: white;
    padding: 80px 0;
    margin-bottom: 80px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.step-card {
    text-align: center;
    position: relative;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ab8ad 100%);
    color: white;
    font-size: 36px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-family: var(--font-secondary);
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.step-description {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ==================================================
   CTA SECTION
   ================================================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ab8ad 100%);
    color: white;
    padding: 60px 40px;
    border-radius: var(--border-radius-card);
    text-align: center;
    margin-bottom: 80px;
}

.cta-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: var(--font-secondary);
}

.cta-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.cta-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-family: var(--font-primary);
}

.cta-btn {
    padding: 15px 35px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-size: 15px;
}

.cta-btn:hover {
    background: #000;
}

/* ==================================================
   VIEW ALL BUTTON
   ================================================== */
.view-all-btn {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
    padding: 15px 40px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    text-decoration: none;
}

.view-all-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================================================
   RESPONSIVE - TABLET
   ================================================== */
@media (max-width: 968px) {
    .hero-title {
        font-size: 42px;
    }

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

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .browse-tabs {
        gap: 6px;
        padding: 6px;
    }

    .browse-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .taxonomy-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

    .taxonomy-card {
        padding: 14px 16px;
    }

    .taxonomy-icon {
        width: 40px;
        height: 40px;
    }

    .taxonomy-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* ==================================================
   RESPONSIVE - MOBILE
   ================================================== */
@media (max-width: 640px) {
    .hero {
        padding: 50px 0;
    }

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

    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .hero-search-input {
        padding: 15px 20px;
        font-size: 14px;
    }

    .hero-search-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 10px;
        border-radius: 50px;
    }

    .hero-search {
        margin-bottom: 35px;
    }

    /* Nowy hero search - mobile - kompaktowy */
    .hero-search .search-form-large {
        position: relative;
    }

    .hero-search .search-input-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
        border-radius: 16px;
    }

    .hero-search .search-icon {
        display: none;
    }

    .hero-search .search-input-large {
        width: 100%;
        flex: none;
        padding: 8px 4px;
        font-size: 15px;
        border: none;
        border-radius: 0;
        background: transparent;
        order: 1;
    }

    .hero-search .search-input-large::placeholder {
        font-size: 14px;
    }

    .hero-search .search-input-large:focus {
        outline: none;
    }

    .hero-search .search-btn-large {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        border-radius: 25px;
        order: 2;
    }

    /* Autocomplete mobile */
    .hero-search .search-autocomplete {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 8px;
        border-radius: 12px;
        max-height: 60vh;
    }

    .hero-search .search-autocomplete .ac-list {
        padding: 4px 0;
    }

    .hero-search .search-autocomplete .ac-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .hero-search .search-autocomplete .ac-img {
        width: 36px;
        height: 36px;
    }

    .hero-search .search-autocomplete .ac-name {
        font-size: 14px;
    }

    .hero-search .search-autocomplete .ac-tag {
        font-size: 9px;
        padding: 2px 6px;
    }

    .hero-search .search-autocomplete .ac-price,
    .hero-search .search-autocomplete .ac-count {
        font-size: 12px;
    }

    .hero-search .search-autocomplete .ac-more {
        padding: 12px;
        font-size: 14px;
    }

    .hero-stats {
        gap: 30px;
    }

    .hero-stat-value {
        font-size: 32px;
    }

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

    .category-card {
        padding: 25px 15px;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }

    .category-icon svg {
        width: 24px;
        height: 24px;
    }

    .category-name {
        font-size: 15px;
    }

    .category-count {
        font-size: 12px;
    }

    /* Browse Tabs Mobile */
    .browse-tabs {
        gap: 4px;
        padding: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .browse-tabs::-webkit-scrollbar {
        display: none;
    }

    .browse-tab {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .browse-tab svg {
        width: 16px;
        height: 16px;
    }

    .taxonomy-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .taxonomy-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .taxonomy-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .taxonomy-icon svg {
        width: 18px;
        height: 18px;
    }

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

    .taxonomy-count {
        font-size: 12px;
    }

    .browse-content {
        min-height: 200px;
    }

    .section--alt {
        margin: 0;
        padding: 40px 20px;
    }

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

    .product-card {
        padding: 12px;
    }

    .product-image-wrapper {
        min-height: 120px;
        padding: 15px;
    }

    .product-name {
        font-size: 13px;
        min-height: 36px;
    }

    .price-main {
        font-size: 18px;
    }

    .btn-view {
        padding: 10px;
        font-size: 12px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cta-title {
        font-size: 28px;
    }

    .cta-subtitle {
        font-size: 16px;
    }

    .cta-form {
        flex-direction: column;
    }

    .cta-input, .cta-btn {
        width: 100%;
    }
}
