/**
 * Gift'in Gallery - Frontend Styles
 *
 * @author    Find'in Solution
 * @copyright Find'in Solution
 */

/* ===== Section ===== */
.giftin-gallery-section {
    padding: 60px 0 80px;
    background-color: #fafafa;
    overflow: hidden;
}

/* ===== Header ===== */
.giftin-gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.giftin-gallery-title {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.giftin-gallery-ig-link {
    color: #ff5546;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.giftin-gallery-ig-link:hover {
    color: #c13584;
    transform: scale(1.1);
    text-decoration: none;
}

.giftin-gallery-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #777;
    margin: 0;
    font-weight: 300;
}

/* ===== Filter Tabs ===== */
.giftin-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.giftin-filter-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    background: transparent;
    color: #555;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.giftin-filter-btn:hover,
.giftin-filter-btn.active {
    background-color: #ff5546;
    border-color: #ff5546;
    color: #fff;
}

/* ===== Masonry Grid ===== */
.giftin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ===== Gallery Item ===== */
.giftin-gallery-item {
    break-inside: avoid;
    overflow: hidden;
    border-radius: 8px;
}

.giftin-gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
    cursor: pointer;
}

.giftin-gallery-img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.giftin-gallery-card:hover .giftin-gallery-img {
    transform: scale(1.08);
}

/* ===== Hover Overlay ===== */
.giftin-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.giftin-gallery-card:hover .giftin-gallery-overlay {
    opacity: 1;
}

.giftin-gallery-overlay-content {
    text-align: center;
    padding: 20px;
    transform: translateY(15px);
    transition: transform 0.4s ease;
}

.giftin-gallery-card:hover .giftin-gallery-overlay-content {
    transform: translateY(0);
}

.giftin-gallery-item-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}

.giftin-gallery-item-cat {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 12px;
}

.giftin-gallery-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transition: background 0.3s ease, transform 0.3s ease;
}

.giftin-gallery-social-link:hover {
    background: #ff5546;
    transform: scale(1.1);
    text-decoration: none;
    color: #fff;
}

/* ===== CTA Button ===== */
.giftin-gallery-cta {
    text-align: center;
    margin-top: 40px;
}

.giftin-gallery-cta-btn {
    display: inline-flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ff5546;
    border: 2px solid #ff5546;
    background: transparent;
    padding: 12px 32px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.giftin-gallery-cta-btn:hover {
    background: #ff5546;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 85, 70, 0.3);
}

/* ===== Scroll Reveal Animation ===== */
.giftin-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.giftin-reveal.giftin-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delay for grid items */
.giftin-gallery-item:nth-child(1) { transition-delay: 0.05s; }
.giftin-gallery-item:nth-child(2) { transition-delay: 0.1s; }
.giftin-gallery-item:nth-child(3) { transition-delay: 0.15s; }
.giftin-gallery-item:nth-child(4) { transition-delay: 0.2s; }
.giftin-gallery-item:nth-child(5) { transition-delay: 0.25s; }
.giftin-gallery-item:nth-child(6) { transition-delay: 0.3s; }
.giftin-gallery-item:nth-child(7) { transition-delay: 0.35s; }
.giftin-gallery-item:nth-child(8) { transition-delay: 0.4s; }

/* ===== Filter transition ===== */
.giftin-gallery-item.giftin-hidden {
    display: none;
}

/* ===== Lightbox ===== */
.giftin-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.giftin-lightbox.giftin-lightbox-open {
    display: flex;
}

.giftin-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.giftin-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    animation: giftin-lightbox-fade 0.3s ease;
}

@keyframes giftin-lightbox-fade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.giftin-lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.giftin-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    transition: color 0.3s ease;
}

.giftin-lightbox-close:hover {
    color: #ff5546;
}

.giftin-lightbox-prev,
.giftin-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.giftin-lightbox-prev:hover,
.giftin-lightbox-next:hover {
    background: rgba(255, 85, 70, 0.8);
}

.giftin-lightbox-prev {
    left: -60px;
}

.giftin-lightbox-next {
    right: -60px;
}

.giftin-lightbox-caption {
    text-align: center;
    color: #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    padding: 12px 0 0;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 991px) {
    .giftin-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .giftin-gallery-title {
        font-size: 26px;
    }

    .giftin-gallery-img {
        height: 240px;
    }

    .giftin-lightbox-prev {
        left: 10px;
    }

    .giftin-lightbox-next {
        right: 10px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .giftin-gallery-section {
        padding: 40px 0 60px;
    }

    .giftin-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .giftin-gallery-title {
        font-size: 22px;
    }

    .giftin-gallery-subtitle {
        font-size: 14px;
    }

    .giftin-gallery-img {
        height: 180px;
    }

    .giftin-filter-btn {
        font-size: 11px;
        padding: 6px 14px;
    }

    .giftin-gallery-item-title {
        font-size: 14px;
    }

    .giftin-lightbox-prev {
        left: 5px;
    }

    .giftin-lightbox-next {
        right: 5px;
    }

    .giftin-lightbox-close {
        top: -35px;
        font-size: 30px;
    }
}

/* Small mobile */
@media (max-width: 479px) {
    .giftin-gallery-filters {
        gap: 5px;
    }

    .giftin-filter-btn {
        font-size: 10px;
        padding: 5px 10px;
    }
}
