/*  RESET I USTAWIENIA BAZOWE */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #ffffff;
    --color-text-main: #111111;
    --color-text-muted: #767676;
    --color-accent: #000000;
    --color-accent-hover: #333333;
    --color-border: #e5e5e5;
    --color-sale: #d93838;
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* NAVBAR  */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

#logoContainer a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#logoContainer img {
    height: 80px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, 
.nav-links a.active {
    border-color: var(--color-accent);
}

.nav-icons {
    display: flex;
    gap: 20px;
}

.icon-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.icon-link:hover {
    color: var(--color-text-muted);
}

/* ============================================= */
/* PRZEŁĄCZNIK MENU MOBILNEGO (hamburger)         */
/* Prawdziwy <button>, przełączany małym JS-em     */
/* (patrz kod JS w wiadomości) - żadnego ukrytego  */
/* inputa, żadnej zależności od kolejności w DOM.  */
/*                                                 */
/* W HTML w środku <nav> dodaj (obojętnie gdzie):  */
/*                                                 */
/*  <button type="button" class="hamburger"        */
/*          id="menuToggle" aria-label="Menu"      */
/*          aria-expanded="false">                 */
/*      <span></span><span></span><span></span>    */
/*  </button>                                      */
/* ============================================= */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 44px;
    height: 44px;
    padding: 13px 10px;
    box-sizing: border-box;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-accent);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* animacja hamburgera w krzyżyk po otwarciu (klasa dodawana przez JS) */
.hamburger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* BANER GŁÓWNY */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), 
                url('') no-repeat center center/cover;  /*tutaj url do zdjecia ktore jest na poczatku*/
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
}

.hero-content {
    max-width: 700px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    letter-spacing: 1px;
    font-weight: 300;
}

.btn-primary {
    display: inline-block;
    background-color: #ffffff;
    color: #000000;
    padding: 15px 40px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    background-color: #000000;
    color: #ffffff;
}


   /*  SEKCJA KALKULATORA  */
#calculateSection {
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/*  KAFELKI PROMO (PROMO GRIDS)*/
.promo-grids {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.promo-card {
    height: 450px;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    overflow: hidden;
}

.card-large {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), 
                      url('https://images.unsplash.com/photo-1556821840-3a63f95609a7?q=80&w=1000');
}

.card-small {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), 
                      url('https://images.unsplash.com/photo-1503342217505-b0a15ec3261c?q=80&w=1000');
}

.promo-text {
    color: #ffffff;
    z-index: 2;
}

.promo-text h2 {
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.btn-underline {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 5px;
}

.btn-underline:hover {
    color: #cccccc;
    border-color: #cccccc;
}

/*  SIATKA PRODUKTÓW  */
.products-section {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-title p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px 20px;
}

.product-card {
    background-color: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-image {
    position: relative;
    background-color: #f7f7f7;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Badges (Nowość / Promocja) */
.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

.tag-new {
    background-color: var(--color-accent);
    color: #ffffff;
}

.tag-sale {
    background-color: var(--color-sale);
    color: #ffffff;
}

/* Przycisk szybkiego dodawania na hover */
.quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-accent);
    color: #ffffff;
    border: none;
    padding: 15px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transform: translateY(100%);
    transition: var(--transition-smooth);
    z-index: 6;
}

.product-card:hover .quick-add {
    transform: translateY(0);
}

.quick-add:hover {
    background-color: var(--color-accent-hover);
}

/* Informacje o produkcie */
.product-info {
    padding: 20px 0 0 0;
    text-align: left;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.product-name a:hover {
    color: var(--color-text-muted);
}

.product-category {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.old-price {
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-right: 8px;
    font-weight: 400;
}

/*   SEKCJA PARAMETRÓW  */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 80px 5%;
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.feature-item h4 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-item p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* FOOTER  */
footer {
    background-color: #0f0f0f;
    color: #ffffff;
    padding: 80px 5% 40px 5%;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

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

.footer-column h5 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-column a {
    color: #aaaaaa;
    font-size: 0.9rem;
}

.footer-column a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid #222222;
    padding-top: 30px;
    text-align: center;
    color: #666666;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================= */
/* RESPONSYWNOŚĆ - od dużych tabletów w dół       */
/* ============================================= */

/* --- Duże tablety / małe laptopy (≤1199px) --- */
@media (max-width: 1199px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 30px 18px;
    }
}

/* --- Tablety poziomo (≤992px) --- */
@media (max-width: 992px) {
    .promo-grids {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 30px 5%;
    }

    .promo-card {
        height: 350px;
        padding: 30px;
    }

    .features-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 60px 5%;
    }

    .feature-item h4 {
        font-size: 1rem;
    }
}

/* --- Tablety / menu mobilne aktywuje się tutaj (≤900px) --- */
@media (max-width: 900px) {
    nav {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    #logoContainer img {
        height: 56px;
    }

    /* pokaż hamburger, wyśrodkuj logo, ukryj linki pod spodem */
    .hamburger {
        display: flex;
        order: 1;
    }

    #logoContainer {
        order: 2;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .nav-icons {
        order: 3;
        gap: 14px;
    }

    .nav-links {
        order: 4;
        flex-basis: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: var(--transition-smooth);
    }

    /* rozwinięcie menu po kliknięciu hamburgera (klasa dodawana przez JS) */
    .nav-links.is-open {
        max-height: 240px;
        opacity: 1;
        padding: 15px 0 5px 0;
        margin-top: 15px;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 16px 24px -16px rgba(0, 0, 0, 0.15);
    }

    .nav-links a {
        width: 100%;
        padding: 14px 0;
        text-align: center;
        border-bottom: 1px solid var(--color-border);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 30px 16px;
    }
}

/* --- Tablety pionowo / duże telefony (≤768px) --- */
@media (max-width: 768px) {
    .hero-section {
        height: 60vh;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2.3rem;
        letter-spacing: 2px;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .btn-primary {
        padding: 13px 30px;
    }

    .section-title h2 {
        font-size: 1.7rem;
        letter-spacing: 2px;
    }

    .products-section,
    #calculateSection {
        padding: 40px 5%;
    }

    .features-section {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 50px 5%;
        text-align: center;
    }

    footer {
        padding: 50px 5% 30px 5%;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
        margin-bottom: 40px;
    }

    .footer-column {
        align-items: center;
    }

    /* Na telefonach przycisk koszyka pojawia się na stałe zamiast hovera */
    .quick-add {
        transform: translateY(0);
        font-size: 0.8rem;
        padding: 10px;
    }

    /* Galeria zdjęć produktu - strzałki i kropki zawsze widoczne na dotyku */
    .gallery-arrow {
        opacity: 1;
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .gallery-dots {
        bottom: 46px;
    }
}

/* --- Telefony (≤576px) --- */
@media (max-width: 576px) {
    nav {
        padding: 12px 16px;
    }

    #logoContainer img {
        height: 46px;
    }

    .nav-icons {
        gap: 10px;
    }

    .icon-link {
        font-size: 0.75rem;
    }

    .hero-section {
        height: 55vh;
        min-height: 340px;
        padding: 0 15px;
    }

    .hero-content h1 {
        font-size: 1.7rem;
        letter-spacing: 1px;
        margin-bottom: 12px;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .btn-primary {
        padding: 12px 26px;
        font-size: 0.8rem;
    }

    .promo-card {
        height: 260px;
        padding: 20px;
    }

    .promo-text h2 {
        font-size: 1.4rem;
    }

    .section-title {
        margin-bottom: 30px;
    }

    .section-title h2 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    /* siatka produktów - 2 kolumny, jak w większości sklepów mobilnych */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 12px;
    }

    .product-info {
        padding: 12px 0 0 0;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-category {
        font-size: 0.75rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .badge {
        top: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 0.65rem;
    }

    .quick-add {
        font-size: 0.7rem;
        padding: 8px;
    }

    .features-section {
        padding: 40px 5%;
        gap: 25px;
    }

    /* panel admina - formularz edycji zwęża się dobrze, ale rzędy cen w kolumnę */
    .edit-price-row {
        flex-direction: column;
        gap: 6px;
    }

    .gallery-edit-thumb {
        width: 54px;
    }

    .gallery-edit-thumb img {
        width: 54px;
        height: 54px;
    }
}

/* --- Małe telefony (≤400px) --- */
@media (max-width: 400px) {
    .hero-content h1 {
        font-size: 1.4rem;
    }

    .products-grid {
        gap: 20px 10px;
    }

    .promo-text h2 {
        font-size: 1.2rem;
    }

    .footer-bottom {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }
}

.admin-card-controls {
            background: #fff0f0;
            border: 1px solid #ffb3b3;
            padding: 15px;
            margin-top: 15px;
            border-radius: 6px;
        }
        .admin-card-controls h4 {
            font-size: 0.85rem;
            text-transform: uppercase;
            color: #d93838;
            margin-bottom: 10px;
        }
        .edit-form-grid {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 12px;
        }
        .edit-form-grid label {
            font-size: 0.7rem;
            font-weight: bold;
            text-transform: uppercase;
            color: #555;
            margin-bottom: -4px;
        }
        .edit-form-grid input, .edit-form-grid select, .edit-form-grid textarea {
            width: 100%;
            padding: 6px 8px;
            border: 1px solid #ccc;
            font-size: 0.8rem;
            box-sizing: border-box;
            border-radius: 3px;
            font-family: inherit;
        }
        .edit-form-grid textarea {
            min-height: 70px;
            resize: vertical;
        }
        .edit-price-row {
            display: flex;
            gap: 8px;
        }
        .edit-price-row > div {
            flex: 1;
        }
        .btn-save-edit {
            background: #28a745;
            color: #fff;
            width: 100%;
            padding: 8px;
            margin-bottom: 8px;
        }
        .btn-save-edit:hover { background: #218838; }

/* ============================================= */
/* GALERIA ZDJĘĆ PRODUKTU (widok sklepu)          */
/* ============================================= */
.product-gallery {
    position: absolute;
    inset: 0;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 0;
}

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

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--color-text-main);
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: var(--transition-smooth);
}

.product-card:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow:hover {
    background: #ffffff;
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

.gallery-dots {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 5;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.gallery-dot.active {
    background: var(--color-accent);
    transform: scale(1.3);
}

/* ============================================= */
/* GALERIA ZDJĘĆ — PANEL ADMINA (dodaj / edytuj)  */
/* ============================================= */
.gallery-add-section,
.gallery-edit-section,
.description-add-section {
    margin-top: 15px;
}

.gallery-add-section > strong,
.gallery-edit-section > label,
.description-add-section > strong {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.description-add-section textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    resize: vertical;
}

.gallery-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.gallery-input-row {
    display: flex;
    gap: 8px;
}

.gallery-input-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.btn-remove-image {
    background: var(--color-sale);
    color: #ffffff;
    border: none;
    width: 34px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-remove-image:hover {
    background: #b02828;
}

.btn-add-image {
    background: #ffffff;
    color: var(--color-text-main);
    border: 1px solid var(--color-text-main);
    padding: 8px 14px;
    font-size: 0.75rem;
}

.btn-add-image:hover {
    background: var(--color-text-main);
    color: #ffffff;
}

.gallery-edit-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.gallery-edit-thumb {
    width: 64px;
    text-align: center;
}

.gallery-edit-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid #ccc;
    margin-bottom: 4px;
}

.thumb-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--color-sale);
    cursor: pointer;
}