/* ===========================================
   Pièces Auto - Public Styles
   Mobile-First Design (Instagram traffic)
   =========================================== */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --primary-light: #ff6b6b;
    --secondary: #457b9d;
    --accent: #2a9d8f;
    --dark: #1d3557;
    --dark-light: #2d4a6f;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #495057;
    --success: #2a9d8f;
    --warning: #f4a261;
    --danger: #e63946;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-dark);
}

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

/* ===========================================
   HEADER - Mobile first (compact)
   =========================================== */
.header {
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    color: white;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.logo-text {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text small {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Nav hidden on mobile */
.nav {
    display: none;
    gap: 5px;
}

.nav a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Search hidden in header on mobile, shown in mobile menu */
.search-form {
    display: none;
    gap: 0;
    max-width: 280px;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.95);
    color: var(--dark);
}

.search-form input::placeholder {
    color: var(--gray);
}

.search-form input:focus {
    outline: none;
    background: white;
}

.search-form button {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===========================================
   MOBILE MENU - Full screen drawer
   =========================================== */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 88%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: var(--light);
    border: none;
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--gray-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-nav {
    padding: 65px 20px 15px;
    display: flex;
    flex-direction: column;
}

.mobile-menu-nav a {
    color: var(--dark);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-light);
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-nav a:hover {
    color: var(--primary);
}

.mobile-search {
    padding: 5px 20px 15px;
}

.mobile-search input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 16px; /* prevent iOS zoom */
    margin-bottom: 10px;
    -webkit-appearance: none;
}

.mobile-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.mobile-search button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-categories {
    padding: 0 20px 30px;
    flex: 1;
}

.mobile-menu-categories h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray);
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-light);
}

.mobile-menu-categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 14px;
    color: var(--gray-dark);
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-categories a:hover {
    background: var(--primary);
    color: white;
}

.mobile-menu-categories a span {
    font-size: 0.75rem;
    background: white;
    padding: 2px 10px;
    border-radius: 10px;
    color: var(--gray);
}

.mobile-menu-categories a:hover span {
    background: rgba(255,255,255,0.2);
    color: white;
}

body.menu-open {
    overflow: hidden;
}

/* ===========================================
   SIDEBAR - Hidden on mobile, shown on desktop
   =========================================== */
.sidebar {
    display: none;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 600;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 4px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    color: var(--gray-dark);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.category-list a:hover {
    background: var(--light);
    color: var(--dark);
}

.category-list a.active {
    background: var(--primary);
    color: white;
}

.category-list .count {
    font-size: 0.75rem;
    background: var(--gray-light);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--gray);
}

.category-list a.active .count {
    background: rgba(255,255,255,0.25);
    color: white;
}

.info-box {
    background: #fff9e6;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border-left: 3px solid var(--warning);
}

.info-box p {
    margin-bottom: 8px;
    color: #856404;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box strong {
    color: #6d5200;
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.main-content h1 {
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 16px;
    font-weight: 700;
}

/* ===========================================
   ALERTS
   =========================================== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid var(--danger);
}

/* ===========================================
   MOBILE CATEGORIES BAR (horizontal scroll)
   =========================================== */
.mobile-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 16px;
    margin: 0 -16px 16px;
    padding-left: 16px;
    padding-right: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 52px;
    z-index: 50;
    background: var(--light);
    padding-top: 12px;
}

.mobile-categories::-webkit-scrollbar {
    display: none;
}

.mobile-categories a {
    flex-shrink: 0;
    padding: 10px 18px;
    background: white;
    border-radius: 25px;
    color: var(--gray-dark);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    -webkit-tap-highlight-color: transparent;
    border: 1.5px solid var(--gray-light);
}

.mobile-categories a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.25);
}

/* ===========================================
   PIECES GRID - 1 col mobile, 2 col tablet+
   =========================================== */
.pieces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.piece-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.piece-card:active {
    transform: scale(0.98);
}

.piece-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.piece-card-image {
    position: relative;
    height: 160px;
    background: var(--gray-light);
    overflow: hidden;
}

.piece-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.piece-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray);
    font-size: 0.8rem;
}

.piece-card-image .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.piece-card-content {
    padding: 12px;
}

.piece-category {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.piece-title {
    font-size: 0.95rem;
    margin: 4px 0 10px;
    color: var(--dark);
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.piece-pricing {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.price-base, .price-best {
    flex: 1;
    padding: 8px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.piece-pricing .label {
    display: block;
    font-size: 0.55rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.piece-pricing .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.piece-pricing .price.highlight {
    color: var(--accent);
}

.offers-count {
    font-size: 0.8rem;
    color: var(--secondary);
    padding-top: 10px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.offers-count::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.offers-count.no-offers {
    color: var(--gray);
    font-style: italic;
}

.offers-count.no-offers::before {
    background: var(--gray-light);
    animation: none;
}

/* ===========================================
   BADGES
   =========================================== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-info {
    background: var(--secondary);
    color: white;
}

/* ===========================================
   BUTTONS - Touch-friendly (min 48px)
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    min-height: 48px;
    background: white;
    color: var(--dark);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    min-height: 52px;
    font-size: 1rem;
    width: 100%;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ===========================================
   PIECE DETAIL PAGE - Mobile optimized
   =========================================== */
.breadcrumb {
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--gray);
    padding: 10px 14px;
    background: white;
    border-radius: var(--radius-md);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.breadcrumb a {
    color: var(--gray);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.piece-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.gallery-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-sm);
}

.gallery-main img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: var(--light);
}

.gallery-main.no-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    background: var(--light);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    width: 64px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    flex-shrink: 0;
    border: 3px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

.piece-info {
    background: white;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.piece-info h1 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--dark);
    line-height: 1.3;
}

.piece-category-tag {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-banner {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-reserved {
    background: #fff3cd;
    color: #856404;
    border-left: 3px solid var(--warning);
}

.status-sold {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid var(--danger);
}

.piece-pricing-detail {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.price-row:last-of-type {
    border-bottom: none;
}

.price-row.highlight {
    background: #e8f5e9;
    margin: 8px -16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.price-label {
    color: var(--gray);
    font-weight: 500;
    font-size: 0.9rem;
}

.price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
}

.price-row.highlight .price-value {
    color: var(--accent);
}

.offers-info {
    text-align: center;
    padding-top: 12px;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.piece-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.meta-item {
    background: var(--light);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.65rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meta-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.piece-description {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius-md);
}

.piece-description h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-size: 0.95rem;
}

.piece-description p {
    color: var(--gray-dark);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ===========================================
   OFFER FORM - Mobile optimized
   =========================================== */
.offer-section {
    background: white;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.offer-section h2 {
    margin-bottom: 16px;
    color: var(--dark);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.offer-section h2::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.offer-note {
    background: #fff9e6;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #856404;
    border-left: 3px solid var(--warning);
}

.offer-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 16px; /* prevent iOS zoom */
    transition: var(--transition);
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--gray);
    font-size: 0.75rem;
}

.input-prefix {
    display: flex;
    align-items: stretch;
}

.input-prefix span {
    background: var(--light);
    padding: 14px 14px;
    border: 2px solid var(--gray-light);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--gray);
    font-weight: 600;
    font-size: 16px;
}

.input-prefix input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.form-info {
    background: #e8f4fd;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    font-size: 0.85rem;
    color: #1565c0;
    border-left: 3px solid var(--secondary);
}

.form-info p {
    margin: 0;
}

.offer-section.sold {
    text-align: center;
    padding: 40px 20px;
}

.offer-section.sold p {
    color: var(--gray);
    margin-bottom: 16px;
    font-size: 1rem;
}

/* ===========================================
   EMPTY STATES
   =========================================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state p {
    margin-bottom: 16px;
    color: var(--gray);
    font-size: 1rem;
}

.search-no-results,
.search-results-count {
    margin-bottom: 16px;
    color: var(--gray);
    font-size: 0.9rem;
}

.category-description {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.home-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 16px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.home-header h1 {
    font-size: 1.5rem;
}

.home-header .subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ===========================================
   FOOTER - Compact on mobile
   =========================================== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 24px 16px;
    padding-bottom: calc(24px + var(--safe-bottom));
    text-align: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.footer p {
    max-width: 600px;
    margin: 4px auto;
}

.footer p:first-child {
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}

/* ===========================================
   RESPONSIVE - TABLET (768px+)
   =========================================== */
@media (min-width: 768px) {
    .header {
        padding: 14px 24px;
    }

    .header .container {
        flex-wrap: nowrap;
    }

    .nav {
        display: flex;
    }

    .search-form {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .main-content {
        padding: 24px;
    }

    .main-content h1 {
        font-size: 1.6rem;
    }

    .pieces-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .piece-card-image {
        height: 200px;
    }

    .piece-card-content {
        padding: 16px;
    }

    .piece-title {
        font-size: 1.05rem;
    }

    .piece-detail {
        flex-direction: row;
        gap: 24px;
    }

    .piece-gallery {
        flex: 1;
    }

    .piece-info {
        flex: 1;
        padding: 24px;
    }

    .gallery-main img {
        height: 400px;
    }

    .piece-info h1 {
        font-size: 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .btn-lg {
        width: auto;
    }
}

/* ===========================================
   PAGE WRAPPER - contient sidebar + main
   =========================================== */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===========================================
   RESPONSIVE - DESKTOP (1024px+)
   =========================================== */
@media (min-width: 1024px) {
    .page-wrapper {
        display: flex;
        flex-direction: row;
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }

    .sidebar {
        display: block;
        width: 250px;
        min-width: 250px;
        background: white;
        padding: 20px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        margin: 20px;
        margin-right: 0;
        position: sticky;
        top: 60px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        align-self: flex-start;
    }

    .main-content {
        flex: 1;
        padding: 20px 24px;
        min-width: 0;
    }

    .mobile-categories {
        display: none;
    }

    .pieces-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===========================================
   RESPONSIVE - LARGE DESKTOP (1400px+)
   =========================================== */
@media (min-width: 1400px) {
    .pieces-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===========================================
   ANIMATIONS & UTILITIES
   =========================================== */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Smooth image loading */
.piece-card-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.piece-card-image img.loaded {
    opacity: 1;
}
