:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --brand: #f5c400;
    --brand-dark: #d8ac00;
    --line: #e5e7eb;
    --danger: #b91c1c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
.container { width: min(1320px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.nav-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.1rem;
    min-height: 82px;
}

.brand { display: flex; align-items: center; }
.brand img { width: 220px; height: auto; display: block; }

nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}
nav a {
    font-size: .9rem;
    color: #1f2937;
    padding: .4rem .2rem;
    border-bottom: 2px solid transparent;
}
nav a.active, nav a:hover { border-color: var(--brand); }

.header-actions {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: .9rem;
    white-space: nowrap;
}
.header-actions a { white-space: nowrap; }

.cart-icon-btn {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    position: relative;
}
.cart-icon-btn svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #111827;
    stroke-width: 1.8;
}
.cart-badge {
    position: absolute;
    top: -6px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--brand);
    color: #111827;
    font-size: .72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero { margin-bottom: 2rem; }
.slides { position: relative; min-height: 70vh; overflow: hidden; }
.slide {
    display: none;
    align-items: center;
    min-height: 70vh;
    background-size: cover;
    background-position: center;
    color: #fff;
}
.slide.is-active { display: flex; }
.slide h1 { font-size: clamp(2rem, 4.2vw, 3.8rem); max-width: 740px; margin: 0 0 1rem; }
.slide p { max-width: 670px; margin: 0 0 1.4rem; color: rgba(255, 255, 255, .9); font-size: 1.07rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.04);
}

.quick-intro { margin-top: -70px; position: relative; z-index: 5; margin-bottom: 2rem; }

.section-head {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.section-head h2 { margin: 0; }
.section-head a { color: #1d4ed8; font-weight: 600; }

.grid { display: grid; gap: 1rem; }
.categories-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-card {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
    border-radius: 14px;
    padding: 1rem;
    min-height: 140px;
}
.category-card h3 { margin: 0 0 .4rem; }
.category-card p { margin: 0; color: rgba(255, 255, 255, 0.82); line-height: 1.5; }

.product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.product-content { padding: .95rem; display: grid; gap: .5rem; height: 100%; }
.product-content h3 { margin: 0; font-size: 1rem; }
.product-content p { margin: 0; color: var(--muted); font-size: .92rem; }
.product-content small { color: #374151; font-weight: 600; }

.price-row { display: flex; align-items: center; gap: .45rem; }
.price-row strong { color: #111827; font-size: 1.05rem; }
.price-row span { color: #9ca3af; text-decoration: line-through; font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip {
    border: 1px solid var(--line);
    background: #f9fafb;
    border-radius: 999px;
    padding: .55rem .85rem;
    font-size: .9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #111827;
    font-weight: 700;
    padding: .65rem .95rem;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn-light { background: #fff; border: 1px solid var(--line); }
.btn-sm { font-size: .85rem; padding: .45rem .7rem; }
.btn-block { width: 100%; }

.flash {
    padding: .8rem .95rem;
    margin: 1rem 0;
    border-radius: 12px;
    font-weight: 600;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-warning { background: #fef9c3; color: #854d0e; }
.flash-danger { background: #fee2e2; color: #991b1b; }

.page-head { margin: 1.2rem auto; }
.page-head h1 { margin: 0; }
.page-head p { color: var(--muted); }

.filters {
    display: grid;
    gap: .8rem;
    grid-template-columns: 1.5fr 1fr 1fr auto auto;
}
.filters input, .filters select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .63rem .75rem;
}
.checkbox-inline { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; }

.product-detail {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
}
.product-image img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    height: 520px;
    object-fit: cover;
}
.product-info h1 { margin-top: .3rem; }

.inline-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.inline-form input[type=number] {
    max-width: 90px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .45rem .5rem;
}

.prose p { color: #1f2937; line-height: 1.7; }
.prose ol { line-height: 1.7; }
.prose img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    margin-bottom: .8rem;
}
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.blog-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: .7rem;
}
.blog-card h3 { margin: .2rem 0 .45rem; }
.blog-detail { max-width: 900px; }

.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}
.auth-wrap .card { width: min(460px, 100%); }

.stack-form { display: grid; gap: .7rem; }
.stack-form input, .stack-form textarea, .stack-form select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .65rem .75rem;
    font: inherit;
}

.cart-layout { align-items: start; }
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    border-bottom: 1px solid var(--line);
    padding: .6rem .35rem;
    text-align: left;
    vertical-align: middle;
}
.table input[type=number] { max-width: 80px; padding: .4rem; }
.link-btn {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
}
.text-danger { color: var(--danger); font-weight: 600; }
.hint { color: var(--muted); font-size: .86rem; }
pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #111827;
    color: #f9fafb;
    border-radius: 10px;
    padding: .8rem;
}

.site-footer { margin-top: 3rem; background: #e5e7eb; border-top: 1px solid #d1d5db; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 1.2rem;
    padding: 2.2rem 0;
}
.footer-grid h4 { margin-top: 0; margin-bottom: .7rem; }
.footer-grid ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; color: #4b5563; }
.muted { color: var(--muted); }

.footer-bottom { background: #111827; color: #f9fafb; }
.footer-bottom-content {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .88rem;
}

.contact-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #111827;
    font-weight: 800;
    padding: .85rem 1rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.contact-widget {
    position: fixed;
    right: 20px;
    bottom: 78px;
    z-index: 60;
    width: min(360px, calc(100% - 2rem));
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.contact-widget[hidden] { display: none; }
.contact-widget-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem .95rem;
    border-bottom: 1px solid var(--line);
    background: #111827;
    color: #fff;
}
.contact-widget-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.contact-widget-form { padding: .85rem; }

@media (max-width: 1080px) {
    .container { width: min(1200px, calc(100% - 1rem)); }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .brand img { width: 190px; }
    nav { gap: .7rem; }
    nav a { font-size: .85rem; }
    .header-actions { gap: .45rem; }
    nav { display: none; }
}
@media (max-width: 860px) {
    .categories-grid, .product-grid, .two-col, .three-col, .footer-grid { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr; }
    .quick-intro { margin-top: 1rem; }
    .header-actions { margin-left: auto; }
    .brand img { width: 170px; }
}
