/* =====================================================
   NOBAMO E-shop - Filter & Modal Styles
   Štýly pre filtre, drawer menu a Quick View modal
   ===================================================== */

/* ==================== CSS PREMENNÉ ==================== */
:root {
    --brand-primary: #dc2626;
    --brand-primary-hover: #b91c1c;
    --brand-primary-light: #fef2f2;
    --brand-primary-focus: rgba(220, 38, 38, 0.2);
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --transition-fast: 150ms;
    --transition-base: 200ms;
    --transition-slow: 300ms;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==================== CHECKBOX STYLES ==================== */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.375rem;
    background-color: white;
    cursor: pointer;
    transition: all var(--transition-base) ease;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:hover {
    border-color: var(--gray-400);
}

input[type="checkbox"]:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
    width: 0.35rem;
    height: 0.65rem;
    border: solid white;
    border-width: 0 2px 2px 0;
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-primary-focus);
}

input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== NUMBER INPUT STYLES ==================== */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-focus);
}

/* ==================== FILTER DRAWER ==================== */

/* Base styles */
#filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px -5px rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
    z-index: 50;
}

/* Otvorený stav */
#filter-drawer:not(.translate-x-full) {
    transform: translateX(0);
}

/* Webkit scrollbar */
#filter-drawer::-webkit-scrollbar {
    width: 8px;
}

#filter-drawer::-webkit-scrollbar-track {
    background: #f3f4f6;
}

#filter-drawer::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

#filter-drawer::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Overlay */
#filter-drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 40;
}

#filter-drawer-overlay.opacity-0 {
    opacity: 0;
}

#filter-drawer-overlay.pointer-events-none {
    pointer-events: none;
}

/* ==================== RESPONSIVE WIDTHS ==================== */

/* Extra small mobile - 90% šírky */
@media (max-width: 380px) {
    #filter-drawer {
        width: 90vw !important;
        max-width: 90vw !important;
    }
}

/* Mobile - 85% šírky (nechá 15% priestor vľavo) */
@media (min-width: 381px) and (max-width: 639px) {
    #filter-drawer {
        width: 85vw !important;
        max-width: 85vw !important;
    }
}

/* Small tablets - 80% šírky */
@media (min-width: 640px) and (max-width: 767px) {
    #filter-drawer {
        width: 80vw !important;
        max-width: 500px !important;
    }
}

/* Tablets - 70% šírky */
@media (min-width: 768px) and (max-width: 1023px) {
    #filter-drawer {
        width: 70vw !important;
        max-width: 600px !important;
    }
}

/* Desktop - pevná šírka */
@media (min-width: 1024px) {
    #filter-drawer {
        width: 400px !important;
        max-width: 400px !important;
    }
}

/* Large desktop */
@media (min-width: 1536px) {
    #filter-drawer {
        width: 450px !important;
        max-width: 450px !important;
    }
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-reduced-motion: reduce) {
    #filter-drawer,
    #filter-drawer-overlay {
        transition: none;
    }
}

@media print {
    #filter-drawer,
    #filter-drawer-overlay {
        display: none !important;
    }
}
/* ==================== CUSTOM SCROLLBAR ==================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

/* ==================== QUICK VIEW MODAL ==================== */
#quick-view-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: modalFadeIn var(--transition-base) ease-out;
}

#quick-view-modal > div:nth-child(2) {
    animation: modalSlideUp var(--transition-slow) ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal thumbnails */
#modal-thumbnails button {
    transition: all var(--transition-base) ease;
}

#modal-thumbnails button:hover {
    transform: scale(1.05);
}

/* ==================== PRODUCT CARD ANIMATIONS ==================== */
.product-card {
    transition: all var(--transition-slow) ease;
}

.product-card:hover {
    transform: translateY(-8px);
}

/* Quick View Button Animations */
.quick-view-btn {
    transition: all var(--transition-base) ease;
}

.quick-view-btn:hover {
    transform: scale(1.05);
}

.quick-view-btn:active {
    transform: scale(0.98);
}

/* ==================== FILTER BADGES ==================== */
.filter-badge,
[class*="filter-badge-"] {
    transition: all var(--transition-fast) ease;
}

.filter-badge:hover,
[class*="filter-badge-"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.filter-badge:active,
[class*="filter-badge-"]:active {
    transform: translateY(0);
}

/* ==================== PAGINATION ==================== */
.pagination-btn {
    transition: all var(--transition-fast) ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:active {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== LOADING STATES ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--brand-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* ==================== FADE ANIMATIONS ==================== */
.fade-in {
    animation: fadeIn var(--transition-slow) ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.fade-out {
    animation: fadeOut var(--transition-slow) ease-out;
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
    }
    to { 
        opacity: 0; 
    }
}

/* ==================== SLIDE ANIMATIONS ==================== */
.slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-down {
    animation: slideDown var(--transition-slow) ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================== SCALE ANIMATIONS ==================== */
.scale-in {
    animation: scaleIn var(--transition-base) ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-out {
    animation: scaleOut var(--transition-base) ease-in;
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* ==================== BUTTON STYLES ==================== */
.btn-brand {
    background-color: var(--brand-primary);
    color: white;
    transition: all var(--transition-base) ease;
}

.btn-brand:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-brand:active {
    transform: translateY(0);
}

.btn-brand:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-primary-focus);
}

/* ==================== FOCUS STATES ==================== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state svg {
    margin: 0 auto;
    color: var(--gray-400);
}

/* ==================== Z-INDEX HIERARCHY ==================== */
#filter-drawer-overlay {
    z-index: 40;
}

#filter-drawer {
    z-index: 50;
}

#quick-view-modal {
    z-index: 60;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    #filter-drawer {
        width: 85vw;
        max-width: 400px;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    #filter-drawer {
        width: 90vw;
        max-width: 100vw;
    }
    
    #quick-view-modal .grid {
        grid-template-columns: 1fr;
    }
    
    #quick-view-modal > div:nth-child(2) {
        margin: 0;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    /* Menšie tlačidlá na mobile */
    .quick-view-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
    #filter-drawer {
        width: 100vw;
    }
    
    /* Stack price na mobile */
    .product-card .price-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* GPU akcelerácia pre plynulejšie animácie */
.product-card,
.quick-view-btn,
#filter-drawer,
#quick-view-modal {
    transform: translateZ(0);
    will-change: transform;
}

/* Po skončení animácie vypnúť will-change */
.product-card:not(:hover),
.quick-view-btn:not(:hover) {
    will-change: auto;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    #filter-drawer,
    #filter-drawer-overlay,
    #quick-view-modal,
    .quick-view-btn,
    #open-filters,
    .filter-badge {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none !important;
        transform: none !important;
    }
}

/* ==================== REDUCED MOTION ==================== */
@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;
    }
    
    .product-card:hover {
        transform: none;
    }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    input[type="checkbox"] {
        border-width: 3px;
    }
    
    .quick-view-btn {
        border: 2px solid currentColor;
    }
    
    #filter-drawer {
        border: 1px solid var(--gray-900);
    }
}

/* ==================== DARK MODE READY ==================== */
@media (prefers-color-scheme: dark) {
    /* Pripravené pre budúcu implementáciu */
    /* Zatiaľ neaktívne */
}

/* ==================== UTILITY CLASSES ==================== */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

.select-none {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* ==================== BRAND COLORS ==================== */
.text-brand {
    color: var(--brand-primary);
}

.bg-brand {
    background-color: var(--brand-primary);
}

.border-brand {
    border-color: var(--brand-primary);
}

.hover\:text-brand:hover {
    color: var(--brand-primary);
}

.hover\:bg-brand:hover {
    background-color: var(--brand-primary);
}

.hover\:bg-brand-hover:hover {
    background-color: var(--brand-primary-hover);
}

/* ==================== LINE CLAMP ==================== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ==================== ASPECT RATIO ==================== */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

/* ==================== BACKDROP BLUR ==================== */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ==================== SAFE AREA INSETS (pre iOS) ==================== */
@supports (padding: max(0px)) {
    #filter-drawer {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
}

/* ==================== END OF FILE ==================== */