/* ============================================================
   Arya Informatika — Main Stylesheet
   ============================================================ */

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

:root {
    --color-bg:         #ffffff;
    --color-surface:    #f8f8f7;
    --color-border:     #e5e4e0;
    --color-text:       #1a1a18;
    --color-muted:      #6b6b67;
    --color-accent:     #1a56db;
    --color-accent-h:   #1447c0;
    --color-sale:       #dc2626;
    --color-success:    #16a34a;
    --color-radius:     10px;
    --color-radius-sm:  6px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
    --shadow-md:        0 4px 12px rgba(0,0,0,.10);
    --transition:       0.18s ease;
    --max-width:        1280px;
}

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--color-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.btn-primary  { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-h); }
.btn-outline  { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sm       { padding: 7px 14px; font-size: 13px; }
.btn-disabled { background: var(--color-surface); color: var(--color-muted); cursor: not-allowed; }

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo { flex-shrink: 0; }
.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: -0.3px;
}

/* Search */
.search-form {
    flex: 1;
    display: flex;
    max-width: 520px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--color-radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}
.search-form:focus-within { border-color: var(--color-accent); }
.search-form input {
    flex: 1;
    padding: 9px 14px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}
.search-form button {
    padding: 0 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-muted);
    display: flex;
    align-items: center;
}
.search-form button:hover { color: var(--color-accent); }

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--color-text);
    padding: 6px;
    border-radius: var(--color-radius-sm);
    transition: color var(--transition);
}
.cart-link:hover { color: var(--color-accent); }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Category nav */
.category-nav {
    border-top: 1px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-list {
    display: flex;
    gap: 4px;
    padding: 6px 0;
}
.category-list a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.category-list a:hover,
.category-list a.active {
    background: var(--color-surface);
    color: var(--color-text);
}
.category-list a.active { color: var(--color-accent); }
.cat-count {
    font-size: 11px;
    background: var(--color-border);
    color: var(--color-muted);
    padding: 1px 5px;
    border-radius: 10px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    padding: 64px 0;
    border-bottom: 1px solid var(--color-border);
}
.hero-text h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero-text p {
    font-size: 18px;
    color: var(--color-muted);
    max-width: 480px;
    margin-bottom: 28px;
}

/* ── Sections ─────────────────────────────────────────────── */
.featured-section,
.products-section { padding: 48px 0; }

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.product-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    background: var(--color-surface);
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-muted);
}
.sort-bar select {
    border: 1.5px solid var(--color-border);
    border-radius: var(--color-radius-sm);
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    background: var(--color-bg);
}

/* ── Product grid ─────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

/* ── Product card ─────────────────────────────────────────── */
.product-card {
    border: 1px solid var(--color-border);
    border-radius: var(--color-radius);
    overflow: hidden;
    background: var(--color-bg);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-card.out-of-stock { opacity: 0.7; }

.product-card__image-link {
    position: relative;
    display: block;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--color-surface);
}
.product-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .product-card__image-link img { transform: scale(1.04); }

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-sale { background: var(--color-sale); color: #fff; }
.badge-out  { background: #6b6b67; color: #fff; }

.product-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-card__category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    margin-bottom: 6px;
}
.product-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
}
.product-card__title a:hover { color: var(--color-accent); }
.product-card__desc {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.product-card__price { display: flex; flex-direction: column; }
.price-original {
    font-size: 12px;
    color: var(--color-muted);
    text-decoration: line-through;
}
.price-current { font-size: 17px; font-weight: 700; }
.price-sale    { color: var(--color-sale); }

/* ── Cart toast notification ──────────────────────────────── */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-text);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--color-radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 999;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
}
.pagination-info { font-size: 14px; color: var(--color-muted); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-muted);
    font-size: 16px;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    margin-top: 64px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 48px 20px;
}
.footer-brand .logo-text { font-size: 18px; margin-bottom: 8px; display: block; }
.footer-brand p  { font-size: 14px; color: var(--color-muted); margin-top: 6px; }
.footer-links h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a  { font-size: 14px; color: var(--color-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid var(--color-border); padding: 16px 20px; }
.footer-bottom p { font-size: 13px; color: var(--color-muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .header-inner { gap: 10px; }
    .search-form  { max-width: none; }
    .hero-text h1 { font-size: 28px; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}
