/**
 * SprachDeutsch E-Commerce - Custom Styles
 * Additional styles beyond Tailwind CSS
 */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --primary-50: #fff1f2;
    --primary-100: #ffe4e6;
    --primary-200: #fecdd3;
    --primary-300: #fda4af;
    --primary-400: #fb7185;
    --primary-500: #f43f5e;
    --primary-600: #e11d48;
    --primary-700: #be123c;
    --primary-800: #9f1239;
    --primary-900: #881337;

    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;

    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(225, 29, 72, 0.3);
}

/* ========================================
   Base Styles
   ======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.font-display {
    font-family: 'Outfit', sans-serif;
}

/* Selection */
::selection {
    background-color: var(--primary-100);
    color: var(--primary-900);
}

/* Focus styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ========================================
   Typography
   ======================================== */
.prose h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

/* Line clamp utility */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: 1rem;
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-600);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(225, 29, 72, 0.39);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-700);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.23);
    transform: translateY(-1px);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 4px var(--primary-200);
}

.btn-outline {
    border: 2px solid #e2e8f0;
    background-color: transparent;
    color: #475569;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.75rem;
}

/* ========================================
   Form Elements
   ======================================== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all var(--transition-fast) ease;
    background-color: #f8fafc;
}

.form-input:focus {
    background-color: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.form-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px #fee2e2;
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    transition: all var(--transition-fast) ease;
}

.form-checkbox {
    border-radius: 0.375rem;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}

/* ========================================
   Cards
   ======================================== */
/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: all var(--transition-normal) ease;
}

.card-hover {
    transition: all var(--transition-normal) ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-100);
}

/* Product Card */
.product-card {
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-normal) ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.1);
}

.product-card .product-image {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-card .product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-card .product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    transform: translateY(100%);
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-actions {
    transform: translateY(0);
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary-600);
    color: white;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Loading States
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-normal) ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown var(--transition-normal) ease forwards;
}

.animate-scale-in {
    animation: scaleIn var(--transition-normal) ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-normal) ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft var(--transition-normal) ease forwards;
}

.animate-bounce-soft {
    animation: bounce 2s ease-in-out infinite;
}

/* ========================================
   Header & Navigation
   ======================================== */
.header-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    transition: all var(--transition-normal) ease;
}

.header-sticky.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.nav-link {
    position: relative;
    color: #4b5563;
    font-weight: 500;
    transition: color var(--transition-fast) ease;
}

.nav-link:hover {
    color: var(--primary-600);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-600);
    transition: width var(--transition-normal) ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 50;
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.mobile-menu-backdrop.open {
    opacity: 1;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background-color: white;
    z-index: 51;
    transform: translateX(-100%);
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-content.open {
    transform: translateX(0);
}

/* ========================================
   Product Gallery
   ======================================== */
.gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.gallery-main img {
    transition: opacity var(--transition-fast) ease;
}

.gallery-thumb {
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    opacity: 0.6;
    transition: all var(--transition-fast) ease;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
}

.gallery-thumb.active {
    box-shadow: 0 0 0 2px var(--primary-500);
    opacity: 1;
}

/* ========================================
   Quantity Selector
   ======================================== */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.quantity-selector button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    color: #475569;
    transition: all var(--transition-fast) ease;
}

.quantity-selector button:hover:not(:disabled) {
    background-color: #f1f5f9;
    color: #0f172a;
}

.quantity-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-selector input {
    width: 3rem;
    text-align: center;
    border: none;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
}

.quantity-selector input::-webkit-inner-spin-button,
.quantity-selector input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========================================
   Price Styles
   ======================================== */
.price {
    font-weight: 700;
    color: var(--primary-600);
}

.price-original {
    text-decoration: line-through;
    color: #94a3b8;
    font-weight: 400;
}

.price-discount {
    color: var(--primary-600);
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-item {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-weight: 500;
    color: #475569;
    transition: all var(--transition-fast) ease;
}

.pagination-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.pagination-item.active {
    background-color: var(--primary-600);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.4);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }

    a {
        text-decoration: underline;
    }
}