/* ==========================================================================
   Krystal Tech Systems — Public Storefront Stylesheet
   ========================================================================== */

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --slate: #475569;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Announcement Bar */
.announcement-bar {
    background: var(--dark);
    color: #e2e8f0;
    font-size: 13px;
    padding: 8px 0;
}
.announcement-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.announcement-link { color: #38bdf8; font-weight: 600; }

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
    text-decoration: none !important;
    flex-shrink: 0;
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #0f172a);
    color: #fff; font-weight: 800; font-size: 20px;
    display: grid; place-items: center;
}
.brand-logo { height: 40px; width: auto; object-fit: contain; }
.brand-text strong { display: block; font-size: 17px; line-height: 1.15; }
.brand-text small { display: block; font-size: 11px; color: var(--muted); }

.header-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg);
}
.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
}
.header-search button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 18px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.main-nav a {
    color: var(--slate);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    text-decoration: none !important;
    font-size: 18px;
}
.cart-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.nav-toggle {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 42px; height: 42px;
    font-size: 20px;
    cursor: pointer;
}

.category-strip {
    background: #f1f5f9;
    border-top: 1px solid var(--border);
    overflow-x: auto;
}
.category-strip-inner {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
    white-space: nowrap;
}
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--slate);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
}
.cat-pill:hover, .cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none !important;
    transition: 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(0.92); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark-2); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.28); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.18); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Hero */
.hero {
    background: radial-gradient(circle at top right, rgba(56,189,248,0.22), transparent 45%),
                linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 64px 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
}
.hero-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(56,189,248,0.16);
    border: 1px solid rgba(56,189,248,0.4);
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.12;
}
.hero p {
    margin: 0 0 28px;
    color: #cbd5e1;
    font-size: 16px;
    max-width: 600px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 20px;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 16px;
}
.hero-stat {
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 10px;
    padding: 14px;
}
.hero-stat strong { display: block; font-size: 22px; color: #38bdf8; }
.hero-stat span { font-size: 12px; color: #cbd5e1; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.section-header h2 { margin: 0 0 6px; font-size: 28px; }
.section-header p { margin: 0; color: var(--muted); }

/* Grids & Cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-pad { padding: 24px; }

/* Category Cards */
.cat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--dark);
    text-decoration: none !important;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.cat-icon { font-size: 30px; }
.cat-card h3 { margin: 0; font-size: 16px; }
.cat-card p { margin: 0; font-size: 13px; color: var(--muted); }
.cat-count { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--primary); }

/* Product Cards */
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,0.1); }
.product-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #0f172a;
    overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-sale, .badge-stock {
    position: absolute;
    top: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.badge-sale { left: 10px; background: var(--danger); color: #fff; }
.badge-stock { right: 10px; background: rgba(15,23,42,0.85); color: #6ee7b7; }
.badge-out { color: #fca5a5; }
.product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.product-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.product-title { margin: 0; font-size: 16px; line-height: 1.3; }
.product-title a { color: var(--dark); text-decoration: none; }
.product-title a:hover { color: var(--primary); }
.product-desc { margin: 0; font-size: 13px; color: var(--slate); flex: 1; }
.product-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.price-now { font-size: 19px; font-weight: 800; color: var(--dark); }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.product-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Service Cards */
.service-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.service-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: #e0f2fe; display: grid; place-items: center; font-size: 24px;
}
.service-card h3 { margin: 0; font-size: 18px; }
.service-card p { margin: 0; color: var(--slate); font-size: 14px; }
.service-price { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--primary); font-size: 14px; }

/* Testimonials */
.testimonial-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.stars { color: #f59e0b; font-size: 16px; margin-bottom: 10px; }
.testimonial-card blockquote { margin: 0 0 14px; color: var(--slate); font-size: 14px; font-style: italic; }
.testimonial-author strong { display: block; font-size: 14px; }
.testimonial-author span { font-size: 12px; color: var(--muted); }

/* Shop Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}
.filter-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.filter-box h3 { margin: 0 0 14px; font-size: 16px; }
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--slate); }

/* Product Detail */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}
.specs-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.specs-table th, .specs-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}
.specs-table th { width: 38%; background: #f8fafc; color: var(--slate); font-weight: 600; }

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    color: var(--dark);
}
.form-control:focus { outline: 2px solid rgba(2,132,199,0.25); border-color: var(--primary); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--slate); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--white); }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.data-table th { background: #f8fafc; color: var(--slate); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Page Header */
.page-banner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 36px 0;
}
.page-banner h1 { margin: 0 0 6px; font-size: 30px; }
.page-banner p { margin: 0; color: #cbd5e1; }

/* Flash & Status Badges */
.flash { padding: 13px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.flash-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed, .status-processing { background: #e0f2fe; color: #075985; }
.status-shipped { background: #ede9fe; color: #5b21b6; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Footer */
.site-footer { background: var(--dark); color: #cbd5e1; margin-top: 64px; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 0.9fr 1.2fr;
    gap: 32px;
    padding: 52px 20px;
}
.footer-brand { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer-text { font-size: 14px; color: #94a3b8; margin: 0 0 14px; }
.footer-contact { font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.footer-contact a { color: #38bdf8; }
.footer-col h4 { color: #fff; margin: 0 0 14px; font-size: 15px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { color: #94a3b8; font-size: 14px; }
.footer-col ul a:hover { color: #fff; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
    flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #334155;
    background: #1e293b; color: #fff; font-size: 14px;
}
.newsletter-msg { font-size: 13px; margin-top: 8px; color: #6ee7b7; }
.social-links { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }
.social-links a { color: #94a3b8; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 18px 0; font-size: 13px; color: #94a3b8; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-link { color: #64748b; }
.admin-link:hover { color: #38bdf8; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark);
    color: #fff;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: 0.2s ease;
    z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-grid, .product-detail-grid { grid-template-columns: 1fr; }
    .shop-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .header-search { display: none; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 20px;
        align-items: flex-start;
    }
    .main-nav.open { display: flex; }
    .grid-4, .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
}
