/* ========================================
   CATEGORY TABS
   Filter buttons for different categories
======================================== */
.petals-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 30px 20px;
    background: black;
    margin: 0;
}

.petals-tab {
    padding: 0.25rem 1rem;
    height: fit-content;
    background: #242222;
    border: 2px solid #403D3D;
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    outline: none;
}

.petals-tab:hover {
    background: #BF5F33;
    color: white;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.petals-tab.active {
    background: #BF5F33;
    color: white;
    border-color: #000;
}

/* Responsive tabs */
@media (max-width: 768px) {
    .petals-tabs {
        padding: 20px 15px;
        gap: 8px;
        margin: 0 1rem;
    }

    .petals-tab {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ========================================
   GRID LAYOUT USING FLEXBOX
   Displays products in rows of 5 items
======================================== */
.petals-grid {
    display: flex;
    flex-wrap: wrap;
    /* Items wrap to next line */
    width: calc(100% - 8rem);
    padding: 0;
    margin: 0;
    background: black;
    margin: 0 4rem;
    align-items: center;
    justify-content: center;
}

/* ========================================
   GRID ITEMS
   Each product card with hover effect
======================================== */
.petals-grid:hover .petals-item {
    width: 10%;
}

.petals-item {
    width: 20%;
    height: 400px;
    position: relative;
    overflow: visible;
    /* Important: allows item to grow outside bounds */
    cursor: pointer;
    /* flex: 0 0 20%; */
    /* Each item takes exactly 20% width (5 items = 100%) */
    aspect-ratio: 1;
    /* Makes items square */
    transition: all 0.3s ease;
    z-index: 1;
}

/* Responsive: 4 columns on tablets */
@media (max-width: 1200px) {
    .petals-item {
        /* flex: 0 0 25%; */
        /* 4 items per row */
    }
}

/* Responsive: 3 columns on small tablets */
@media (max-width: 900px) {
    .petals-item {
        /* flex: 0 0 33.333%; */
        /* 3 items per row */
    }

    .petals-grid {
        margin: 0 1rem;
    }
}

/* Responsive: 2 columns on mobile */
@media (max-width: 600px) {
    .petals-item {
        /* flex: 0 0 50%; */
        /* 2 items per row */
    }
}

/* Hover effect: Scale up the item */
.petals-item:hover {
    width: 60% !important;
    /* transform: scale(1.15); */
    /* Enlarge by 15% */
    /* z-index: 100; */
    /* Bring to front, above all other items */
}

/* The product image */
.petals-item img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    /* Fill the space without distortion */
    display: block;
    transition: filter 0.3s ease;
}

/* Darken image on hover to make text more readable */
.petals-item:hover img {
    filter: brightness(0.7);
}

/* ========================================
   OVERLAY TEXT
   Title and description shown on hover
======================================== */
.petals-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Don't block clicks */
    color: white;
    z-index: 2;
}

/* Show overlay on hover */
.petals-item:hover .petals-overlay {
    opacity: 1;
}

/* Overlay title styling */
.petals-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Overlay description styling */
.petals-desc {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    max-width: 90%;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* ========================================
   POPUP GALLERY
   Full-screen lightbox for viewing images
======================================== */
#petals-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    /* Dark overlay */
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Always on top */
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* The main image in the popup */
#petals-popup img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* ========================================
   POPUP CONTROLS
   Close button, navigation arrows, counter
======================================== */

/* Close button (X) */
.petals-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10000;
    font-weight: 300;
    line-height: 1;
}

.petals-close:hover {
    transform: scale(1.2);
    color: #ff4444;
}

/* Navigation arrows (Previous/Next) */
.petals-prev,
.petals-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.petals-prev:hover,
.petals-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.petals-prev {
    left: 30px;
}

.petals-next {
    right: 30px;
}

/* Image counter (1 / 5) */
.petals-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .petals-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .petals-desc {
        font-size: 12px;
    }

    .petals-prev,
    .petals-next {
        font-size: 30px;
        padding: 10px 15px;
    }

    .petals-prev {
        left: 10px;
    }

    .petals-next {
        right: 10px;
    }

    .petals-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }

    #petals-popup img {
        max-width: 95%;
        max-height: 75%;
    }

    .petals-counter {
        bottom: 15px;
        font-size: 14px;
        padding: 8px 16px;
    }
}