/* Custom CSS for Korsberga Spa AB */
/* Optimized version with accessibility improvements */

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

.sr-only.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Animacje wejścia */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.animate-enter { 
    animation: fadeIn 0.6s ease-out forwards; 
    opacity: 0;
}

/* Logo w headerze */
header img[src*="Header.png"] {
    height: auto;
    width: auto;
    max-height: 48px;
    background: transparent;
    object-fit: contain;
}

@media (min-width: 768px) {
    header img[src*="Header.png"] {
        max-height: 60px;
    }
}

/* Watermark na kartach produktów */
.watermark {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0.3;
    mix-blend-mode: screen;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: transparent;
    object-fit: contain;
}

.group:hover .watermark {
    opacity: 0.5;
}

/* Watermark w lightboxie */
.lightbox-watermark {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.25;
    mix-blend-mode: screen;
    filter: brightness(1.2);
    pointer-events: none;
    z-index: 101;
    background: transparent;
    object-fit: contain;
}

@media (min-width: 768px) {
    .lightbox-watermark {
        opacity: 0.2;
    }
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none !important;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all !important;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 102;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 102;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* Aktywna podstrona w menu */
.nav-link.active {
    color: #C5A059;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Ochrona treści (opcjonalnie) */
body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

img {
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

/* Mini Gallery */
#mini-gallery {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Na urządzeniach dotykowych - scroll-snap */
@media (hover: none) and (pointer: coarse) {
    #mini-gallery {
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
    }
    
    .mini-gallery-item {
        scroll-snap-align: start;
    }
}

#mini-gallery::-webkit-scrollbar {
    height: 6px;
}

#mini-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#mini-gallery::-webkit-scrollbar-thumb {
    background: rgba(197, 160, 89, 0.5);
    border-radius: 3px;
}

#mini-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(197, 160, 89, 0.7);
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: thin;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.mini-gallery-item {
    flex-shrink: 0;
    width: 280px;
    height: 280px;
    touch-action: pan-x;
}

@media (min-width: 768px) {
    .mini-gallery-item {
        width: 300px;
        height: 300px;
    }
}

/* Na bardzo małych ekranach */
@media (max-width: 360px) {
    .mini-gallery-item {
        width: 240px;
        height: 240px;
    }
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .cookie-banner-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.cookie-banner-text {
    flex: 1;
    text-align: center;
}

@media (min-width: 768px) {
    .cookie-banner-text {
        text-align: left;
    }
}

.cookie-banner-title {
    font-family: 'Cinzel', serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #C5A059;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-banner-description {
    color: #e5e5e5;
    font-size: 0.875rem;
    line-height: 1.5;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #e5e5e5;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.cookie-btn:hover {
    border-color: #C5A059;
    color: #C5A059;
}

.cookie-btn-accept {
    background: #C5A059;
    color: #0a0a0a;
    border-color: #C5A059;
}

.cookie-btn-accept:hover {
    background: #b8944f;
    border-color: #b8944f;
    color: #0a0a0a;
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.cookie-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-modal.active .cookie-modal-content {
    transform: scale(1);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #C5A059;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.cookie-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #e5e5e5;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    border-color: #C5A059;
    color: #C5A059;
    background: rgba(197, 160, 89, 0.1);
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-modal-intro {
    color: #e5e5e5;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.cookie-category {
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #C5A059;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.cookie-category-desc {
    color: #b0b0b0;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0;
}

/* Cookie Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #e5e5e5;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #C5A059;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
    background-color: #0a0a0a;
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.5);
}

.cookie-modal-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-modal-link {
    color: #C5A059;
    font-size: 0.8125rem;
    text-decoration: underline;
    text-align: center;
    transition: color 0.3s ease;
}

.cookie-modal-link:hover {
    color: #b8944f;
}

.cookie-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .cookie-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cookie-modal-header {
        padding: 1rem;
    }
    
    .cookie-modal-body {
        padding: 1rem;
    }
    
    .cookie-modal-title {
        font-size: 1.25rem;
    }
    
    .cookie-modal-buttons {
        flex-direction: column;
    }
    
    .cookie-modal-buttons .cookie-btn {
        width: 100%;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
}

/* Responsywność - dodatkowe style */
@media (max-width: 767px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        opacity: 0.7;
    }
    
    .lightbox-nav.prev {
        left: 5px;
    }
    
    .lightbox-nav.next {
        right: 5px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
    
    .lightbox-watermark {
        bottom: 20px;
        max-width: 150px;
        opacity: 0.15;
    }
    
    /* Hint for swipe */
    .lightbox-overlay.active::after {
        content: '';
        position: absolute;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        animation: swipeHint 2s ease-in-out infinite;
    }
    
    @keyframes swipeHint {
        0%, 100% { transform: translateX(-50%); opacity: 0.3; }
        50% { transform: translateX(calc(-50% + 20px)); opacity: 0.6; }
    }
    
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-enter {
        animation: none;
        opacity: 1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .border-white\/5 {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .text-gray-300,
    .text-gray-400 {
        color: #e5e5e5;
    }
    
    .text-gray-500 {
        color: #d4d4d4;
    }
}

/* Focus visible for keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #C5A059;
    outline-offset: 2px;
}

/* Active language button state */
.lang-btn[aria-pressed="true"] {
    color: #C5A059;
    border-color: #C5A059;
}

/* Print styles */
@media print {
    header,
    footer,
    .cookie-banner,
    .lightbox-overlay {
        display: none !important;
    }
    
    main {
        padding-top: 0 !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

