/* =========================================================
   SmartGreens Product Gallery Styles
   Path: enfold-child/assets/css/sg-product-gallery.css
   ========================================================= */

/* ---- Gallery Grid ---- */
.sg-product-gallery {
    display: grid;
    grid-template-columns: repeat(var(--sg-gallery-cols, 4), 1fr);
    column-gap: var(--sg-gallery-col-gap, 20px);
    row-gap: var(--sg-gallery-row-gap, 30px);
    width: 100%;
}

/* ---- Gallery Item ---- */
.sg-gallery-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sg-gallery-item:hover {
    transform: translateY(-5px);
}

/* ---- Product Image ---- */
.sg-gallery-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--sg-beige);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.sg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sg-gallery-item:hover .sg-gallery-image img {
    transform: scale(1.05);
}

/* ---- Product Info ---- */
.sg-gallery-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ---- Product Title ---- */
.sg-gallery-title {
    font-size: var(--sg-title-size, 16px);
    font-weight: 600;
    color: var(--sg-title-color, var(--sg-green));
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.sg-gallery-item:hover .sg-gallery-title {
    color: var(--sg-accent);
}

/* ---- Product Description ---- */
.sg-gallery-desc {
    font-size: var(--sg-desc-size, 13px);
    color: var(--sg-desc-color, var(--sg-muted));
    line-height: 1.5;
    margin: 0 0 10px 0;
    flex: 1;
}

/* ---- Product Price ---- */
.sg-gallery-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--sg-price-color, var(--sg-text));
    margin-top: auto;
}

.sg-gallery-price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
    margin-right: 8px;
}

.sg-gallery-price ins {
    text-decoration: none;
    color: var(--sg-accent);
}

/* Sale price styling */
.sg-gallery-price .woocommerce-Price-amount {
    color: inherit;
}

/* ---- Empty State ---- */
.sg-gallery-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--sg-desc-color, var(--sg-muted));
    font-style: italic;
}

/* =========================================================
   TABLET STYLES (768px - 1024px)
   ========================================================= */
@media (max-width: 1024px) {
    .sg-product-gallery {
        grid-template-columns: repeat(min(var(--sg-gallery-cols, 4), 3), 1fr);
    }
}

/* =========================================================
   MOBILE STYLES (< 768px)
   ========================================================= */
@media (max-width: 767px) {
    .sg-product-gallery {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 15px;
        row-gap: 25px;
    }

    .sg-gallery-image {
        margin-bottom: 10px;
    }

    .sg-gallery-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .sg-gallery-desc {
        font-size: 12px;
        margin-bottom: 8px;
        /* Limit to 2 lines on mobile */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .sg-gallery-price {
        font-size: 14px;
    }

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

/* =========================================================
   SMALL MOBILE (< 480px)
   ========================================================= */
@media (max-width: 479px) {
    .sg-product-gallery {
        grid-template-columns: 1fr;
        row-gap: 30px;
    }

    .sg-gallery-image {
        border-radius: 6px;
    }

    .sg-gallery-title {
        font-size: 16px;
    }

    .sg-gallery-desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
}
