/* Reset / stabilność na mobile */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #000000 #f0f0f0;
}

/* Blokada natywnego "przeciągania" obrazków — bez tego chwycenie zdjęcia
   produktu/miniatury i ruszenie myszą startuje przeglądarkowy
   drag-and-drop, po którym strona potrafi przestać reagować na kliknięcia. */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    user-drag: none;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: #f0f0f0;
}

body::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

body::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

@font-face {
    font-family: "Old English Text MT";
    src: url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.eot");
    src: url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.eot?#iefix")format("embedded-opentype"),
    url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.woff2")format("woff2"),
    url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.woff")format("woff"),
    url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.ttf")format("truetype"),
    url("https://db.onlinewebfonts.com/t/f3258385782c4c96aa24fe8b5d5f9782.svg#Old English Text MT")format("svg");
}

/* Global Styles */
body {
    margin: 0;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    opacity: 0;
    transform: translateY(12px);
    font-weight: 100;
    position: relative;
    background: #ffffff;

    /* Płynne pojawienie się: fade + lekki slide w górę (JS zdejmuje
       opacity/transform, gdy dane produktu są gotowe). */
    transition: opacity 0.6s ease-in-out, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    body {
        transform: none;
        transition: opacity 0.2s linear;
    }
}

/* Szary "znak wodny" w tle — ten sam napis "dystomia" co na stronie
   głównej i "Store Policy", żeby było spójnie. Na stronie produktu jest
   celowo SŁABSZY (opacity 0.03) i schowany pod treścią (z-index: -1),
   żeby nie walczył o uwagę ze zdjęciem produktu — ma być ledwo
   wyczuwalną fakturą tła, nie elementem strony. */
body::before {
    content: "dystomia";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);
    font-family: 'Old English Text MT', 'Times New Roman', serif;
    font-size: clamp(150px, 36vw, 560px);
    line-height: 1;
    color: #000000;
    opacity: 0.03;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: -1;
}

/* Przyciski (strzałki, rozmiary, koszyk, itd.) — grubszy font-weight niż bazowy 100 */
button {
    font-weight: 700;
}

/* Header */
#head {
    position: relative;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back {
    color: #f2f2f2;
    text-decoration: none;
    position: absolute;
    left: 20px;
    top: 36px;
    width: 37px;
    height: 37px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #202020;
    border-radius: 11px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

#back svg {
    width: 15px;
    height: 15px;
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    #back:hover {
        transform: translateY(-2px);
        background-color: #ffffff;
        color: #111111;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
}

#back.is-pressed {
    transform: translateY(-2px);
    background-color: #ffffff;
    color: #111111;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#napis {
    font-family: 'Old English Text MT';
    font-size: 60px;
    text-align: center;
    background: linear-gradient(to right, #a80808, #a80808, rgb(0, 0, 0) 50%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: normal; /* logo ma nie dziedziczyć font-weight z body */
}

.element {
    display: inline-block;
}

/* Produkt Section */
#produkt {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#produkt-container {
    display: flex;
    flex-direction: row;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
    gap: 20px;
}

#image-section {
    flex: 1;
    margin-right: 20px;
}

#main-image {
    position: relative;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    border-radius: 8px;
}

#main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 8px;
    transition: opacity 0.25s ease, transform 0.3s ease-in-out;
}

#arrows {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* ✅ Pozwala kliknąć obrazek pod spodem */
}

#arrows button {
    pointer-events: auto; /* ✅ Przyciski nadal można kliknąć */
    width: 46px;
    height: 46px;
    padding: 0;
    box-sizing: border-box;
    background-color: #202020;
    color: #f2f2f2;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Tailwind CSS shadow-lg, zamiast jednostronnego cienia "w lewo" na obu strzałkach */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

#arrows button svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    #arrows button:hover {
        background-color: #ffffff;
        color: #111111;
        transform: translateY(-2px);
        box-shadow: 0 14px 20px -3px rgba(0, 0, 0, 0.25), 0 4px 8px -4px rgba(0, 0, 0, 0.25);
    }
}

#arrows button.is-pressed {
    background-color: #ffffff;
    color: #111111;
    transform: translateY(-2px);
    box-shadow: 0 14px 20px -3px rgba(0, 0, 0, 0.25), 0 4px 8px -4px rgba(0, 0, 0, 0.25);
}



#thumbnails {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.thumbnail {
    width: 50px;
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    opacity: 0.6;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail.active {
    border-color: #000;
    opacity: 1;
}

#info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

#info-section p {
    margin: 6px 0;
}

/* Modal Styles */
#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Fullscreen Modal Styles */
#fullscreen-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#fullscreen-modal.visible {
    visibility: visible;
    opacity: 1;
}

#fullscreen-content {
    position: relative;
    width: 90%;
    height: 90%;
    transform: scale(0.96);
    transition: transform 0.3s ease;
}

#fullscreen-modal.visible #fullscreen-content {
    transform: scale(1);
}

#fullscreen-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

#fullscreen-close,
#fullscreen-prev,
#fullscreen-next {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    background-color: rgba(32, 32, 32, 0.75);
    color: #f2f2f2;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    font-size: 20px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    z-index: 2010;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

#fullscreen-prev svg,
#fullscreen-next svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    #fullscreen-close:hover,
    #fullscreen-prev:hover,
    #fullscreen-next:hover {
        background-color: #ffffff;
        color: #111111;
        border-color: rgba(0, 0, 0, 0.15);
    }
}

#fullscreen-close.is-pressed,
#fullscreen-prev.is-pressed,
#fullscreen-next.is-pressed {
    background-color: #ffffff;
    color: #111111;
    border-color: rgba(0, 0, 0, 0.15);
}

#fullscreen-close {
    top: 20px;
    right: 20px;
    font-size: 22px;
}

#fullscreen-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#fullscreen-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#addtocart {
    color: #f2f2f2;
    background-color: #202020;
    text-decoration: none;
    padding: 10px 15px;
    border: 2px solid #000000;
    border-radius: 30px;
    display: inline-block;
    align-self: flex-start;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    font-weight: 700; /* tak jak pozostałe przyciski */
    transition: background-color 0.3s, color 0.3s; /* Dodajemy przejście dla koloru tekstu */
    cursor: pointer;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    #addtocart:hover {
        background-color: #ffffff;
        color: #111111;
    }
}

#addtocart.is-pressed {
    background-color: #ffffff;
    color: #111111;
}

#produkt-name {
    font-size: 30px;
    font-family: 'Old English Text MT';
    background: linear-gradient(to right, #a80808, #a80808, rgb(0, 0, 0) 50%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#produkt-cost {
    font-size: 20px;
}

/* Informacja o pre-orderze pod ceną — kompaktowa plakietka + mały
   podpis obok (a nie szeroki pasek na całą kolumnę). */
.preorder-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
}

.preorder-badge {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: #a80808;
    padding: 4px 9px;
    border-radius: 999px;
}

.preorder-caption {
    font-size: 12px;
    color: gray;
    font-family: 'Courier New', Courier, monospace;
}

/* Limitowana edycja — ten sam kształt plakietki co pre-order, ale złota
   (odróżnia się od czerwonej marki, obie mogą wystąpić jedna pod drugą). */
.limited-badge {
    color: #3a2a05;
    background: #caa227;
}

#near {
    text-align: center;
    font-size: 13px;
}

#social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 15px;
    text-align: center;
    font-weight: 600; /* inne niż bazowy 100 */
}

#social p {
    margin: 0;
}

#social a {
    color: #000;
    text-decoration: none;
}

/* Responsywność */
@media (max-width: 768px) {
    #produkt-container {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    #image-section {
        margin-right: 0;
        width: 100%;
    }

    #arrows button {
        width: 40px;
        height: 40px;
    }

    #arrows button svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 480px) {
    #produkt-container {
        padding: 12px;
    }

    .thumbnail {
        width: 60px;
    }
}


#size-selector {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.size-btn {
    color: #000000;
    background: transparent;
    border: 2px solid #000000;
    border-radius: 30px;
    width: 42px;
    height: 42px;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.size-btn:hover {
    transform: translateY(-2px);
}

.size-btn.active {
    background-color: #000;
    color: #fff;
}

.size-btn.disabled {
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

.size-btn.disabled:hover {
    transform: none;
}

#opis {
    font-size: 15px;
    color: gray;
    font-family: 'Courier New', Courier, monospace;
}

/* Produkt bez rozmiarów (np. bletki) — brak wyboru rozmiaru, a przy zerowym
   stanie przycisk zostaje widoczny, ale wygaszony. */
#size-selector.hidden {
    display: none;
}

#addtocart.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
