/* ------------------------------------------------------------------
   FILTRY NAD GALERIĄ
------------------------------------------------------------------- */

.rpgw-filters-wrapper {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rpgw-filters {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rpgw-filters-left {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rpgw-filter-field {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #374151;
}

.rpgw-filter-field label {
    font-weight: 600;
    margin-bottom: 3px;
}

.rpgw-filter-field select {
    min-width: 170px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    font-size: 13px;
    outline: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #9ca3af 50%),
        linear-gradient(135deg, #9ca3af 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.rpgw-filter-field select:focus {
    border-color: #22c55e;
}

.rpgw-filters-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

/* Zielony przycisk losowania z mniejszym fontem */
.rpgw-reroll-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px !important;
    font-weight: 600;
    cursor: pointer;
    background-color: #16a34a !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
    white-space: nowrap;
}

.rpgw-reroll-btn:hover {
    background-color: #22c55e !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.45);
}

.rpgw-reroll-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(22, 163, 74, 0.3);
}

@media (max-width: 768px) {
    .rpgw-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .rpgw-filters-right {
        justify-content: flex-start;
        width: 100%;
    }
}

/* ------------------------------------------------------------------
   LAYOUT GALERII – 3 KOLUMNY, KWADRATOWE KAFELKI
------------------------------------------------------------------- */

.rpgw-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    grid-auto-flow: dense; /* upychanie produktów w wolne miejsca, bez białych dziur */
}

@media (max-width: 1100px) {
    .rpgw-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rpgw-gallery {
        grid-template-columns: 1fr;
    }
}

/* Karta produktu */

.rpgw-item {
    position: relative;
}

.rpgw-item-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* kwadrat pod zdjęcia 1024x1024 */
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    border: 3px solid transparent; /* zielona obwódka na hover – bez zmiany rozmiaru */
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Zielona obwódka po najechaniu */
.rpgw-item-inner:hover {
    border-color: #16a34a;
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

/* Rozmiary kafelków – tylko kwadraty: mały (1 kolumna) i duży (2 kolumny, 2 rzędy) */

.rpgw-item--small {
    grid-column: span 1;
    grid-row: span 1;
}

.rpgw-item--big {
    grid-column: span 2;
    grid-row: span 2; /* zajmuje 2 rzędy, żeby nie powstawała pionowa dziura obok małych kafelków */
}

@media (max-width: 1100px) {
    .rpgw-item--big {
        grid-column: span 2; /* pełen wiersz przy 2 kolumnach */
        grid-row: span 2;
    }
}

@media (max-width: 640px) {
    .rpgw-item--big {
        grid-column: span 1; /* na mobile wszystkie na 1 kolumnę */
        grid-row: span 1;
    }
}

/* możliwość ukrywania (jeśli w przyszłości dodasz więcej filtrów JS) */
.rpgw-item--hidden {
    display: none;
}

/* Zdjęcie – zawsze na pełnej wysokości kafla */

.rpgw-image-wrapper {
    position: absolute;
    inset: 0;
}

.rpgw-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.04);
    transition: transform 0.45s ease-out;
}

/* mocniejszy zoom na hover */
.rpgw-item-inner:hover .rpgw-image-wrapper img {
    transform: scale(1.18);
}

/* Badge z rabatem */

.rpgw-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.rpgw-badge-percent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #16a34a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

/* Dolny overlay – gradient */

.rpgw-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.70),
        rgba(0,0,0,0.35),
        transparent
    );
}

/* Pasek z ceną – półprzezroczysty, mniejszy */

.rpgw-prices {
    background-color: rgba(255,255,255,0.9);
    color: #000000;
    padding: 5px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    max-width: 80%;
}

.rpgw-price-regular {
    text-decoration: line-through;
    opacity: 0.7;
}

.rpgw-price-sale {
    color: #16a34a;
    font-weight: 700;
}

/* Przyciski */

.rpgw-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.rpgw-btn {
    border: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

/* "Przejdź do produktu" – biały, lekko przeźroczysty */

.rpgw-btn-view {
    background-color: rgba(255,255,255,0.9);
    color: #111827;
}

/* "Dodaj do koszyka" – zielony z białym napisem i mniejszym fontem
   (wymuszamy, żeby nie nadpisywał tego motyw) */

.rpgw-btn-add {
    background-color: #16a34a !important;
    color: #ffffff !important;
    font-size: 13px !important;
}

.rpgw-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.16);
}

.rpgw-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Stan po dodaniu */

.rpgw-btn-add.rpgw-btn-added {
    background-color: #22c55e !important;
}

/* Tekst przy braku produktów */

.rpgw-empty {
    font-style: italic;
    opacity: 0.7;
}

/* ------------------------------------------------------------------
   DODATKOWE DOSTOSOWANIA DLA MOBILE (max-width: 640px)
   – tylko wersja mobilna
------------------------------------------------------------------- */

@media (max-width: 640px) {

    /* trochę ciaśniejszy overlay na mobile */
    .rpgw-info {
        padding: 8px 10px 10px;
        gap: 6px;
    }

    /* belka z ceną – mniejsze paddingi, pełna szerokość
       taka jak wiersz przycisków, ceny wyrównane do prawej */
    .rpgw-prices {
        padding: 3px 10px;
        font-size: 12px;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        justify-content: flex-end;
        text-align: right;
        gap: 4px;
    }

    /* wiersz przycisków – zawsze jeden rząd, pełna szerokość */
    .rpgw-actions {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 4px;
    }

    /* oba przyciski w jednym rzędzie, równa szerokość */
    .rpgw-btn {
        flex: 1 1 0;
        min-width: 0;
        font-size: 12px;
        padding: 6px 8px;
    }
}
