/* Design System & Variables */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #0d0c22;
    --text-muted: #6e6d7a;
    --accent-color: #ea4c89;
    --accent-hover: #f082ac;
    --border-color: #e7e7e9;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0d0c22;
    --surface-color: #1a1a2e;
    --text-color: #ffffff;
    --text-muted: #9e9ea7;
    --accent-color: #ea4c89;
    --accent-hover: #f082ac;
    --border-color: #2d2d3e;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Base Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    transition: var(--transition);
    overflow-y: scroll;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Header & Navbar */
.navbar {
    background-color: var(--surface-color) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar-brand {
    color: var(--text-color) !important;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--text-color) !important;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 400px;
    flex-grow: 1;
    display: flex;
}

.search-input {
    background-color: var(--bg-color);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    width: 100%;
    transition: var(--transition);
    min-width: 0; /* Fix flexbox overflow */
}

.search-input:focus {
    background-color: var(--surface-color);
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 4px rgba(234, 76, 137, 0.1);
    outline: none;
}

/* Item Grid */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

/* Cards */
.card {
    background: var(--surface-color);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-8px);
}

.card-image-wrapper {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
}

.card-image {
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    width: 100%;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-body {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.card-price {
    color: var(--text-muted);
    font-weight: 600;
}

/* Buttons */
.btn-accent {
    background-color: var(--accent-color);
    border: none;
    border-radius: 99px;
    color: white !important;
    cursor: pointer;
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: scale(1.02);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}

.btn-outline:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 1rem;
    padding: 0.5rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent-color);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5rem;
    padding: 3rem 0;
}

.footer a {
    color: var(--text-muted);
}

.footer a:hover {
    color: var(--text-color);
}

/* Flags in nav */
.flag-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Jumbotron (Dribbble Style Hero) */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    letter-spacing: -2px;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.d-flex {
    display: flex;
}

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

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

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

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 3rem;
}

.ml-4 {
    margin-left: 1.5rem;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.pb-4 {
    padding-bottom: 1.5rem;
}

.pb-5 {
    padding-bottom: 3rem;
}

.pt-4 {
    padding-top: 1.5rem;
}

.w-100 {
    width: 100%;
}

.d-block {
    display: block;
}

.flex-grow-1 {
    flex-grow: 1;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Dropdown Menus */
.dropdown-menu {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow-hover);
    min-width: 160px;
    padding: 0.5rem 0;
    z-index: 1001;
}

.dropdown-item {
    color: var(--text-color);
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* Custom Gallery for Item Page */
.gallery-container {
    position: relative;
    width: 100%;
}

.gallery-main {
    aspect-ratio: 4/3;
    background: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-main img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.gallery-thumb {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    height: 60px;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-thumb.active {
    border-color: var(--accent-color);
}

/* Accessibility: Skip Link */
.skip-link {
    background: var(--accent-color);
    color: white !important;
    left: 50%;
    padding: 0.5rem 1.5rem;
    position: absolute;
    transform: translate(-50%, -100%);
    transition: transform 0.3s;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 700;
}

.skip-link:focus {
    transform: translate(-50%, 0);
    outline: 2px solid var(--text-color);
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}

