/* ====== ZÁKLAD ====== */
.vstupenky-merch-page {
    min-height: 100vh;
    font-family: var(--font-family-primary);
}

/* ====== COVER ====== */
.cover-section {
    position: relative;
    max-width: 1200px;
    margin: var(--spacing-xl) auto 0;
    min-height: clamp(160px, 35vw, 360px);
    overflow: hidden;
}

.cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ====== OBSAHOVÁ SEKCE ====== */
.content-section {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-left: calc(var(--spacing-md) + env(safe-area-inset-left));
    padding-right: calc(var(--spacing-md) + env(safe-area-inset-right));
}

.content-wrapper { margin: 0 auto; }

.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-primary);
    text-transform: lowercase;
}

.page-content {
    font-size: var(--font-size-lg);
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* ====== PRODUCTS SECTION ====== */
.products-section {
    background: var(--color-background-secondary, #f8f9fa);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.products-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    padding-left: calc(var(--spacing-md) + env(safe-area-inset-left));
    padding-right: calc(var(--spacing-md) + env(safe-area-inset-right));
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* ====== PRODUCT CARD ====== */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: fit-content;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--color-background-tertiary, #f1f3f4);
}
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .product-image { transform: scale(1.05); }

.product-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    color: var(--color-text-muted, #6c757d);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}
.product-placeholder svg { opacity: 0.5; }

.product-image-count {
    position: absolute; bottom: 12px; left: 12px;
    background: rgba(0, 0, 0, 0.7); color: white;
    font-size: 0.75rem; padding: 4px 8px; border-radius: 16px;
    font-weight: 500; display: flex; align-items: center; gap: 4px;
}
.product-image-count svg { width: 12px; height: 12px; }

/* ====== PRODUCT CONTENT ====== */
.product-content { padding: var(--spacing-md); }
.product-title {
    font-size: 1.25rem; font-weight: 600; margin-bottom: var(--spacing-sm);
    color: var(--color-text-primary); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-meta {
    display: flex; justify-content: flex-end; align-items: center;
    margin-bottom: var(--spacing-md); gap: var(--spacing-sm); flex-wrap: wrap;
}
.product-category {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--color-primary-light, #e7f3ff);
    color: var(--color-primary, #0969da);
    border: 1px solid var(--color-primary-border, #b6e3ff);
    font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; font-weight: 500; white-space: nowrap;
}
.product-category svg { width: 12px; height: 12px; }
.product-price { font-weight: 700; color: var(--color-success, #198754); font-size: 1.1rem; white-space: nowrap; }
.product-description {
    color: var(--color-text-secondary); font-size: 0.9rem; line-height: 1.5; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }
    .product-meta { flex-direction: column; align-items: flex-start; gap: var(--spacing-xs); }
    .product-image-container { height: 200px; }
    .cover-section { margin-top: var(--spacing-lg); min-height: clamp(120px, 30vw, 240px); }
}
@media (max-width: 480px) {
    .products-wrapper { padding: 0 var(--spacing-sm); }
    .product-content { padding: var(--spacing-sm); }
    .product-image-container { height: 180px; }
}
@media (min-width: 1400px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ====== PRODUCT MODAL ====== */
.product-modal {
    position: fixed; inset: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(10px);
}
.product-modal.active { opacity: 1; visibility: visible; }

.modal-content {
    background: white; border-radius: 20px;
    max-width: 95vw; max-height: 80vh; width: 1000px;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px); transition: all 0.3s ease;
}
.product-modal.active .modal-content { transform: scale(1) translateY(0); }

/* ====== MODAL HEADER ====== */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 2rem; border-bottom: 1px solid #f1f3f4; background: #fafbfc;
}
.modal-title { font-size: 1.5rem; font-weight: 600; color: var(--color-text-primary); margin: 0; line-height: 1.3; }
.modal-close {
    background: none; border: none; cursor: pointer; padding: 8px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; color: #6c757d;
}
.modal-close:hover { background: #f1f3f4; color: #495057; }

/* ====== MODAL BODY ====== */
.modal-body {
    display: flex; flex: 1;
    overflow: hidden;           /* bez scrollu v modalu */
    min-height: 0;
}
.modal-gallery {
    flex: 2; display: flex; flex-direction: column; min-height: 400px; min-width: 0;
}

/* ====== GALLERY MAIN (bez rezervy pro šipky + popisek uvnitř) ====== */
.gallery-main {
    flex: 1 1 auto; position: relative; background: #f8f9fa;
    display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.gallery-main-container {
    position: relative; width: 100%; flex: 1 1 auto; min-height: 0;
}
.gallery-main-image {
    width: 100%; height: 100%; object-fit: contain; display: block;
    /* fotka jde "pod" šipky – nic jí neodsouvá */
}

/* ====== GALLERY NAVIGATION (šipky přes fotku, bez vnitřního odsazení) ====== */
.gallery-nav-buttons {
    position: absolute; top: 50%; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    pointer-events: none; transform: translateY(-50%);
    padding: 0;                 /* žádná rezerva – šipky leží přímo nad fotkou */
}
.gallery-nav {
    background: rgba(0, 0, 0, 0.7); color: white; border: none; border-radius: 50%;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; pointer-events: auto; backdrop-filter: blur(10px);
    margin: 0 8px;              /* jen minimální offset od úplného okraje */
    z-index: 2;                  /* jistota, že jsou nad fotkou */
}
.gallery-nav:hover { background: rgba(0, 0, 0, 0.9); transform: scale(1.1); }
.gallery-nav:active { transform: scale(0.95); }

.gallery-counter {
    position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7); color: white; padding: 8px 16px; border-radius: 20px;
    font-size: 0.9rem; font-weight: 500; backdrop-filter: blur(10px); z-index: 2;
}

/* ====== THUMBNAILS (bez scrollu – zalamují se) ====== */
.gallery-thumbnails {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px; padding: 1rem; background: #f8f9fa; border-top: 1px solid #e9ecef;
    overflow: visible;          /* žádný horizontální scroll */
}
.gallery-thumbnail {
    width: 80px; height: 60px; border-radius: 8px; overflow: hidden; cursor: pointer;
    transition: all 0.2s ease; border: 3px solid transparent; flex: 0 0 auto;
}
.gallery-thumbnail:hover { transform: scale(1.05); }
.gallery-thumbnail.active { border-color: var(--color-primary, #0969da); transform: scale(1.05); }
.gallery-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* ====== MODAL INFO ====== */
.modal-info {
    flex: 1; padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; min-width: 300px; min-height: 0;
}
.modal-meta { display: flex; flex-direction: column; gap: 1rem; }
.modal-price { font-size: 2rem; font-weight: 700; color: var(--color-success, #198754); line-height: 1; }
.modal-description { color: var(--color-text-secondary, #6c757d); font-size: 1rem; line-height: 1.6; margin: 0; flex: 1; }

/* ====== RESPONSIVE MODAL ====== */
@media (max-width: 768px) {
    .modal-content {
        width: 100%; height: 100%; max-width: 100vw; max-height: 100vh;
        border-radius: 0; flex-direction: column;
    }
    .modal-header { padding: 1rem; }
    .modal-title { font-size: 1.25rem; }
    .modal-body { flex-direction: column; }
    .modal-gallery { min-height: 300px; flex: none; }
    .modal-info { padding: 1.5rem; min-width: auto; }
    .gallery-nav { width: 40px; height: 40px; }
    .gallery-nav-buttons { padding: 0; }
    .gallery-thumbnails { padding: 0.75rem; }
    .gallery-thumbnail { width: 60px; height: 45px; }
    .modal-price { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .modal-header { padding: 0.75rem; }
    .modal-info { padding: 1rem; }
    .gallery-thumbnails { gap: 6px; padding: 0.5rem; }
    .gallery-thumbnail { width: 50px; height: 38px; }
}

/* ====== IMAGE DESCRIPTION (fix – uvnitř modalu) ====== */
.image-description {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem 0.75rem;
    font-size: 0.9rem; line-height: 1.4; color: #6c757d; font-style: italic; text-align: center;
    border-top: 1px solid #e9ecef; margin: 0.5rem 1.5rem 0; background: #f8f9fa;
    display: none;
}
.image-description:not(:empty) { display: block; }
@media (max-width: 768px) {
    .image-description { padding: 0.5rem 1rem 0; font-size: 0.85rem; margin: 0.5rem 1rem 0; }
}
@media (max-width: 480px) {
    .image-description { padding: 0.5rem 0.75rem 0; font-size: 0.8rem; margin: 0.5rem 0.75rem 0; }
}

/* ====== FALLBACK COLORS ====== */
:root {
    --color-background-secondary: #f8f9fa;
    --color-background-tertiary: #f1f3f4;
    --color-text-muted: #6c757d;
    --color-text-secondary: #6c757d;
    --color-text-primary: #212529;
    --color-primary-light: #e7f3ff;
    --color-primary: #0969da;
    --color-primary-border: #b6e3ff;
    --color-success: #198754;
}
