/* =========================================================
   Nabigate Shop – Frontend Styles
   ========================================================= */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:     #1a2b4a;
    --primary-h:   #16243d;
    --accent:      #2563eb;
    --accent-h:    #1d4ed8;
    --text:        #1e293b;
    --text-light:  #64748b;
    --bg:          #f8fafc;
    --bg-card:     #ffffff;
    --border:      #e2e8f0;
    --radius:      10px;
    --shadow:      0 4px 24px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 40px rgba(0,0,0,.13);
    --transition:  .22s ease;
    --font:        'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-h); }

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

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

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    font-size: .95rem;
    font-weight: 500;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: var(--font);
}
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-outline   { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.6); backdrop-filter: blur(4px); }
.btn-outline:hover { background: rgba(255,255,255,.28); }
.btn-danger    { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .4rem 1rem; font-size: .87rem; }
.btn-full { width: 100%; }

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 1rem;
}
.logo-link { flex-shrink: 0; }
.logo-img  { height: 44px; width: auto; }
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -.5px;
}

.main-nav { display: flex; align-items: center; }
.nav-list {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
}
.nav-list a {
    display: block;
    padding: .45rem .85rem;
    border-radius: 6px;
    color: var(--text);
    font-weight: 500;
    font-size: .95rem;
    transition: background var(--transition), color var(--transition);
}
.nav-list a:hover, .nav-list a.active { background: var(--bg); color: var(--accent); }
.btn-nav {
    background: var(--primary) !important;
    color: #fff !important;
    padding: .45rem 1.1rem !important;
}
.btn-nav:hover { background: var(--primary-h) !important; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ── Hero Slider ── */
.hero-slider {
    position: relative;
    overflow: hidden;
    height: 520px;
    background: var(--primary);
}
.slider-track { position: relative; height: 100%; }
.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--primary);
    opacity: 0;
    transition: opacity .55s ease;
    display: flex;
    align-items: center;
}
.slide.active { opacity: 1; z-index: 1; }
.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,43,74,.78) 0%, rgba(26,43,74,.35) 100%);
}
.slide-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 640px;
}
.slide-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.slide-content p {
    font-size: 1.1rem;
    opacity: .9;
    margin-bottom: 2rem;
    max-width: 480px;
}
.slide-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.slider-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.slider-btn {
    background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.5);
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.slider-btn:hover { background: rgba(255,255,255,.4); }
.slider-dots { display: flex; gap: .5rem; }
.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.dot.active { background: #fff; transform: scale(1.25); }

/* Hero Static Fallback */
.hero-static {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}
.hero-static h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; }
.hero-static p  { font-size: 1.2rem; opacity: .85; }

/* ── Products Section ── */
.products-section { padding: 4rem 0 5rem; }
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
    text-align: center;
}
.empty-hint { text-align: center; color: var(--text-light); padding: 3rem; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.product-image { aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-image img { transform: scale(1.04); }
.product-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.product-image-placeholder span {
    font-size: 2.5rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.product-body { padding: 1.25rem 1.25rem .75rem; flex: 1; }
.product-body h3 { font-size: 1.15rem; font-weight: 600; color: var(--primary); margin-bottom: .5rem; }
.product-desc { color: var(--text-light); font-size: .93rem; line-height: 1.5; }
.product-price { margin-top: .75rem; font-size: 1.2rem; font-weight: 700; color: var(--accent); }

.product-actions {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

/* ── Modals ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .22s ease;
}
.modal-detail-box { max-width: 680px; }
.modal-order-box  { max-width: 560px; }

@keyframes modalIn {
    from { opacity:0; transform: translateY(20px) scale(.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--bg);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    color: var(--text-light);
    transition: background var(--transition);
}
.modal-close:hover { background: var(--border); }

.modal-loading { padding: 3rem; text-align: center; color: var(--text-light); }

/* Detail Modal Content */
.modal-detail-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px 14px 0 0; }
.modal-detail-body { padding: 2rem; }
.modal-detail-body h2 { font-size: 1.6rem; color: var(--primary); margin-bottom: .5rem; }
.modal-detail-price { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin: .75rem 0 1rem; }
.modal-detail-desc { color: var(--text-light); line-height: 1.7; margin-bottom: 1.5rem; }
.modal-detail-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Order Form */
.order-form-wrap { padding: 2rem; }
.order-form-wrap h2 { font-size: 1.4rem; color: var(--primary); margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 500; color: var(--text); margin-bottom: .35rem; }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .95rem;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-required { color: #dc2626; }

.form-msg {
    padding: .85rem 1.1rem;
    border-radius: 7px;
    font-size: .93rem;
    margin-bottom: 1rem;
    display: none;
}
.form-msg.success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; display: block; }
.form-msg.error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; display: block; }

/* ── Footer ── */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.8);
    padding: 3.5rem 0 0;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}
.footer-col h4 { color: #fff; font-weight: 600; margin-bottom: 1rem; font-size: 1rem; }
.footer-col p, .footer-col ul { font-size: .9rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.footer-col a { color: rgba(255,255,255,.7); }
.footer-col a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 1.25rem 0;
    text-align: center;
    font-size: .88rem;
    color: rgba(255,255,255,.5);
}

/* ── Page Content ── */
.page-content { padding: 3rem 0 5rem; }
.page-content h1 { font-size: 2rem; color: var(--primary); margin-bottom: 1.5rem; }
.page-content h2 { font-size: 1.4rem; color: var(--primary); margin: 1.5rem 0 .75rem; }
.page-content p  { margin-bottom: 1rem; color: var(--text-light); }

/* ── Customer Area ── */
.customer-wrap { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.customer-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.customer-card h2 { font-size: 1.25rem; color: var(--primary); margin-bottom: 1.25rem; }

.orders-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.orders-table th {
    background: var(--bg);
    text-align: left;
    padding: .75rem 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}
.orders-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.orders-table tr:last-child td { border-bottom: none; }
.orders-table tr:hover td { background: var(--bg); }

/* Badges */
.badge { display: inline-block; padding: .25rem .7rem; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.badge-new       { background: #dbeafe; color: #1d4ed8; }
.badge-progress  { background: #fef3c7; color: #92400e; }
.badge-shipped   { background: #d1fae5; color: #065f46; }
.badge-done      { background: #f0fdf4; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Auth Pages */
.auth-wrap {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg);
}
.auth-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-box h1 { font-size: 1.6rem; color: var(--primary); margin-bottom: .5rem; }
.auth-box p.subtitle { color: var(--text-light); margin-bottom: 2rem; font-size: .95rem; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-text { font-size: 1.8rem; color: var(--primary); font-weight: 700; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .9rem; color: var(--text-light); }
.auth-footer a { color: var(--accent); }

/* Alert */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 7px;
    margin-bottom: 1.25rem;
    font-size: .93rem;
}
.alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-slider { height: 420px; }
    .slide-content h1 { font-size: 1.8rem; }

    .nav-toggle { display: flex; }
    .nav-list {
        display: none;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        box-shadow: 0 8px 24px rgba(0,0,0,.1);
        border-top: 1px solid var(--border);
        gap: .25rem;
    }
    .nav-list.open { display: flex; }
    .nav-list a { padding: .75rem 1rem; }
    .site-header { position: sticky; }

    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .modal-detail-actions { flex-direction: column; }
    .slide-actions { flex-direction: column; }
    .slide-actions .btn { width: fit-content; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .auth-box { padding: 1.75rem 1.25rem; }
}
