/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --header-bg: #131a22;
    --header-bg-2: #232f3e;
    --accent: #e47911;
    --accent-dark: #c1690a;
    --success: #067d62;
    --danger: #cc0c39;
    --star: #ffa41c;
    --bg: #eaeded;
    --card: #ffffff;
    --text: #0f1111;
    --text-muted: #565959;
    --border: #d5d9d9;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 2px 6px rgba(15,17,17,0.08);
    --shadow-hover: 0 6px 18px rgba(15,17,17,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* HEADER / NAV */
.site-header { background: var(--header-bg); color: #fff; }
.header-top { display: flex; align-items: center; gap: 20px; padding: 14px 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; }

.search-form { display: flex; flex: 1; max-width: 640px; border-radius: var(--radius); overflow: hidden; }
.search-form input { flex: 1; padding: 10px 14px; border: none; font-size: 14px; outline: none; }
.search-form button { padding: 0 18px; border: none; background: var(--accent); color: #131a22; font-weight: 700; cursor: pointer; transition: background .15s; }
.search-form button:hover { background: var(--accent-dark); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.header-actions a { color: #fff; font-size: 13px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.header-actions a span.label { font-weight: 700; font-size: 13px; }
.header-actions a small { color: #ccc; font-size: 11px; }
.header-actions a:hover span.label { color: var(--accent); }
.icon-badge { position: absolute; top: -8px; right: -14px; background: var(--accent); color: #131a22; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }

.header-nav { background: var(--header-bg-2); padding: 10px 0; overflow-x: auto; }
.header-nav .container { display: flex; gap: 22px; white-space: nowrap; }
.header-nav a { color: #e5e7eb; font-size: 13px; font-weight: 500; }
.header-nav a:hover { color: #fff; text-decoration: underline; }
.header-nav a.active { color: var(--accent); font-weight: 700; }

/* Bootstrap navbar overrides to match the design tokens */
.navbar-nav .nav-link { color: #e5e7eb !important; font-weight: 600; }
.navbar-nav .nav-link:hover { color: #fff !important; }
.navbar-nav .nav-link.active-link { color: var(--accent) !important; font-weight: 700; }
.navbar-toggler { border-color: rgba(255,255,255,0.3); }
.navbar-toggler:focus { box-shadow: 0 0 0 0.2rem rgba(228,121,17,0.4); }
.nav-item .icon-badge { top: -6px; right: -10px; }
/* Our own .container coexists with Bootstrap's; keep our max-width/padding as the source of truth */
.container { max-width: 1240px !important; }

/* FLASH MESSAGES */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: 14px; border: 1px solid transparent; }
.flash.success { background: #f0f9f4; color: #067d62; border-color: #b7e4d1; }
.flash.error { background: #fdf2f2; color: #cc0c39; border-color: #f5c6cb; }

/* HERO BANNER */
.hero {
    background: linear-gradient(120deg, #232f3e 0%, #131a22 60%, #0c1015 100%);
    color: #fff; border-radius: var(--radius-lg); margin: 20px 0;
    padding: 48px 40px; display: flex; align-items: center; justify-content: space-between;
    gap: 30px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(228,121,17,0.35) 0%, rgba(228,121,17,0) 70%); }
.hero-text { max-width: 520px; z-index: 1; }
.hero-eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; display: block; }
.hero-text h1 { font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 14px; }
.hero-text p { color: #cbd5e1; font-size: 15px; margin-bottom: 22px; }
.hero-cta { display: inline-block; background: var(--accent); color: #131a22; font-weight: 700; padding: 12px 26px; border-radius: var(--radius); transition: background .15s; }
.hero-cta:hover { background: #fff; }

.category-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 24px 0; }
.category-tile { background: var(--card); border-radius: var(--radius); padding: 18px 14px; text-align: center; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; font-weight: 600; font-size: 14px; }
.category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.category-tile .icon { font-size: 26px; margin-bottom: 8px; display: block; }

/* Homepage category row: scrolls horizontally instead of wrapping, so it stays
   compact no matter how many categories are added later */
.category-tiles-lg {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 14px; padding-bottom: 6px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.category-tile-lg {
    flex: 0 0 auto; scroll-snap-align: start; min-width: 130px;
    padding: 20px 18px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.category-tile-lg .icon { font-size: 28px; margin-bottom: 8px; }
/* Thin, unobtrusive scrollbar for the category row */
.category-tiles-lg::-webkit-scrollbar { height: 6px; }
.category-tiles-lg::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.trust-strip {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 12px;
    margin: 20px 0 30px; background: var(--card); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow);
}
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; flex: 1 1 0; justify-content: center; }
.trust-icon { font-size: 20px; }
@media (max-width: 700px) {
    .trust-item { flex: 0 0 auto; }
}

.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin: 34px 0 16px; gap: 12px; flex-wrap: wrap; }
.section-header h2 { font-size: 20px; font-weight: 800; position: relative; padding-left: 14px; }
.section-header h2::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; background: var(--accent); border-radius: 999px; }
.section-header a { color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.section-eyebrow { display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; padding-left: 14px; }

/* Promo tiles (2-up under hero) */
.promo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 20px 0; }
.promo-tile {
    border-radius: var(--radius-lg); padding: 26px 28px; color: #fff; position: relative; overflow: hidden;
    box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: block;
}
.promo-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.promo-tile-a { background: linear-gradient(135deg, #0f4c3a 0%, #067d62 100%); }
.promo-tile-b { background: linear-gradient(135deg, #7a3a0a 0%, var(--accent) 100%); }
.promo-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.promo-tile h3 { font-size: 22px; font-weight: 800; margin: 6px 0 6px; }
.promo-tile p { font-size: 13px; opacity: .9; margin-bottom: 14px; }
.promo-link { font-weight: 700; font-size: 13px; text-decoration: underline; }

.hero-cta-outline { background: transparent; border: 1.5px solid rgba(255,255,255,0.6); color: #fff; }
.hero-cta-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* NEW badge on product cards */
.badge-new { background: var(--success); color: #fff; }
.product-badge-new { position: absolute; top: 8px; left: 8px; z-index: 2; }

/* FILTER / SORT BAR */
.filter-bar { background: var(--card); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: var(--shadow); }
.filter-bar form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.filter-bar select, .filter-bar input[type="number"] { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.filter-bar input[type="number"] { width: 90px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip a { color: var(--danger); font-weight: 800; }

/* BUTTONS */
.btn { display: inline-block; padding: 10px 20px; background: var(--accent); color: #131a22; border: none; border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 700; transition: background .15s, color .15s; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a30030; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f3f4f6; color: var(--text); }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent-dark); }
.btn-outline:hover { background: var(--accent); color: #131a22; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* PRODUCT GRID / CARDS */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 20px 0; }
.product-card { background: var(--card); border-radius: var(--radius-lg); padding: 16px; position: relative; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-card .thumb-wrap { position: relative; margin-bottom: 12px; }
.product-card img { width: 100%; height: 170px; object-fit: cover; border-radius: var(--radius); background: #f4f4f4; }
.product-card h3 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.stars { color: var(--star); font-size: 13px; letter-spacing: 1px; }
.rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); }
.product-card .price { font-weight: 800; font-size: 17px; color: var(--text); margin: 4px 0 10px; }
.product-card .price .currency { font-size: 12px; vertical-align: super; }
.product-card .add-btn { margin-top: auto; }

.wishlist-heart { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.92); border: none; border-radius: 50%; width: 34px; height: 34px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: transform .15s; z-index: 2; }
.wishlist-heart:hover { transform: scale(1.1); }
.wishlist-heart.active { color: var(--danger); }
.wishlist-heart:not(.active) { color: #9aa0a6; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-shipped { background: #e0e7ff; color: #3730a3; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-out { background: #f3f4f6; color: #6b7280; }
.badge-sale { background: var(--danger); color: #fff; }
.badge-featured { background: var(--header-bg); color: var(--accent); }

/* PRODUCT DETAIL PAGE */
.product-detail { display: flex; gap: 40px; flex-wrap: wrap; margin: 26px 0; }
.product-gallery { flex: 1; min-width: 300px; max-width: 460px; }
.gallery-main { border-radius: var(--radius-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow); margin-bottom: 12px; position: relative; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 380px; object-fit: cover; transition: transform .3s ease; }
.gallery-main.zoomed img { transform: scale(1.8); cursor: zoom-out; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 66px; height: 66px; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; opacity: .75; transition: opacity .15s, border-color .15s; }
.gallery-thumbs img.active { border-color: var(--accent); opacity: 1; }
.gallery-thumbs img:hover { opacity: 1; }

.product-info { flex: 1; min-width: 300px; }
.product-info h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.product-info .rating-row { font-size: 14px; margin-bottom: 14px; }
.product-info .price-block { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 16px 0; margin: 14px 0; }
.product-info .price-block .price { font-size: 28px; font-weight: 800; color: var(--text); }
.product-info .stock-line { margin: 10px 0; font-size: 14px; font-weight: 600; }
.stock-line.in-stock { color: var(--success); }
.stock-line.out-stock { color: var(--danger); }
.product-info .desc { color: var(--text-muted); margin: 14px 0; line-height: 1.7; }
.qty-cart-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Tabs */
.tabs { margin-top: 40px; }
.tab-buttons { display: flex; gap: 4px; border-bottom: 2px solid var(--border); }
.tab-buttons button { background: none; border: none; padding: 12px 20px; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-buttons button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 24px 0; }
.tab-panel.active { display: block; }

/* Reviews */
.rating-summary { display: flex; gap: 30px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.rating-big { text-align: center; }
.rating-big .num { font-size: 42px; font-weight: 800; line-height: 1; }
.rating-bars { flex: 1; min-width: 220px; max-width: 340px; }
.rating-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; color: var(--text-muted); }
.rating-bar-track { flex: 1; background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.rating-bar-fill { background: var(--star); height: 100%; }

.review-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review-item .review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-item .reviewer { font-weight: 700; font-size: 13px; }
.review-item .review-date { color: var(--text-muted); font-size: 12px; }
.star-input { display: flex; gap: 4px; font-size: 24px; flex-direction: row-reverse; justify-content: flex-end; }
.star-input label { cursor: pointer; color: #d5d9d9; }
.star-input input { display: none; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-box { max-width: 420px; margin: 40px auto; background: var(--card); padding: 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* TABLES */
table { width: 100%; border-collapse: collapse; background: var(--card); margin: 16px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table th, table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
table th { background: #f7f8f8; font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
table tr:last-child td { border-bottom: none; }

/* CART */
.cart-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.cart-row img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius); margin-right: 12px; }
.cart-summary { background: var(--card); border-radius: var(--radius-lg); padding: 20px; margin-top: 20px; box-shadow: var(--shadow); text-align: right; }

/* WISHLIST */
.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 20px 0; }

/* FOOTER */
.site-footer { background: var(--header-bg); color: #cbd5e1; margin-top: 50px; }
.footer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px; padding: 40px 0 24px; }
.footer-columns h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-columns a, .footer-columns p { color: #b0b8c1; font-size: 13px; display: block; margin-bottom: 8px; }
.footer-columns a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid #2a3644; text-align: center; padding: 16px 0; font-size: 12px; color: #8b95a1; }

/* ADMIN LAYOUT */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--header-bg); color: #fff; padding: 22px; flex-shrink: 0; }
.admin-sidebar h2 { color: var(--accent); font-size: 18px; }
.admin-sidebar a { display: block; color: #cbd5e1; padding: 10px 0; font-size: 14px; font-weight: 500; }
.admin-sidebar a:hover { color: #fff; }
.admin-content { flex: 1; padding: 28px; max-width: 1200px; }
.admin-content h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }

.stat-card { background: var(--card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.stat-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 700; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-top { flex-direction: column; align-items: stretch; }
    .header-actions { justify-content: space-around; margin-left: 0; }
    .hero { padding: 30px 22px; }
    .hero-text h1 { font-size: 26px; }
    .admin-wrap { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 14px 20px; }
    .admin-sidebar h2 { width: 100%; margin-bottom: 6px; }
    .product-detail { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
