/**
 * E-Ticaret Frontend - Ana CSS
 * modamizbir.com Tasarımı - Mobile-First
 */

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #e53935;
    --primary-dark: #c62828;
    --secondary: #2c3e50;
    --accent: #ff6b35;
    --dark: #1a1a2e;
    --footer-bg: #1a1a2e;
    
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --text-light: #999;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    
    --border-color: #eee;
    
    --logo-height: 72px;
    --logo-max-width: min(360px, 78vw);
    --header-height: 86px;
    --header-cta-height: 56px;
    --search-height: 68px;
    --bottom-nav-height: 60px;
    --top-bar-height: 0px;
    --duyuru-height: 0px;
    --page-top-margin: calc(var(--duyuru-height) + var(--top-bar-height) + var(--header-height) + var(--header-cta-height) + var(--search-height) + 8px);
    
    --transition: all 0.3s ease;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 0;
}

/* Footer bottom-nav için yer açsın */
.site-footer {
    margin-bottom: var(--bottom-nav-height);
}

@media (min-width: 768px) {
    .site-footer {
        margin-bottom: 0;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

ul, ol {
    list-style: none;
}

/* ========== HEADER ========== */
.site-header {
    position: fixed;
    top: var(--duyuru-height, 0px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.header-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 8px 16px;
    min-height: var(--header-height);
    height: auto;
    border-bottom: 1px solid var(--border-color);
}

.menu-toggle {
    justify-self: start;
}

.site-logo {
    grid-column: 2;
    justify-self: center;
}

.header-actions {
    grid-column: 3;
    justify-self: end;
}

@media (max-width: 767px) {
    .header-top {
        grid-template-columns: 40px 1fr 40px;
        gap: 8px 0;
        padding: 6px 16px 10px;
        min-height: 0;
    }
    .menu-toggle {
        grid-column: 1;
        grid-row: 1;
        z-index: 2;
    }
    .site-logo {
        grid-column: 1 / -1;
        grid-row: 1;
        flex: none;
        width: 100%;
        padding: 0 40px;
        justify-self: stretch;
    }
    .header-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-self: stretch;
    }
}

.menu-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-primary);
}

.site-logo {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
}

.site-logo img {
    height: var(--logo-height) !important;
    width: auto !important;
    max-width: var(--logo-max-width) !important;
    max-height: none !important;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.site-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.site-logo-text span {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    border-radius: 50%;
    position: relative;
}

.header-action-btn .badge,
.header-action-btn .action-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: #e53935;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-action-btn .favori-badge {
    background: #e91e63;
}

.header-action-btn .sepet-badge {
    background: #e53935;
}

/* Search Bar */
.search-bar {
    padding: 8px 16px 10px;
    background: var(--bg-primary);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    font-size: 18px;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -1px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 22px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.nav-item .badge {
    position: absolute;
    top: 2px;
    right: 10px;
    min-width: 16px;
    height: 16px;
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== SIDE MENU ========== */
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85%;
    background: var(--bg-primary);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    padding: 20px 16px;
    background: var(--primary);
    color: white;
}

.side-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.side-menu-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.side-menu-user-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.side-menu-user-info p {
    font-size: 12px;
    opacity: 0.8;
}

.side-menu-content {
    flex: 1;
    padding: 12px 0;
}

.menu-category-title {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 1px;
}

.menu-list {
    padding: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
}

.menu-item i {
    width: 22px;
    font-size: 18px;
    color: var(--text-secondary);
}

.menu-item .arrow {
    margin-left: auto;
    font-size: 14px;
    color: var(--text-light);
}

/* ========== UTILITIES ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.hidden { display: none !important; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (min-width: 768px) {
    :root {
        --logo-height: 88px;
        --logo-max-width: 420px;
        --header-height: 112px;
        --header-cta-height: 0px;
        --bottom-nav-height: 0px;
        --page-top-margin: calc(var(--duyuru-height) + var(--top-bar-height) + var(--header-height) + var(--search-height));
    }
    
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .header-top {
        padding: 10px 24px;
    }

    .site-logo-text {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    :root {
        --logo-height: 100px;
        --logo-max-width: 480px;
        --header-height: 120px;
        --page-top-margin: calc(var(--duyuru-height) + var(--top-bar-height) + var(--header-height) + var(--search-height));
    }

    .search-bar {
        max-width: 500px;
        margin: 0 auto;
    }
}
