/*
 * MedLek Products Section - Styles
 * Version: 1.0.0
 * Description: Responsywna sekcja produktów z kafelkami 1x1 zoptymalizowana pod urządzenia mobilne
 */

/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Sekcja główna */
.products-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(157, 138, 124, 0.3) 50%,
        transparent 100%
    );
}

/* Container */
.products-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header sekcji */
.products-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.products-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #9d8a7c;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-block;
    position: relative;
}

.products-subtitle::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #9d8a7c, transparent);
}

.products-title {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #24262B;
    margin-bottom: 16px;
    line-height: 1.2;
}

.products-description {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    color: #576574;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid produktów - domyślnie 4 kolumny */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

/* Dynamiczne kolumny na podstawie atrybutu data-cols */
.products-grid[data-cols-desktop="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid[data-cols-desktop="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid[data-cols-desktop="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.products-grid[data-cols-desktop="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.products-grid[data-cols-desktop="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Karta produktu */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9d8a7c, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(157, 138, 124, 0.15);
}

.product-card:hover::before {
    transform: scaleX(1);
}

/* Obrazek produktu - ratio 1:1 (kwadrat) */
.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Ratio 1:1 dla kafelków kwadratowych */
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Overlay na obrazku - pojawia się po najechaniu */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(36, 38, 43, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view-btn {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9d8a7c;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-view-btn:hover {
    background: #9d8a7c;
    color: white;
    transform: scale(1.1);
}

/* Badge produktu */
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-sale {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.badge-featured {
    background: linear-gradient(135deg, #9d8a7c, #8a7869);
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

/* Zawartość karty */
.product-content {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Rating produktu */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
}

.product-rating .star-rating {
    font-size: 14px;
}

.rating-count {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    color: #8898aa;
}

/* Tytuł produktu */
.product-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-title-text {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #24262B;
    line-height: 1.4;
    margin-bottom: 12px;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px; /* Zapewnienie stałej wysokości dla 2 linii */
}

.product-card:hover .product-title-text {
    color: #9d8a7c;
}

/* Cena produktu */
.product-price {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #24262B;
    margin-bottom: 14px;
}

.product-price del {
    font-size: 14px;
    font-weight: 400;
    color: #8898aa;
    margin-right: 8px;
}

.product-price ins {
    text-decoration: none;
    color: #9d8a7c;
}

/* Przycisk produktu */
.product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, #9d8a7c 0%, #8a7869 100%);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
    box-shadow: 0 4px 12px rgba(157, 138, 124, 0.2);
}

.product-btn:hover {
    background: linear-gradient(135deg, #8a7869 0%, #9d8a7c 100%);
    box-shadow: 0 6px 16px rgba(157, 138, 124, 0.3);
    transform: translateY(-2px);
}

.product-btn i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.product-btn:hover i {
    transform: translateX(4px);
}

/* Przycisk "Zobacz wszystkie" */
.view-all-wrapper {
    text-align: center;
    margin-top: 30px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #9d8a7c 0%, #8a7869 100%);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(157, 138, 124, 0.3);
    position: relative;
    overflow: hidden;
}

.view-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(157, 138, 124, 0.4);
}

.view-all-btn:hover::before {
    left: 100%;
}

.view-all-btn i {
    transition: transform 0.3s ease;
    font-size: 16px;
}

.view-all-btn:hover i {
    transform: translateX(4px);
}

/* Responsywność - Desktop duży (1200px+) */
@media screen and (min-width: 1200px) {
    .products-grid[data-cols-desktop="5"] {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }

    .products-grid[data-cols-desktop="6"] {
        grid-template-columns: repeat(6, 1fr);
        gap: 18px;
    }
}

/* Responsywność - Tablet (768px - 1023px) */
@media screen and (max-width: 1023px) {
    .products-section {
        padding: 60px 20px;
    }

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

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

    .products-grid[data-cols-tablet="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid[data-cols-tablet="3"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-grid[data-cols-tablet="4"] {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .product-content {
        padding: 18px 16px;
    }

    .product-title-text {
        font-size: 15px;
    }

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

/* Responsywność - Mobile (max 767px) - ZOPTYMALIZOWANE */
@media screen and (max-width: 767px) {
    .products-section {
        padding: 40px 16px; /* Zmniejszony padding */
    }

    .products-header {
        margin-bottom: 32px; /* Zmniejszony margines */
    }

    .products-subtitle {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 8px;
    }

    .products-title {
        font-size: 26px; /* Mniejszy tytuł */
        margin-bottom: 12px;
    }

    .products-description {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Domyślnie 2 kolumny na mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Mniejszy gap dla oszczędności miejsca */
        margin-bottom: 32px;
    }

    .products-grid[data-cols-mobile="1"] {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .products-grid[data-cols-mobile="2"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .products-grid[data-cols-mobile="3"] {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    /* Kompaktowa karta produktu na mobile */
    .product-card {
        border-radius: 12px; /* Mniejszy border-radius */
    }

    .product-content {
        padding: 14px 12px; /* Zmniejszony padding */
    }

    /* Rating */
    .product-rating {
        margin-bottom: 8px;
    }

    .product-rating .star-rating {
        font-size: 12px;
    }

    .rating-count {
        font-size: 10px;
    }

    /* Tytuł */
    .product-title-text {
        font-size: 14px; /* Mniejszy font */
        margin-bottom: 8px;
        min-height: 40px; /* Dostosowana wysokość */
        -webkit-line-clamp: 2;
    }

    /* Cena */
    .product-price {
        font-size: 15px; /* Mniejsza cena */
        margin-bottom: 10px;
    }

    .product-price del {
        font-size: 12px;
    }

    /* Badge */
    .product-badge {
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 10px;
    }

    /* Przycisk */
    .product-btn {
        font-size: 12px;
        padding: 10px 16px;
        border-radius: 8px;
    }

    /* Overlay - bardziej widoczny na mobile (bez hover) */
    .product-overlay {
        opacity: 0;
    }

    .product-card:active .product-overlay {
        opacity: 1;
    }

    .quick-view-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Przycisk "Zobacz wszystkie" */
    .view-all-wrapper {
        margin-top: 24px;
    }

    .view-all-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 28px;
        font-size: 14px;
    }
}

/* Mobile bardzo małe ekrany (max 375px) */
@media screen and (max-width: 375px) {
    .products-section {
        padding: 32px 12px;
    }

    .products-title {
        font-size: 24px;
    }

    .products-grid {
        gap: 10px;
    }

    .product-content {
        padding: 12px 10px;
    }

    .product-title-text {
        font-size: 13px;
        min-height: 38px;
    }

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

    .product-btn {
        font-size: 11px;
        padding: 9px 14px;
    }
}

/* Animacje ładowania */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* WooCommerce rating stars override */
.product-rating .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 5.4em;
    font-family: 'star' !important;
}

.product-rating .star-rating::before {
    content: '\53\53\53\53\53';
    color: #e0e0e0;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.product-rating .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.product-rating .star-rating span::before {
    content: '\53\53\53\53\53';
    top: 0;
    position: absolute;
    left: 0;
    color: #9d8a7c;
}

/* =================================================================
   SLIDER HORYZONTALNY - MINIMALISTYCZNY DESIGN
   SEO-FRIENDLY z półprzezroczystymi przyciskami przy krawędziach
   ================================================================= */

.products-slider-wrapper {
    position: relative;
    padding: 0;
    margin-bottom: 5px;
}

.products-slider {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.products-slider-track {
    display: flex !important;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-slider-track .product-card {
    padding: 0 8px;
}

/* Usunięto slider-nav i slider-dots - nie są potrzebne */

/* Responsywność slidera - Tablet */
@media screen and (max-width: 1023px) {
    .products-slider-track .product-card {
        padding: 0 6px;
    }
}

/* Responsywność slidera - Mobile */
@media screen and (max-width: 767px) {
    .products-slider-track .product-card {
        padding: 0 5px;
    }
}

/* Mobile bardzo małe ekrany */
@media screen and (max-width: 375px) {
    .products-slider-track .product-card {
        padding: 0 4px;
    }
}

/* Animacja fade-in dla slidera */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.products-slider-wrapper {
    animation: slideIn 0.6s ease-out;
}
