/* ============================================
   A. Blikle - Katalog Tortowy
   Nowoczesny flipbook - style
   ============================================ */

:root {
    --blikle-brown: #8c734c;
    --blikle-brown-light: #a68b62;
    --blikle-brown-dark: #6e5a3b;
    --blikle-gold: #c4a96a;
    --blikle-dark: #32373c;
    --blikle-gray: #b7b7b7;
    --blikle-gray-light: #e8e5e0;
    --blikle-white: #ffffff;
    --blikle-bg: #f5f2ed;
    --blikle-cream: #faf8f5;
    --font-main: 'Avenir', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-height: 56px;
    --nav-height: 50px;
    --contact-height: 52px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-main);
    background-color: var(--blikle-bg);
    color: var(--blikle-dark);
    overflow: hidden;
}

/* ---- SEO: Screen reader only ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- HEADER ---- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--blikle-white);
    border-bottom: 2px solid var(--blikle-gold);
    height: var(--header-height);
    z-index: 100;
    position: relative;
}

.site-header__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-header__logo {
    height: 48px;
    width: auto;
}

.site-header__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--blikle-brown-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Zakładki w headerze */
.site-header__tabs {
    display: flex;
    gap: 2px;
    background: var(--blikle-gray-light);
    border-radius: 8px;
    padding: 3px;
}

.site-header__tab {
    padding: 7px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--blikle-brown);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.site-header__tab:hover {
    color: var(--blikle-brown-dark);
}

.site-header__tab--active {
    background: var(--blikle-white);
    color: var(--blikle-brown-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---- FLIPBOOK CONTAINER ---- */
.flipbook-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - var(--header-height) - var(--nav-height) - var(--contact-height));
    padding: 16px 24px;
    background:
        radial-gradient(ellipse at center, var(--blikle-cream) 0%, var(--blikle-bg) 60%, #e5dfd6 100%);
    position: relative;
}

.flipbook-container {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Strony flipbooka */
.page {
    background-color: var(--blikle-white);
    overflow: hidden;
}

.page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.page--back-cover {
    background: linear-gradient(135deg, var(--blikle-cream) 0%, var(--blikle-gray-light) 100%);
}

/* ---- TOOLBAR NAWIGACJI ---- */
.nav-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    background: var(--blikle-white);
    border-top: 1px solid var(--blikle-gray-light);
    height: var(--nav-height);
    z-index: 100;
    position: relative;
}

.nav-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--blikle-brown);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    text-decoration: none;
}

.nav-toolbar__btn:hover {
    background: var(--blikle-bg);
    color: var(--blikle-brown-dark);
}

.nav-toolbar__btn:active {
    transform: scale(0.95);
    background: var(--blikle-gray-light);
}

.nav-toolbar__btn--accent {
    background: var(--blikle-brown);
    color: var(--blikle-white);
    border-radius: 10px;
}

.nav-toolbar__btn--accent:hover {
    background: var(--blikle-brown-dark);
    color: var(--blikle-white);
}

.nav-toolbar__page-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--blikle-dark);
    min-width: 80px;
    text-align: center;
    user-select: none;
    padding: 0 8px;
}

.nav-toolbar__separator {
    width: 1px;
    height: 26px;
    background: var(--blikle-gray-light);
    margin: 0 6px;
}

/* ---- PASEK KONTAKTOWY ---- */
.contact-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    background: linear-gradient(135deg, var(--blikle-brown-dark) 0%, var(--blikle-brown) 100%);
    color: var(--blikle-white);
    height: var(--contact-height);
    z-index: 200;
    position: relative;
}

.contact-bar__row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-bar__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.contact-bar__link {
    color: var(--blikle-white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.contact-bar__link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.contact-bar__icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.contact-bar__divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
}

.contact-bar__chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--blikle-white);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.3px;
}

.contact-bar__chat-btn:hover {
    background: var(--blikle-white);
    color: var(--blikle-brown-dark);
    border-color: var(--blikle-white);
}

.contact-bar__privacy-link {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}

/* ---- EKRAN LADOWANIA ---- */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--blikle-cream);
    z-index: 9999;
    transition: opacity 0.6s ease;
}

.loading-screen--hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-screen__logo {
    height: 70px;
    width: auto;
    margin-bottom: 20px;
}

.loading-screen__text {
    font-size: 15px;
    color: var(--blikle-brown-light);
    letter-spacing: 1px;
}

.loading-screen__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--blikle-gray-light);
    border-top-color: var(--blikle-brown);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-top: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- WIDOK SKLEPU ---- */
.shop-view {
    height: calc(100vh - var(--header-height) - var(--contact-height));
    overflow-y: auto;
    background: var(--blikle-bg);
    padding: 0;
}

.shop-view__filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--blikle-white);
    border-bottom: 1px solid var(--blikle-gray-light);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

.shop-view__filter {
    padding: 8px 18px;
    border: 1.5px solid var(--blikle-gray-light);
    border-radius: 24px;
    background: var(--blikle-white);
    color: var(--blikle-brown);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.shop-view__filter:hover {
    border-color: var(--blikle-brown-light);
    color: var(--blikle-brown-dark);
}

.shop-view__filter--active {
    background: var(--blikle-brown);
    color: var(--blikle-white);
    border-color: var(--blikle-brown);
}

.shop-view__filter--active:hover {
    background: var(--blikle-brown-dark);
    color: var(--blikle-white);
}

.shop-view__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.shop-view__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--blikle-brown-light);
    font-size: 14px;
    gap: 12px;
}

.shop-view__empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--blikle-brown-light);
    font-size: 15px;
}

.shop-view__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.shop-view__page-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--blikle-gray-light);
    border-radius: 8px;
    background: var(--blikle-white);
    color: var(--blikle-brown);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-view__page-btn:hover {
    border-color: var(--blikle-brown-light);
}

.shop-view__page-btn--active {
    background: var(--blikle-brown);
    color: var(--blikle-white);
    border-color: var(--blikle-brown);
}

/* Karta produktu */
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--blikle-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--blikle-dark);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card__img-wrap {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--blikle-cream);
    position: relative;
}

.product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(50, 55, 60, 0.85);
    color: var(--blikle-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.product-card__overlay-text {
    font-size: 12.5px;
    line-height: 1.5;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.product-card:hover .product-card__overlay {
    opacity: 1;
}

.product-card__info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--blikle-dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-card__desc {
    display: none;
}

.product-card__link {
    text-decoration: none;
    color: var(--blikle-dark);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--blikle-brown-dark);
    margin-top: auto;
}

.product-card__actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
}

.product-card__cta {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--blikle-brown);
    padding: 7px 10px;
    border: 1.5px solid var(--blikle-brown);
    border-radius: 20px;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.product-card__cta:hover {
    background: var(--blikle-brown);
    color: var(--blikle-white);
}

.product-card__ask {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--blikle-white);
    padding: 7px 10px;
    border: 1.5px solid var(--blikle-gold);
    border-radius: 20px;
    background: var(--blikle-gold);
    cursor: pointer;
    transition: all 0.2s;
}

.product-card__ask:hover {
    background: var(--blikle-brown);
    border-color: var(--blikle-brown);
}

/* ---- FULLSCREEN ---- */
.fullscreen-active .site-header,
.fullscreen-active .contact-bar {
    display: none;
}

.fullscreen-active .flipbook-wrapper {
    height: calc(100vh - var(--nav-height));
}

/* ---- RESPONSYWNOSC ---- */

/* Tablety */
@media (max-width: 1024px) {
    .site-header {
        padding: 0 16px;
    }

    .site-header__logo {
        height: 40px;
    }

    .site-header__title {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .site-header__tab {
        padding: 6px 14px;
        font-size: 12px;
    }

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

    .contact-bar {
        padding: 0 12px;
    }

    .contact-bar__row {
        gap: 14px;
    }

    .contact-bar__item {
        font-size: 13px;
    }

    .flipbook-wrapper {
        padding: 12px 16px;
    }
}

/* Telefony */
@media (max-width: 640px) {
    :root {
        --header-height: 48px;
        --nav-height: 46px;
        --contact-height: auto;
    }

    .site-header {
        padding: 0 12px;
    }

    .site-header__logo {
        height: 34px;
    }

    .site-header__title {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .site-header__tab {
        padding: 5px 12px;
        font-size: 11px;
    }

    .flipbook-wrapper {
        padding: 6px;
        height: calc(100vh - var(--header-height) - var(--nav-height) - 94px);
    }

    .shop-view {
        height: calc(100vh - var(--header-height) - 94px);
    }

    .shop-view__filters {
        gap: 6px;
        padding: 10px 12px;
    }

    .shop-view__filter {
        padding: 6px 12px;
        font-size: 12px;
    }

    .shop-view__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .product-card__name {
        font-size: 13px;
    }

    .product-card__desc {
        display: none;
    }

    .nav-toolbar {
        gap: 4px;
        padding: 0 8px;
    }

    .nav-toolbar__btn {
        width: 38px;
        height: 38px;
    }

    .nav-toolbar__page-info {
        font-size: 13px;
        min-width: 70px;
    }

    .contact-bar {
        padding: 10px 12px;
    }

    .contact-bar__row {
        gap: 10px;
    }

    .contact-bar__divider {
        display: none;
    }

    .contact-bar__item {
        font-size: 13px;
    }
}

/* Bardzo male ekrany */
@media (max-width: 380px) {
    .site-header__logo {
        height: 30px;
    }

    .nav-toolbar__btn {
        width: 34px;
        height: 34px;
    }

    .contact-bar__item {
        font-size: 12px;
    }

    .contact-bar__chat-btn {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* ---- WIDGET CZATU ---- */
.chat-widget {
    position: fixed;
    bottom: calc(var(--contact-height) + 16px);
    right: 20px;
    z-index: 1000;
    font-family: var(--font-main);
}

/* Przycisk otwierający */
.chat-widget__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--blikle-brown) 0%, var(--blikle-brown-dark) 100%);
    color: var(--blikle-white);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    position: absolute;
    bottom: 0;
    right: 0;
}

.chat-widget__toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.chat-widget__toggle--hidden {
    display: none;
}

/* Okno czatu */
.chat-widget__window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 340px;
    height: 480px;
    background: var(--blikle-white);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-widget__window--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Nagłówek czatu */
.chat-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--blikle-brown-dark) 0%, var(--blikle-brown) 100%);
    color: var(--blikle-white);
    flex-shrink: 0;
}

.chat-widget__header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-widget__header-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chat-widget__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.chat-widget__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6bcf6b;
    flex-shrink: 0;
}

.chat-widget__status-dot--offline {
    background: #aaa;
}

.chat-widget__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--blikle-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-widget__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Obszar wiadomości */
.chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--blikle-cream);
}

.chat-widget__message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}

.chat-widget__message--bot {
    align-self: flex-start;
    background: var(--blikle-white);
    color: var(--blikle-dark);
    border: 1px solid var(--blikle-gray-light);
    border-bottom-left-radius: 4px;
}

.chat-widget__message--user {
    align-self: flex-end;
    background: var(--blikle-brown);
    color: var(--blikle-white);
    border-bottom-right-radius: 4px;
}

.chat-widget__message--success {
    align-self: flex-start;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-bottom-left-radius: 4px;
    font-size: 13px;
}

.chat-widget__message--error {
    align-self: flex-start;
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
    border-bottom-left-radius: 4px;
    font-size: 13px;
}

.chat-widget__time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Formularz czatu */
.chat-widget__form {
    padding: 12px;
    border-top: 1px solid var(--blikle-gray-light);
    background: var(--blikle-white);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.chat-widget__form-row {
    display: flex;
    gap: 8px;
}

.chat-widget__input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--blikle-gray-light);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 13px;
    color: var(--blikle-dark);
    outline: none;
    transition: border-color 0.2s;
}

.chat-widget__input:focus {
    border-color: var(--blikle-brown-light);
}

.chat-widget__input::placeholder {
    color: var(--blikle-gray);
}

.chat-widget__msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-widget__textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--blikle-gray-light);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 13px;
    color: var(--blikle-dark);
    outline: none;
    resize: none;
    min-height: 38px;
    max-height: 80px;
    transition: border-color 0.2s;
}

.chat-widget__textarea:focus {
    border-color: var(--blikle-brown-light);
}

.chat-widget__textarea::placeholder {
    color: var(--blikle-gray);
}

.chat-widget__send {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: var(--blikle-brown);
    color: var(--blikle-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.chat-widget__send:hover {
    background: var(--blikle-brown-dark);
}

.chat-widget__send:active {
    transform: scale(0.95);
}

.chat-widget__send:disabled {
    background: var(--blikle-gray);
    cursor: not-allowed;
}

.chat-widget__privacy {
    font-size: 10.5px;
    color: var(--blikle-gray);
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

.chat-widget__privacy a {
    color: var(--blikle-brown-light);
    text-decoration: underline;
}

.chat-widget__privacy a:hover {
    color: var(--blikle-brown-dark);
}

/* Responsywność czatu */
@media (max-width: 640px) {
    .chat-widget {
        bottom: 100px;
        right: 12px;
        left: 12px;
    }

    .chat-widget__window {
        width: 100%;
        height: calc(100vh - 200px);
        max-height: 500px;
        border-radius: 12px;
    }

    .chat-widget__toggle {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 380px) {
    .chat-widget__window {
        height: calc(100vh - 180px);
    }

    .chat-widget__form-row {
        flex-direction: column;
    }
}
