/* assets/css/home.css - גרסה סופית, נקייה ומותאמת ל-5 מוצרים */

/* --- 1. Hero Section: באנר ראשי --- */
.home-hero {
    height: 95vh;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-right: 8%;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 50px;
    overflow: hidden;
}

/* אפקט המעבר הדרגתי ללבן בתחתית */
.home-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
}

/* קופסת הטקסט - אפקט זכוכית */
.home-hero-content {
    background: rgba(255, 255, 255, 0.75); /* לבן חלבי */
    backdrop-filter: blur(12px); /* טשטוש הרקע */
    padding: 60px;
    max-width: 650px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    position: relative;
    z-index: 2;
}

.home-hero h1 {
    font-size: 5rem;
    font-weight: 900;
    line-height: 0.9;
    margin: 0 0 25px 0;
    color: black;
    letter-spacing: -2px;
}

.home-hero p {
    font-size: 1.3rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 40px;
}

/* כפתור ראשי */
.btn {
    display: inline-block;
    background: black;
    color: white;
    padding: 15px 40px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn:hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* --- 2. עיצוב כללי לסקשנים --- */
section.container {
    padding-top: 50px;
    padding-bottom: 80px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    font-weight: 900;
}

/* --- 3. גריד הקטגוריות --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    gap: 20px;
    height: 450px;
    margin-top: 0;
    position: relative;
    z-index: 3;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cat-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-decoration: none;
    background: white;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.cat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.cat-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.6s ease;
    filter: brightness(0.95);
}

.cat-card:hover img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

/* טקסט על הקטגוריה (ללא המילה 'קטגוריה') */
.cat-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    text-align: center;
    font-weight: 700;
    font-size: 1.6rem; /* פונט גדול וברור */
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.4s ease;
}

.cat-card:hover .cat-overlay {
    padding-bottom: 50px; /* מפנה מקום לכפתור */
}

/* כפתור "לכל המוצרים" בהובר */
.cat-overlay::after {
    content: 'לכל המוצרים';
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    color: white;
    border-bottom: 1px solid white;
    padding-bottom: 2px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

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

/* --- 4. כרטיסי מוצרים (5 בשורה) --- */
.product-grid {
    display: grid;
    /* 5 עמודות שוות במסכים גדולים */
    grid-template-columns: repeat(5, 1fr); 
    gap: 30px;
    padding: 0 20px;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-image {
    height: 280px; /* גובה אחיד לתמונות */
    background: #fcfcfc;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ממלא את כל הריבוע יפה */
    transition: transform 0.5s;
}

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

/* שכבת "הוסף לסל" */
.add-to-cart-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.85);
    color: white;
    text-align: center;
    padding: 12px;
    transform: translateY(100%);
    transition: transform 0.3s;
    font-weight: 700;
    font-size: 0.95rem;
}

.product-card:hover .add-to-cart-overlay {
    transform: translateY(0);
}

.product-info {
    padding: 20px 15px;
    text-align: center;
}

.product-info h4 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* שלוש נקודות אם השם ארוך מדי */
}

.product-info .price {
    color: #27ae60;
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-minimal {
    display: inline-block;
    border: 2px solid #000;
    color: #000;
    padding: 12px 35px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: 0.3s;
    margin-top: 20px;
}

.btn-minimal:hover {
    background: #000;
    color: white;
}

/* --- 5. התאמה למובייל (Responsive) --- */

/* טאבלטים ולפטופים קטנים */
@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* יורד ל-4 */
    }
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* יורד ל-3 */
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* קטגוריות: 2 בשורה */
        height: auto;
        gap: 30px;
    }
    .cat-card {
        height: 220px;
    }
    .home-hero h1 { font-size: 3.5rem; }
}

/* מובייל */
@media (max-width: 768px) {
    .home-hero {
        height: 90vh;
        padding: 0 !important;
        justify-content: center;
        align-items: flex-end;
        text-align: center;
        overflow: hidden;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .home-hero-content {
        width: calc(100% - 40px);
        max-width: 100%;
        margin: 0 20px 40px;
        padding: 24px 20px;
        backdrop-filter: blur(15px);
        box-sizing: border-box;
    }

    .home-hero h1 {
        font-size: 2rem;
        line-height: 1.1;
        word-break: break-word;
    }

    .home-hero p { font-size: 0.9rem; }

    /* קטגוריות — עמודה אחת */
    .category-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .cat-card {
        height: 130px !important;
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* מסתירים את הטקסט הכפול (alt text) */
    .cat-card img {
        font-size: 0 !important;
    }

    /* טקסט על הכרטיס */
    .cat-overlay {
        font-size: 1.1rem !important;
        padding: 16px 10px !important;
    }

    /* מוצרים */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .product-image { height: 150px; }
    .product-info h4 { font-size: 0.85rem; }
    .product-info .price { font-size: 0.9rem; }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    /* ריווח תחתון לכפתורים הצפים */
    section.container:last-child {
        padding-bottom: 100px;
    }
}