/**
 * תותח המצברים - גלריית מוצרים
 * עיצוב התואם לסגנון הקיים של האתר
 */

/* ===== משתני צבע ===== */
.tothach-products-gallery {
    --tothach-accent: #C6A51A;
    --tothach-accent-dark: #9c8214;
    --tothach-dark: #1d3557;
    --tothach-gray-text: #555;
    --tothach-gray-light: #e0e0e0;
    --tothach-bg-card: #ffffff;
    --tothach-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --tothach-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ===== מבנה הגלריה ===== */
.tothach-products-gallery {
    display: grid;
    gap: 24px;
    width: 100%;
    margin: 30px 0;
    direction: rtl;
    font-family: inherit;
}

/* עמודות בדסקטופ */
.tothach-products-gallery.tothach-products-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}
.tothach-products-gallery.tothach-products-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}
.tothach-products-gallery.tothach-products-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}
.tothach-products-gallery.tothach-products-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}
.tothach-products-gallery.tothach-products-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* ===== כרטיסיית מוצר ===== */
.tothach-product-card {
    background: var(--tothach-bg-card);
    border-radius: 12px;
    box-shadow: var(--tothach-shadow);
    padding: 24px 20px;
    text-align: center;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* אזור התמונה והשם */
.tothach-product-clickable {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

/* כרטיסיה עם קישור - אזור התמונה והשם לחיץ */
a.tothach-product-clickable {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tothach-product-card-linked:hover {
    box-shadow: var(--tothach-shadow-hover);
}

a.tothach-product-clickable:hover .tothach-product-title {
    color: var(--tothach-accent);
}

a.tothach-product-clickable:hover .tothach-product-image img {
    transform: scale(1.05);
}

/* ===== תמונה ===== */
.tothach-product-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    overflow: hidden;
}

.tothach-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tothach-product-no-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* ===== שם המוצר ===== */
.tothach-product-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tothach-dark);
    margin: 0 0 12px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* ===== מחיר - הכל בשורה אחת ===== */
.tothach-product-price-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

.tothach-product-price-label {
    font-size: 14px;
    color: var(--tothach-gray-text);
    font-weight: 500;
    white-space: nowrap;
}

.tothach-product-price-current {
    font-size: 22px;
    font-weight: 800;
    color: var(--tothach-accent);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    direction: ltr;
    white-space: nowrap;
}

.tothach-product-price-current .tothach-currency {
    order: 1;
    font-size: 18px;
}

.tothach-product-price-current .tothach-amount {
    order: 2;
}

.tothach-product-price-original {
    font-size: 15px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    direction: ltr;
    white-space: nowrap;
}

.tothach-product-price-original .tothach-currency {
    order: 1;
}

.tothach-product-price-original .tothach-amount {
    order: 2;
}

/* ===== רספונסיביות - טאבלט ===== */
@media (max-width: 1024px) {
    .tothach-products-gallery.tothach-products-columns-4,
    .tothach-products-gallery.tothach-products-columns-5,
    .tothach-products-gallery.tothach-products-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .tothach-product-title {
        font-size: 16px;
    }

    .tothach-product-price-current {
        font-size: 20px;
    }
}

/* ===== רספונסיביות - מובייל ===== */
@media (max-width: 768px) {
    .tothach-products-gallery {
        gap: 16px;
        margin: 20px 0;
    }

    /* כל הקונפיגורציות במובייל = 2 בשורה (כמו צילום המסך) */
    .tothach-products-gallery.tothach-products-columns-2,
    .tothach-products-gallery.tothach-products-columns-3,
    .tothach-products-gallery.tothach-products-columns-4,
    .tothach-products-gallery.tothach-products-columns-5,
    .tothach-products-gallery.tothach-products-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tothach-product-card {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .tothach-product-image {
        height: 130px;
        margin-bottom: 12px;
    }

    .tothach-product-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

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

    .tothach-product-price-current {
        font-size: 17px;
    }

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

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

    .tothach-product-price-wrapper {
        gap: 5px;
    }
}

/* ===== מובייל קטן ===== */
@media (max-width: 380px) {
    .tothach-products-gallery {
        gap: 12px;
    }

    .tothach-product-card {
        padding: 14px 10px;
    }

    .tothach-product-image {
        height: 110px;
    }

    .tothach-product-title {
        font-size: 14px;
    }

    .tothach-product-price-label {
        font-size: 11px;
    }

    .tothach-product-price-current {
        font-size: 15px;
    }

    .tothach-product-price-current .tothach-currency {
        font-size: 13px;
    }

    .tothach-product-price-original {
        font-size: 11px;
    }

    .tothach-product-price-wrapper {
        gap: 4px;
    }
}
