/* ===========================================
   KATALOG - Base Responsive CSS Foundation
   Mobile-first approach, modern CSS Grid & Flexbox
   =========================================== */

/* --- CSS RESET & NORMALIZATION --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- COLOR & DESIGN TOKENS --- */
:root {
    /* Brand Colors */
    --katalog-bordeaux: #800020;
    --katalog-bordeaux-dark: #5f0016;
    --katalog-bordeaux-light: #a5334d;
    --katalog-blue: #235a81;
    --katalog-blue-dark: #1a4157;
    --katalog-blue-light: #4a7fa8;
    
    /* Status & Semantic */
    --katalog-green: #4EB368;
    --katalog-orange: #FFA500;
    --katalog-red: #dc2626;
    
    /* Neutral */
    --katalog-white: #ffffff;
    --katalog-black: #000000;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --gray-light: #f3f4f6;
    --gray-medium: #e5e7eb;
    --gray-dark: #9ca3af;
    
    /* Spacing Scale (8px base) */
    --spacing-2xs: 0.25rem;   /* 4px */
    --spacing-xs: 0.5rem;     /* 8px */
    --spacing-sm: 1rem;       /* 16px */
    --spacing-md: 1.5rem;     /* 24px */
    --spacing-lg: 2rem;       /* 32px */
    --spacing-xl: 3rem;       /* 48px */
    --spacing-2xl: 4rem;      /* 64px */
    
    /* Typography Scale */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 600;
    --z-modal-bg: 900;
    --z-modal: 1000;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --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);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    /* Content Width */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* --- RESPONSIVE UTILITIES --- */
/* Mobile-first: show only on small screens */
.mobile-only {
    display: block;
}

.tablet-up {
    display: none;
}

.desktop-up {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-up {
        display: block;
    }
}

@media (min-width: 1024px) {
    .desktop-up {
        display: block;
    }
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: --line-height-tight;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

h5, h6 {
    font-size: var(--font-size-base);
}

@media (min-width: 768px) {
    h1 {
        font-size: var(--font-size-5xl);
    }
    
    h2 {
        font-size: var(--font-size-4xl);
    }
    
    h3 {
        font-size: var(--font-size-2xl);
    }
}

p {
    line-height: var(--line-height-normal);
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

small {
    font-size: var(--font-size-sm);
}

/* --- LINKS --- */
a {
    color: var(--katalog-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--katalog-bordeaux);
    text-decoration: underline;
    outline: none;
}

/* --- BUTTONS --- */
button, .btn {
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.btn-primary {
    background-color: var(--katalog-bordeaux);
    color: var(--katalog-white);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--katalog-bordeaux-dark);
}

.btn-secondary {
    background-color: var(--katalog-blue);
    color: var(--katalog-white);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--katalog-blue-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--katalog-blue);
    color: var(--katalog-blue);
}

.btn-outline:hover,
.btn-outline:focus {
    background-color: var(--katalog-blue);
    color: var(--katalog-white);
}

/* --- FORMS --- */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--katalog-blue);
    box-shadow: 0 0 0 3px rgba(35, 90, 129, 0.1);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
}

/* --- CONTAINER --- */
.container {
    width: 100%;
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* --- GRID & FLEXBOX UTILITIES --- */
.grid {
    display: grid;
    gap: var(--spacing-sm);
}

@media (min-width: 768px) {
    .grid {
        gap: var(--spacing-md);
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.flex {
    display: flex;
    gap: var(--spacing-sm);
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

/* --- CARDS & BOXES --- */
.card {
    background: var(--katalog-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* --- ALERTS --- */
.alert {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: var(--katalog-red);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: var(--katalog-orange);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e3a8a;
    border-color: var(--katalog-blue);
}

/* --- RESPONSIVE IMAGES --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
    
}

/* --- TABLES --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

thead {
    background-color: var(--katalog-blue);
    color: var(--katalog-white);
}

th, td {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--gray-medium);
}

tbody tr:hover {
    background-color: var(--gray-light);
}

/* --- MOBILE MENU SUPPORT --- */
.hamburger {
    width: 2rem;
    height: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--katalog-blue);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
}

/* --- UTILITIES FOR COMMON PATTERNS --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.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;
}

/* --- PRINT STYLES --- */
@media print {
    body {
        background: white;
    }
    
    .no-print {
        display: none;
    }
}
