/**
 * E-Commerce Platform - Main Stylesheet
 * Design System based on spec.md
 */

/* ===================================
   CSS RESET & BASE
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--neutral-50);
    color: var(--neutral-900);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===================================
   DESIGN SYSTEM - CSS VARIABLES
   =================================== */

:root {
    /* Colors - from spec.md */
    --primary-900: #1a1a2e;
    --primary-500: #16213e;
    --primary-100: #e8eaf2;
    --accent-coral: #ff6b6b;
    --accent-mint: #4ecdc4;
    --accent-gold: #f7b731;

    /* Neutral Colors */
    --neutral-white: #fafbfc;
    --neutral-50: #f5f6f8;
    --neutral-100: #e4e6eb;
    --neutral-300: #b8bcc8;
    --neutral-600: #5d6475;
    --neutral-900: #1f2937;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Typography */
    --font-display: 'Space Grotesk', 'Cabinet Grotesk', system-ui, sans-serif;
    --font-body: 'DM Sans', 'Author', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */
    --text-7xl: 4.5rem;
    /* 72px */

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Spacing */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-10: 2.5rem;
    /* 40px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */
    --space-24: 6rem;
    /* 96px */
    --space-32: 8rem;
    /* 128px */

    /* Border Radius */
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;

    /* 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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--primary-900);
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-4xl);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    line-height: var(--leading-normal);
    margin-bottom: var(--space-4);
}

/* ===================================
   LAYOUT UTILITIES
   =================================== */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-24) 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tema tabanlı butonlar için temel sınıf (product-card.php) */
.btn-tw {
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.btn-tw:active {
    transform: scale(0.97);
}

/* Button Variants */
.btn-primary {
    background: var(--accent-coral);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: var(--primary-900);
    border: 2px solid var(--accent-coral);
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
}

.btn-secondary:hover {
    background: var(--accent-coral);
    color: white;
    border-color: var(--accent-coral);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-900);
    border: 2px solid var(--primary-500);
}

.btn-outline:hover {
    background: var(--primary-500);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-600);
    padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
    background: var(--neutral-100);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    height: 32px;
}

.btn-md {
    padding: var(--space-3) var(--space-6);
    height: 40px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    height: 48px;
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-xl);
    height: 56px;
}

/* ===================================
   FORM ELEMENTS
   =================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--neutral-100);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--neutral-900);
    background: white;
    transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-coral);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    display: block;
    font-size: var(--text-sm);
    color: var(--error);
    margin-top: var(--space-2);
}

.form-help {
    display: block;
    font-size: var(--text-sm);
    color: var(--neutral-600);
    margin-top: var(--space-2);
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===================================
   CARDS
   =================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.card-body {
    margin-bottom: var(--space-4);
}

.card-footer {
    padding-top: var(--space-4);
    border-top: 1px solid var(--neutral-100);
}

/* ===================================
   BADGES & TAGS
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--accent-coral);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

@media (max-width: 1024px) {
    :root {
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
    }

    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-12) 0;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.uppercase {
    text-transform: uppercase;
}

.capitalize {
    text-transform: capitalize;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* Display */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none;
}

/* Margin & Padding Utilities */
.m-0 {
    margin: 0;
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

/* ===================================
   PRODUCT CARD CAROUSEL (products.php)
   Mobil: Dikey scroll serbest, yatay swipe JS'e bırakılır.
   =================================== */
.carousel-images {
    touch-action: pan-y;
}
.carousel-image {
    touch-action: pan-y;
}

/* Swiper container'ları: dikey scroll serbest, yatay swipe Swiper'a */
.swiper,
.main-swiper,
.modern-swiper,
.minimal-swiper,
.grid-mobile-swiper {
    touch-action: pan-y;
}

/* ─── Page Content (TinyMCE output) ──────────────────────────── */
.page-content { color: #374151; line-height: 1.75; font-size: 1rem; }
.page-content h1 { font-size: 2em; font-weight: 700; margin: 1.2em 0 0.5em; color: #111827; }
.page-content h2 { font-size: 1.5em; font-weight: 700; margin: 1.2em 0 0.5em; color: #111827; padding-bottom: 0.3em; border-bottom: 2px solid #e5e7eb; }
.page-content h3 { font-size: 1.25em; font-weight: 600; margin: 1em 0 0.4em; color: #1f2937; }
.page-content h4 { font-size: 1.1em; font-weight: 600; margin: 0.8em 0 0.3em; color: #374151; }
.page-content p  { margin: 0 0 1em; }
.page-content ul { list-style: disc; padding-left: 1.75em; margin: 0 0 1em; }
.page-content ol { list-style: decimal; padding-left: 1.75em; margin: 0 0 1em; }
.page-content li { margin-bottom: 0.3em; }
.page-content blockquote { border-left: 4px solid var(--primary-color, #667eea); margin: 1.5em 0; padding: 0.75em 1.25em; background: #f9fafb; color: #4b5563; font-style: italic; border-radius: 0 8px 8px 0; }
.page-content pre { background: #1f2937; color: #f9fafb; padding: 1.25em; border-radius: 10px; overflow-x: auto; font-size: 0.875em; margin: 1em 0; }
.page-content code { font-family: 'Courier New', monospace; background: #f3f4f6; padding: 0.2em 0.4em; border-radius: 4px; font-size: 0.875em; }
.page-content pre code { background: transparent; padding: 0; color: inherit; }
.page-content table { border-collapse: collapse; width: 100%; margin: 1.25em 0; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.page-content th { background: #f3f4f6; font-weight: 600; text-align: left; padding: 0.65em 1em; border-bottom: 2px solid #e5e7eb; }
.page-content td { padding: 0.6em 1em; border-bottom: 1px solid #f3f4f6; }
.page-content tr:last-child td { border-bottom: none; }
.page-content tr:nth-child(even) td { background: #fafafa; }
.page-content a { color: var(--primary-color, #667eea); text-decoration: underline; text-underline-offset: 2px; }
.page-content a:hover { opacity: 0.8; }
.page-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 0.5em 0; }
.page-content hr { border: none; border-top: 2px solid #e5e7eb; margin: 2em 0; }
.page-content strong { font-weight: 700; color: #111827; }
.page-content em { font-style: italic; }