/* Explain: Styles for UI components, navigation, product cards, and footer. */
/* ---------- Announcement bar ---------- */
.announce-bar {
    background: var(--text-color);
    color: #ffffff;
    text-align: center;
    font-size: 0.74rem;
    padding: 0.55rem 0.75rem;
    letter-spacing: 0.01em;
}

.announce-bar strong {
    color: var(--accent-color);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-bar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nav-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    text-align: start;
    transition: opacity 0.25s ease;
}

.brand:hover {
    opacity: 0.72;
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.brand-sub {
    margin-top: 0.28rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.55rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-links a {
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--icon-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    background: var(--purple-soft);
    border-color: var(--purple-soft);
    color: var(--primary-color);
}

.icon-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-display);
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    border: 0;
    border-radius: 13px;
    background: var(--text-color);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.25s ease, transform 0.25s ease;
}

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

.btn-primary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.9rem;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn-light:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #ffffff;
}

/* ---------- Filter chips ---------- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    padding: 0.55rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-chip.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.filter-chip i {
    font-size: 0.85rem;
}

/* ---------- Products ---------- */
.product-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-box {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 240px;
    max-width: 420px;
    min-height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-color);
    padding: 0 1rem;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    min-height: 46px;
    border: 0;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-color);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

.product-count {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

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

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.product-pic {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f6f5;
}

.product-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-pic img {
    transform: scale(1.05);
}

.product-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    gap: 0.6rem;
    padding: 1.1rem 1rem 1.25rem;
}

.brand-chip {
    align-self: flex-start;
    border-radius: 999px;
    background: var(--purple-soft);
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-hover);
}

.product-name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.7;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    color: #f5b301;
    font-size: 0.85rem;
}

.price {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
}

.product-add-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--surface-color);
    box-shadow: 0 8px 22px rgba(20, 60, 48, 0.06);
}

.add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.add-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.06);
}

.add-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.products-empty {
    margin: 2rem 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.strip-foot {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    min-width: 240px;
    padding: 0.85rem 2.5rem;
    border: 1.5px solid var(--primary-color);
    border-radius: 14px;
    background: var(--surface-color);
    color: var(--primary-color);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-view-all:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.filter-row {
    margin-bottom: 1.5rem;
}

/* ---------- Horizontal model strips ---------- */
.model-section .section-head h2 {
    font-size: clamp(1.25rem, 3vw, 1.7rem);
    color: var(--primary-color);
}

.model-head {
    justify-content: center;
    text-align: center;
}

.product-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.product-strip > .product-card {
    flex: 0 0 auto;
    width: 230px;
    scroll-snap-align: start;
}

.product-strip::-webkit-scrollbar {
    height: 6px;
}

.product-strip::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
}

.strip-empty {
    margin: 0;
    padding: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.product-strip:has(.product-card) .strip-empty {
    display: none;
}

/* ---------- Mobile nav overlay ---------- */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    flex-direction: column;
    background: var(--background-color);
    overflow-y: auto;
}

.nav-overlay.open {
    display: flex;
}

.nav-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-overlay-links {
    display: grid;
    padding: 1.5rem 0;
}

.nav-overlay-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.nav-overlay-links a:hover {
    color: var(--primary-color);
}

.nav-overlay-links a i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* ---------- Cart drawer ---------- */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: rgba(23, 23, 32, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cart-drawer.open {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: -24px 0 60px rgba(37, 33, 59, 0.15);
}

.cart-drawer.open .cart-panel {
    transform: translateX(0);
}

.cart-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-panel-head h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
}

.cart-panel-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: grid;
    align-content: start;
    gap: 1rem;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.drawer-item img {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--icon-bg);
    flex-shrink: 0;
}

.drawer-item-info {
    flex: 1;
    min-width: 0;
}

.drawer-item-name {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.drawer-item-meta {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.drawer-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.drawer-remove:hover {
    color: #c0392b;
    border-color: #e5b3ad;
}

.drawer-empty {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 2;
}

.drawer-empty span {
    display: block;
    font-size: 0.78rem;
    opacity: 0.8;
}

.cart-panel-foot {
    display: grid;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.1rem;
}

.cart-panel-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cart-panel-total b {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-color);
}

.cart-panel-cta {
    width: 100%;
}

/* ---------- Forms ---------- */
.form-panel {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--surface-color);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--shadow-soft);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-color);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.85rem;
    line-height: 1.7;
}

.form-status.success {
    color: #2f7d4f;
}

.form-status.error {
    color: #c0392b;
}

/* ---------- Cart page rows ---------- */
.cart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--surface-color);
    padding: 1rem;
}

.cart-row img {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--icon-bg);
    flex-shrink: 0;
}

.cart-row-info {
    flex: 1;
    min-width: 140px;
}

.cart-row-info h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.cart-row-info p {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--surface-color);
    color: var(--text-color);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.qty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.qty-btn.is-danger:hover {
    border-color: #e5b3ad;
    color: #c0392b;
}

.qty-value {
    min-width: 2.25rem;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
}

.cart-empty {
    padding: 3.5rem 1rem;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    background: var(--surface-color);
}

.cart-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.cart-empty p {
    margin: 1rem 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.cart-empty span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-summary-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cart-total-row b {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.cart-checkout-form {
    display: grid;
    gap: 1.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: clamp(3rem, 8vw, 5rem);
    padding: 3rem 0 2rem;
    background: var(--footer-bg);
    color: #ffffff;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2.5rem;
}

.footer-brand {
    max-width: 320px;
}

.brand-light .brand-name {
    color: #ffffff;
}

.brand-light .brand-sub {
    color: var(--accent-color);
}

.footer-brand p {
    margin: 1rem 0 0;
    color: #a9a7b2;
    font-size: 0.82rem;
    line-height: 2;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
}

.footer-links div {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.footer-links b {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
}

.footer-links a {
    color: #a9a7b2;
    font-size: 0.82rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #88868f;
    font-size: 0.75rem;
    text-align: center;
}

/* ---------- Responsive nav ---------- */
@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }

    .nav-menu-btn {
        display: none;
    }
}

/* ---------- Mobile product cards (consistent sizing) ---------- */
@media (max-width: 900px) {
    .product-card {
        border-radius: 18px;
    }

    .product-body {
        gap: 0.45rem;
        padding: 0.85rem 0.7rem 0.9rem;
    }

    .product-name {
        font-size: 0.86rem;
        line-height: 1.6;
    }

    .product-stars {
        font-size: 0.72rem;
    }

    .price {
        font-size: 1rem;
    }

    .product-add-wrap {
        padding: 0.5rem;
        border-radius: 15px;
    }

    .add-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

@media (max-width: 560px) {
    .products-grid {
        gap: 0.625rem;
    }

    .product-body {
        padding: 0.7rem 0.55rem 0.8rem;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .price {
        font-size: 0.95rem;
    }
}