/* =========================================================
   UTECH ENTERPRISES - Main Stylesheet
   Color scheme derived from the UTECH logo:
   - Brand Red   : bold, energetic, used for CTAs & accents
   - Charcoal/Ink: professional, technical, used for text & headers
   - White/Grays : clean industrial background
   ========================================================= */

:root {
    --brand-red: #E2231A;
    --brand-red-dark: #B81812;
    --brand-red-light: #FDEAE9;
    --ink: #1C1C1C;
    --ink-soft: #333333;
    --gray-700: #555555;
    --gray-400: #9A9A9A;
    --gray-200: #E6E6E6;
    --gray-100: #F5F5F5;
    --white: #FFFFFF;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.10);
    --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink-soft);
    background: var(--white);
    line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.25; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary { background: var(--brand-red); color: var(--white); }
.btn-primary:hover { background: var(--brand-red-dark); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #000; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-outline-light { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Topbar ---------- */
.topbar { background: var(--ink); color: var(--gray-200); font-size: 0.82rem; }
.topbar-inner { display: flex; justify-content: space-between; padding: 8px 24px; }
@media (max-width: 640px) { .topbar-contact { display: none; } }

/* ---------- Navbar ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--white); box-shadow: var(--shadow-sm); }
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 20px; }
.brand-logo { height: 54px; width: auto; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 600; color: var(--ink-soft); padding: 6px 2px; border-bottom: 2px solid transparent; transition: var(--transition); }
.main-nav a:hover, .main-nav a.active { color: var(--brand-red); border-bottom-color: var(--brand-red); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.cart-link { position: relative; font-weight: 600; background: var(--gray-100); padding: 9px 16px; border-radius: 30px; display: flex; align-items: center; gap: 6px; transition: var(--transition); }
.cart-link:hover { background: var(--brand-red-light); color: var(--brand-red); }
.cart-badge { background: var(--brand-red); color: var(--white); font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 860px) {
    .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 16px 24px; box-shadow: var(--shadow-md); display: none; gap: 14px; }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--ink) 0%, #2b2b2b 100%); color: var(--white); padding: 90px 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; background: var(--brand-red); opacity: 0.15; border-radius: 50%; }
.hero-inner { max-width: 640px; }
.hero-eyebrow { color: var(--brand-red); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 14px; }
.hero h1 { font-size: 2.6rem; margin-bottom: 18px; }
.hero p { color: var(--gray-200); font-size: 1.05rem; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Category strip ---------- */
.category-strip { padding: 60px 0 20px; }
.section-heading { text-align: center; margin-bottom: 40px; }
.section-heading .eyebrow { color: var(--brand-red); text-transform: uppercase; font-weight: 700; font-size: 0.82rem; letter-spacing: 1.5px; }
.section-heading h2 { font-size: 2rem; margin-top: 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.cat-card { background: var(--gray-100); border-radius: var(--radius-md); padding: 28px 20px; text-align: center; transition: var(--transition); border: 1px solid var(--gray-200); }
.cat-card:hover { background: var(--brand-red); color: var(--white); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-card .cat-icon { font-size: 2rem; margin-bottom: 10px; }
.cat-card h3 { font-size: 1rem; color: inherit; }

/* ---------- Product grid ---------- */
.products-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.filter-form select, .filter-form input[type="text"] {
    padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
}
.filter-form input[type="text"] { flex: 1; min-width: 200px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding: 20px 0 70px; }
.product-card { border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; background: var(--white); transition: var(--transition); display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-thumb { aspect-ratio: 4/3; background: var(--gray-100); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 0.72rem; color: var(--brand-red); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.product-title { font-size: 1.02rem; }
.product-title a:hover { color: var(--brand-red); }
.product-meta { font-size: 0.82rem; color: var(--gray-700); }
.stock-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; width: fit-content; }
.stock-in { background: #E5F6EA; color: #1E8E3E; }
.stock-limited { background: #FFF4E0; color: #C97A00; }
.stock-out { background: #FBE7E6; color: var(--brand-red-dark); }
.stock-on_order { background: #E7EEFB; color: #1A56B8; }
.product-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 10px; }

/* ---------- Product detail ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 50px 0; }
.detail-image { background: var(--gray-100); border-radius: var(--radius-lg); padding: 30px; display: flex; align-items: center; justify-content: center; min-height: 340px; }
.detail-image img { max-height: 420px; object-fit: contain; }
.detail-info h1 { font-size: 1.8rem; margin-bottom: 10px; }
.detail-badges { display: flex; gap: 10px; margin: 14px 0 20px; flex-wrap: wrap; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.spec-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; }
.spec-table td:first-child { font-weight: 600; color: var(--ink); width: 40%; }
.qty-selector { display: flex; align-items: center; gap: 10px; margin: 24px 0; }
.qty-selector input { width: 70px; padding: 10px; text-align: center; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
@media (max-width: 800px) { .detail-wrap { grid-template-columns: 1fr; } }

/* ---------- Cart / RFQ ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
.cart-table th, .cart-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; }
.cart-table th { background: var(--gray-100); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; color: var(--gray-700); }
.cart-item-name { display: flex; align-items: center; gap: 12px; }
.cart-item-name img { width: 50px; height: 50px; object-fit: contain; background: var(--gray-100); border-radius: var(--radius-sm); }
.cart-qty-input { width: 60px; padding: 6px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); text-align: center; }
.remove-link { color: var(--brand-red); font-size: 0.82rem; font-weight: 600; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--gray-700); }
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }

.rfq-panel { background: var(--gray-100); border-radius: var(--radius-lg); padding: 32px; }
.rfq-panel h3 { margin-bottom: 20px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink); }
.form-row .required { color: var(--brand-red); }
.form-row input, .form-row textarea, .form-row select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.92rem; background: var(--white);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--brand-red); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }
.field-error { color: var(--brand-red-dark); font-size: 0.8rem; margin-top: 4px; }
.error-summary { background: var(--brand-red-light); border: 1px solid var(--brand-red); color: var(--brand-red-dark); padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.success-box { background: #E5F6EA; border: 1px solid #1E8E3E; color: #145C29; padding: 40px; border-radius: var(--radius-lg); text-align: center; margin: 40px 0; }
.success-box .icon { font-size: 3rem; margin-bottom: 14px; }

/* ---------- Alerts (admin) ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: #E5F6EA; color: #145C29; border: 1px solid #1E8E3E; }
.alert-error { background: var(--brand-red-light); color: var(--brand-red-dark); border: 1px solid var(--brand-red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--gray-200); padding: 60px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-logo { height: 50px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-col h4 { color: var(--white); margin-bottom: 16px; font-size: 1rem; }
.footer-links li { margin-bottom: 10px; font-size: 0.9rem; color: var(--gray-400); }
.footer-links a:hover { color: var(--brand-red); }
.footer-cta { margin-top: 16px; }
.footer-bottom { border-top: 1px solid #3a3a3a; padding: 18px 0; text-align: center; font-size: 0.82rem; color: var(--gray-400); margin-top: 20px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- About/Info section on homepage ---------- */
.about-section { background: var(--gray-100); padding: 70px 0; margin-top: 50px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-grid ul { margin-top: 16px; }
.about-grid li { padding: 8px 0; padding-left: 28px; position: relative; }
.about-grid li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-red); font-weight: 800; }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Admin panel ---------- */
.admin-body { background: var(--gray-100); min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--ink); color: var(--gray-200); padding: 24px 0; flex-shrink: 0; }
.admin-sidebar .brand-block { padding: 0 20px 24px; border-bottom: 1px solid #3a3a3a; margin-bottom: 20px; }
.admin-sidebar img { height: 40px; filter: brightness(0) invert(1); }
.admin-sidebar a { display: block; padding: 12px 20px; color: var(--gray-200); font-weight: 500; font-size: 0.92rem; border-left: 3px solid transparent; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.06); border-left-color: var(--brand-red); color: var(--white); }
.admin-main { flex: 1; padding: 32px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-card { background: var(--white); border-radius: var(--radius-md); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 0.88rem; vertical-align: middle; }
.admin-table th { background: var(--gray-100); font-size: 0.75rem; text-transform: uppercase; color: var(--gray-700); }
.admin-thumb { width: 46px; height: 46px; object-fit: contain; background: var(--gray-100); border-radius: var(--radius-sm); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.login-card { background: var(--white); padding: 40px; border-radius: var(--radius-lg); width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-md); }
.login-card img { height: 56px; margin: 0 auto 22px; }
.upload-drop { border: 2px dashed var(--gray-200); border-radius: var(--radius-md); padding: 30px; text-align: center; color: var(--gray-700); }
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--brand-red); }
.stat-card .num { font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.stat-card .label { font-size: 0.82rem; color: var(--gray-700); }
