/* ============================================================
   MAIN CSS — Front-office
   Mobile-first, responsive, touch-friendly
   ============================================================ */

:root {
    --accent:        #1e40af;
    --accent-hover:  #1e3a8a;
    --accent-light:  #eff6ff;
    --text:          #111827;
    --text-muted:    #6b7280;
    --border:        #e5e7eb;
    --bg:            #f9fafb;
    --bg-card:       #ffffff;
    --red:           #dc2626;
    --green:         #16a34a;
    --radius:        .5rem;
    --radius-lg:     .75rem;
    --shadow:        0 1px 3px rgba(0,0,0,.1);
    --shadow-md:     0 4px 12px rgba(0,0,0,.1);
    --header-h:      64px;
    --font:          'Inter', system-ui, -apple-system, sans-serif;
    --container:     1200px;
    --transition:    .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Container ──────────────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--header-h);
}

.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo img { max-height: 40px; width: auto; }
.logo-text { font-size: 1.25rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }

/* Search */
.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-form {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 9999px;
    overflow: hidden;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,64,175,.1);
    background: #fff;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: .55rem 1rem;
    font-size: .9rem;
    min-width: 0;
    outline: none;
    min-height: 44px;
}

.search-btn {
    background: none;
    border: none;
    padding: .5rem .875rem;
    font-size: 1rem;
    color: var(--text-muted);
    transition: color var(--transition);
    min-width: 44px;
    min-height: 44px;
}
.search-btn:hover { color: var(--accent); }

.search-suggestions {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: background var(--transition);
    touch-action: manipulation;
    min-height: 52px;
    text-decoration: none;
    color: var(--text);
}
.suggestion-item:hover { background: var(--accent-light); }
.suggestion-img { width: 40px; height: 40px; object-fit: cover; border-radius: .35rem; flex-shrink: 0; background: var(--bg); }
.suggestion-name { font-size: .875rem; font-weight: 500; }
.suggestion-price { font-size: .75rem; color: var(--text-muted); }

/* Nav */
.header-nav { display: flex; align-items: center; gap: .125rem; }
.nav-link {
    padding: .5rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.nav-link:hover { background: var(--bg); color: var(--accent); text-decoration: none; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .5rem; }

.lang-switcher { display: flex; gap: .25rem; font-size: .8rem; }
.lang-switcher a { padding: .25rem .4rem; border-radius: .25rem; color: var(--text-muted); font-weight: 600; }
.lang-switcher a.active { color: var(--accent); background: var(--accent-light); }

.cart-btn {
    position: relative;
    font-size: 1.25rem;
    padding: .4rem .5rem;
    border-radius: var(--radius);
    transition: background var(--transition);
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.cart-btn:hover { background: var(--bg); text-decoration: none; }

.cart-count {
    position: absolute;
    top: 0; right: 0;
    background: var(--red);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 .25rem;
    transform: translate(2px, -2px);
}

.admin-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .6rem;
    background: #7c3aed;
    color: #fff;
    border-radius: 9999px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: .25rem;
    min-width: 44px; min-height: 44px;
    border-radius: var(--radius);
    color: var(--text);
}

/* ── Hero / Slider ───────────────────────────────────────────── */
.hero { position: relative; background: #111; overflow: hidden; }

.slider { position: relative; }

.slide {
    display: none;
    position: relative;
    min-height: 480px;
    align-items: center;
}
.slide.active { display: flex; }

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.25) 100%);
}

.slide-content {
    position: relative;
    z-index: 1;
    padding: 4rem 1.25rem;
    color: #fff;
}

.slide-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.slide-subtitle {
    font-size: clamp(.9rem, 2vw, 1.2rem);
    opacity: .9;
    max-width: 560px;
    margin-bottom: 2rem;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    padding: .875rem 2rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    transition: background var(--transition), transform var(--transition);
    touch-action: manipulation;
}
.btn-hero:hover { background: var(--accent-hover); text-decoration: none; transform: translateY(-1px); }

.slider-prev, .slider-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 44px; height: 44px;
    border-radius: 50%;
    z-index: 2;
    transition: background var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.slider-prev:hover, .slider-next:hover { background: rgba(255,255,255,.3); }
.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%; transform: translateX(-50%);
    display: flex; gap: .5rem;
    z-index: 2;
}
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    padding: 0;
}
.dot.active { background: #fff; transform: scale(1.3); }

/* Hero placeholder */
.hero-placeholder { padding: 5rem 1.25rem; text-align: center; background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; max-width: 100%; }
.hero-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.2rem; opacity: .85; margin-bottom: 2rem; }

/* ── Sections ─────────────────────────────────────────────────── */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.quick-search-section { padding: 2.5rem 0; }
.quick-search-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.quick-search-card h2 { margin-bottom: 1rem; font-size: 1.35rem; }
.quick-search-form { display: flex; gap: .75rem; max-width: 560px; margin: 0 auto; }
.quick-search-input {
    flex: 1;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    min-height: 48px;
}
.quick-search-input:focus { outline: none; border-color: var(--accent); }

.categories-section { padding: 3rem 0; }
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.featured-section { padding: 3rem 0; }
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.section-cta { text-align: center; margin-top: 2rem; }

/* How it works */
.how-it-works { padding: 4rem 0; background: var(--accent-light); }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.step { text-align: center; }
.step-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.step p { font-size: .875rem; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .65rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    touch-action: manipulation;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--accent);    color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; }
.btn-rent { background: #0f766e; color: #fff; border-color: #0f766e; }
.btn-rent:hover { background: #0d6660; }
.btn-buy  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-buy:hover { background: var(--accent-hover); }

/* ── Product card ────────────────────────────────────────────── */
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.product-card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.product-card:hover .product-card-img img { transform: scale(1.03); }

.product-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.product-card-name { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.product-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }

.product-card-prices { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.price-tag { font-size: .8rem; }
.price-tag strong { font-size: 1rem; }
.price-rent { color: #0f766e; }
.price-sale { color: var(--accent); }

.product-card-actions { padding: .875rem 1rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; }
.product-card-actions .btn { flex: 1; font-size: .82rem; padding: .5rem .75rem; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: #111827; color: #9ca3af; margin-top: 4rem; }

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 3rem 1.25rem;
}

.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col strong { color: #f9fafb; font-size: .9rem; margin-bottom: .25rem; }
.footer-col p, .footer-col a { font-size: .875rem; color: #9ca3af; }
.footer-col a:hover { color: #f9fafb; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid #1f2937;
    padding: 1.25rem;
    text-align: center;
    font-size: .8rem;
    color: #4b5563;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; }
.form-group label .req { color: var(--red); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: .65rem .875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 48px;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.form-control.error { border-color: var(--red); }
.form-error { font-size: .8rem; color: var(--red); margin-top: .25rem; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1rem; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-info    { background: var(--accent-light); color: #1d4ed8; border: 1px solid #93c5fd; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .header-search { max-width: none; flex: 1; }
    .mobile-menu-btn { display: flex; }

    .slide { min-height: 300px; }
    .slide-content { padding: 2.5rem 1.25rem; }

    .quick-search-form { flex-direction: column; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .header-inner { gap: .5rem; }
    .lang-switcher { display: none; }
    .products-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
}
