/* ====================== GLOBAL ====================== */
:root {
    --primary: #111;
    --green: #428830;
    --accent: #3fe639;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background: #f4d49c;
    color: var(--primary);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
}

/* ====================== HEADER ====================== */
header {
    border-top: 2px solid green;
    border-bottom: 2px solid green;
    padding: 12px 0;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo img {
    width: 90px;
    height: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    padding: 11px 20px;
    background: #428830;
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background: white;
    color: var(--green);
    border-color: var(--green);
}

.btn-primary.active {
    background: white;
    color: var(--green);
    border: 2px solid var(--green);
    box-shadow: 0 0 0 4px rgba(66, 136, 48, 0.25);
}

.btn-primary:not(.active):hover {
    background: #ffffff;
    color: #428830;
    border-color: #428830;
}
/* Klik (lekki efekt wciskania) */
.btn-primary:active {
    transform: scale(0.96);
}

.quality-option {
    padding: 14px 18px;
    min-width: 120px;
    flex: 1 1 120px;
    text-align: center;
    white-space: nowrap;
}

/* AKTYWNY — wyraźnie inny */
.quality-option.active {
    background: #ffffff;
    color: #428830;
    border: 2px solid #428830;
    box-shadow: 0 0 0 3px rgba(66, 136, 48, 0.25);
    transform: scale(1.05);
}
.width-option.active {
    background: #ffffff;
    color: #428830;
    border: 2px solid #428830;
    box-shadow: 0 0 0 3px rgba(66, 136, 48, 0.25);
}
.mattress-option.active {
    background: #428830;
    color: #ffffff;
    outline: 3px solid #428830;
}

/* Dla szerokości */
.width-option.active {
    background: white;
    color: var(--green);
    border: 2px solid var(--green);
    box-shadow: 0 0 0 3px rgba(66, 136, 48, 0.25);
}
/* Efekt kliknięcia (przycisk lekko się wciska) */
.btn-primary:active,
.quality-option:active,
.mattress-option:active,
.width-option:active {
    transform: scale(0.96);
}


.read-more .more {
    display: none;
}


/* ====================== IKONA KOSZYKA Z BADGE ====================== */
.cart-item {
    position: relative;
    list-style: none;
}

#cart-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: pointer;
}

#cart-icon:hover {
    transform: scale(1.08);
}

.cart-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #e63939;
    color: white;
    font-size: 15px;
    font-weight: 700;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    border: 2px solid white;
}

.cart-list {
    display: none !important;
}

/* ====================== UKŁAD GŁÓWNY ====================== */
.meblo-layout {
    display: flex;
    gap: 50px;
    margin-top: 40px;
}

.meblo-left {
    flex: 2;
}

.meblo-right {
    flex: 1;
    position: sticky;
    top: 30px;
    align-self: flex-start;
}

/* ====================== RESPONSIVE - UKŁAD ====================== */

/* Duże ekrany (PC) - dwie kolumny */
@media (min-width: 993px) {
    .meblo-layout {
        flex-direction: row !important;
    }
}

/* Tablety i telefony - jedna kolumna */
@media (max-width: 992px) {
    .meblo-layout {
        flex-direction: column !important;
        gap: 40px;
    }
    .meblo-right {
        position: static;
    }
}

/* Drobne poprawki dla małych ekranów */
@media (max-width: 768px) {
    .meblo-main img {
        max-height: 320px;
    }
    .meblo-thumbs img {
        width: 92px;
        height: 62px;
    }
    .meblo-width-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #cart-icon {
        width: 80px !important;
        height: 80px !important;
    }
}

@media (max-width: 768px) {

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 20px 20px;
        gap: 15px;
        transition: right 0.3s ease;
        z-index: 10000;
    }

    header.menu-open nav ul {
        right: 0;
    }
}
@media (max-width: 768px) {

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 20px 20px;
        gap: 15px;
        transition: right 0.3s ease;
        z-index: 10000;
    }

    header.menu-open nav ul {
        right: 0;
    }
}
@media (max-width: 768px) {

    .men_hidden {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        display: none;
        z-index: 9999;
    }

    header.menu-open .men_hidden {
        display: block;
    }
}

/* ====================== LEWA KOLUMNA ====================== */
.meblo-gallery {
    max-width: 580px;
    margin-bottom: 40px;
}

.meblo-main img {
    width: 100%;
    max-height: 380px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.meblo-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.meblo-thumbs img {
    width: 108px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.72;
    transition: all 0.25s;
    border: 2px solid transparent;
}

.meblo-thumbs img.active,
.meblo-thumbs img:hover {
    opacity: 1;
    border-color: var(--green);
    transform: scale(1.05);
}

/* Tkaniny pod galerią */
.meblo-fabrics h3 {
    margin-bottom: 15px;
}

.meblo-fabric-preview img {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.meblo-fabric-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meblo-fabric-options img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.65;
    transition: all 0.2s;
}

.meblo-fabric-options img.active,
.meblo-fabric-options img:hover {
    opacity: 1;
    outline: 3px solid var(--green);
    transform: scale(1.05);
}

/* ====================== PRAWA KOLUMNA ====================== */
.meblo-right h3 {
    margin-bottom: 15px;
}

/* Szerokość */
.meblo-width-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.width-option {
    padding: 14px 8px;
    font-size: 1.05rem;
}

.width-center {
    grid-column: 2;
}

/* Jakość wykończenia - poprawka na 3 przyciski */
.meblo-quality-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quality-option {
    padding: 14px 18px;
    min-width: 120px;           /* ważne */
    flex: 1 1 120px;            /* elastyczne rozciąganie */
    text-align: center;
    white-space: nowrap;
}

/* Materac */
.meblo-mattress-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mattress-option {
    width: 110px;
    text-align: center;
    cursor: pointer;
}

.mattress-option img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.mattress-option.active,
.quality-option.active {
    background: var(--green);
    color: white;
    outline: 3px solid var(--green);
}
/* Podsumowanie ceny */
.price-summary {
    margin-top: 40px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.price-summary h2 {
    font-size: 2.4rem;
    color: var(--green);
    margin: 10px 0 20px 0;
}

/* ====================== LIGHTBOX ====================== */
.meblo-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.meblo-lightbox img {
    max-width: 96%;
    max-height: 94vh;
    border-radius: 12px;
}

.meblo-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 54px;
    color: white;
    cursor: pointer;
}

.meblo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 58px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 12px 22px;
}

.meblo-prev { left: 25px; }
.meblo-next { right: 25px; }

/* ====================== KOSZYK WYSUWANY ====================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 420px;
    height: 100vh;
    background: white;
    box-shadow: -8px 0 25px rgba(0,0,0,0.25);
    transition: right 0.4s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.open {
    right: 0;
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
    }
}

.cart-sidebar-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-sidebar-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.cart-close {
    font-size: 42px;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.cart-close:hover {
    color: #e63939;
}

.cart-sidebar-body {
    flex: 1;
    padding: 20px 25px;
    overflow-y: auto;
}

.cart-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-sidebar-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-sidebar-footer {
    padding: 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ====================== PREMIUM CAROUSEL ====================== */
.premium-carousel {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    margin-bottom: 60px;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 6s ease;
}

.carousel-slide.active img {
    transform: scale(1.1);
}

.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.25));
}

.slide-content {
    position: absolute;
    bottom: 15%;
    left: 10%;
    color: white;
    max-width: 520px;
    z-index: 2;
}

.slide-content h2 {
    font-size: 2.3rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.slide-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 13px 26px;
    background: var(--green);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.slide-btn:hover {
    background: white;
    color: var(--green);
}

.carousel-dots {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    z-index: 3;
}

.carousel-dots span {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin: 0 7px;
    background: rgba(255,255,255,0.65);
    border-radius: 50%;
    cursor: pointer;
}

.carousel-dots .active-dot {
    background: var(--green);
    transform: scale(1.4);
}

/* ====================== FOOTER ====================== */
.footer {
    background: var(--green);        /* kolor taki sam jak btn-primary */
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 80px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #e0f0d9;                  /* delikatny jaśniejszy odcień przy hover */
    text-decoration: underline;
}
/* ====================== COOKIE BANNER ====================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 3px solid var(--green);
    box-shadow: 0 -6px 20px rgba(0,0,0,0.15);
    padding: 20px 15px;
    z-index: 9999;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.cookie-buttons button {
    padding: 12px 26px;
    border-radius: 25px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.cookie-buttons button:hover {
    background: white;
    color: var(--green);
    border-color: var(--green);
}

.cookie-buttons .btn-decline {
    background: #e63939;
}

.cookie-buttons .btn-decline:hover {
    background: white;
    color: #e63939;
    border-color: #e63939;
}


/* ====================== POPUP ====================== */
.meblo-popup {
    display: none;              /* KLUCZOWE */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.meblo-popup.show {
    display: flex;
}

.meblo-popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}



.meblo-popup {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.meblo-popup.show {
    display: flex;
}

.meblo-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.meblo-popup-content {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 2;
}


.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);

    /* centrowanie popupu */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    padding: 25px;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    position: relative;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    animation: modalIn 0.25s ease;
}

.modal-content h2 {
    margin-bottom: 10px;
}

.modal-content input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.modal-content input:focus {
    outline: none;
    border-color: #000;
}

.modal-content button {
    margin-top: 10px;
}

/* X zamykania */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 22px;
    cursor: pointer;
}

/* checkbox */
.modal-content label {
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* animacja */
@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ====================== hambg ====================== */
.men-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.men-toggle span {
    width: 28px;
    height: 3px;
    background: #000;
    display: block;
    border-radius: 2px;
}
@media (max-width: 768px) {
    .men-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 20px 20px;
        gap: 15px;
        transition: right 0.3s ease;
        z-index: 10000;
    }
}
header.menu-open nav ul {
    right: 0;
}
@media (max-width: 768px) {
    .men_hidden {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
    }

    header.menu-open .men_hidden {
        display: block;
    }
}
.no-scroll {
    overflow: hidden;
}
.cart-item-flex {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.cart-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* ================= POPUP INFO ================= */

/* ================= POPUP ================= */

.custom-popup {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px; /* 🔥 żeby nie kleił się do krawędzi */
}

.custom-popup.show {
    display: flex;
}

.custom-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

/* 🔥 KLUCZOWE: scroll + ograniczenie wysokości */
.custom-popup-content {
    position: relative;
    background: white;
    border-radius: 14px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;          /* 🔥 NIE wychodzi poza ekran */
    overflow-y: auto;          /* 🔥 scroll */
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

/* X */
.custom-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

/* ================= GRID ================= */

.popup-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
}

/* ================= KARTA ================= */

.popup-box_2 {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* DUŻY OBRAZ */
.popup-box_2 > img {
    width: 100%;       /* 🔥 zamiast 200px */
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

/* ================= DÓŁ (USUNIĘTA DWUKOLUMNA) ================= */

.popup-bottom {
    display: flex;          /* 🔥 zamiast grid */
    flex-direction: column; /* 🔥 wszystko pod sobą */
    gap: 15px;
}

/* IKONY */

.popup-icons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 🔥 IKONA + TEKST OBOK SIEBIE */
.icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-row img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* TEKST */
.popup-text p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

    .custom-popup {
        align-items: flex-start; /* 🔥 zaczyna od góry */
        padding: 10px;
    }

    .custom-popup-content {
        padding: 20px;
        max-height: 95vh;
    }

    .popup-columns {
        grid-template-columns: 1fr;
    }

    /* 🔥 obraz trochę niższy */
    .popup-box_2 > img {
        height: 140px;
    }

}

/* ================= CUSTOM SCROLLBAR ================= */

/* Chrome, Edge, Safari */
.custom-popup-content::-webkit-scrollbar {
    width: 6px;
}

.custom-popup-content::-webkit-scrollbar-track {
    background: transparent; /* brak tła */
}

.custom-popup-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.6); /* czarna kreska */
    border-radius: 10px;
}

.custom-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Firefox */
.custom-popup-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.6) transparent;
}

/* ================= GRID 100 (IZOLOWANY) ================= */
.grid100 {
    padding: 20px 0;
}

.grid100-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

.grid100-item {
    background: white;
    border-radius: 10px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Mobile */
@media (max-width: 600px) {
    .grid100-container {
        grid-template-columns: 1fr;
    }
}
