/* =============================================
   KreaMart E-Commerce Stylesheet
   ============================================= */

/* RESET & BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  font-size: 14px;
}

/* =============================================
   TOP BAR
   ============================================= */
.topbar {
  background: #1a1a2e;
  color: #ccc;
  font-size: 12px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar a {
  color: #ccc;
  text-decoration: none;
  margin-left: 12px;
}

.topbar a:hover {
  color: #fff;
}

/* =============================================
   HEADER
   ============================================= */
header {
  background: #1a1a2e;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  color: #f5a623;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.logo span {
  color: #fff;
}

.search-bar {
  flex: 1;
  display: flex;
  max-width: 600px;
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  outline: none;
}

.search-bar select {
  padding: 9px 10px;
  border: none;
  border-left: 1px solid #ddd;
  background: #fff;
  font-size: 13px;
  outline: none;
}

.search-bar button {
  background: #f5a623;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 15px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  overflow: hidden;
}

.header-actions a {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-actions a:hover {
  color: #f5a623;
}

.cart-btn {
  background: #f5a623;
  color: #fff !important;
  padding: 7px 14px;
  border-radius: 4px;
}

.badge {
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   NAVIGATION
   ============================================= */
nav {
  background: #232946;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  overflow: hidden;
}

.nav-menu li a {
  display: block;
  padding: 12px 14px;
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  background: #f5a623;
  color: #fff;
}

.nav-phone {
  margin-left: auto;
  color: #f5a623;
  font-size: 13px;
  font-weight: 600;
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  background: #fff;
  padding: 8px 24px;
  font-size: 12px;
  color: #888;
  border-bottom: 1px solid #e8e8e8;
}

.breadcrumb a {
  color: #f5a623;
  text-decoration: none;
}

.breadcrumb span {
  margin: 0 5px;
}

/* =============================================
   LAYOUT CONTAINER
   ============================================= */
.container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 16px 24px;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: 210px;
  min-width: 210px;
  margin-right: 18px;
}

.sidebar-box {
  background: #fff;
  border-radius: 4px;
  border: 1px solid #e8e8e8;
  margin-bottom: 12px;
  overflow: hidden;
}

.sidebar-title {
  background: #1a1a2e;
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-content {
  padding: 10px 14px;
}

.sidebar-content ul {
  list-style: none;
}

.sidebar-content ul li {
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-content ul li:last-child {
  border-bottom: none;
}

.sidebar-content ul li a {
  color: #333;
  text-decoration: none;
}

.sidebar-content ul li a:hover {
  color: #f5a623;
}

.count {
  background: #f5a623;
  color: #fff;
  font-size: 10px;
  border-radius: 10px;
  padding: 1px 7px;
}

/* Price Filter */
.price-range {
  display: flex;
  gap: 8px;
  align-items: center;
}

.price-range input[type="range"] {
  width: 100%;
  accent-color: #f5a623;
}

.price-inputs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.price-inputs input {
  width: 80px;
  padding: 4px 7px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
}

.btn-filter {
  background: #f5a623;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
  width: 100%;
}

/* Star Rating Filter */
.star {
  color: #f5a623;
  font-size: 12px;
}

.star-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  cursor: pointer;
}

.star-row span {
  font-size: 12px;
  color: #666;
}

.star-row:hover span {
  color: #f5a623;
}

/* Color Swatches */
.color-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
  margin-right: 4px;
  vertical-align: middle;
  cursor: pointer;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 11px;
  color: #555;
  margin: 3px 2px;
  cursor: pointer;
}

.tag:hover {
  background: #f5a623;
  color: #fff;
  border-color: #f5a623;
}

/* Sidebar Promo Banner */
.banner-sidebar {
  background: linear-gradient(135deg, #1a1a2e 60%, #f5a623 100%);
  border-radius: 4px;
  padding: 18px 14px;
  text-align: center;
  color: #fff;
  margin-bottom: 12px;
}

.banner-sidebar .price-big {
  font-size: 26px;
  font-weight: 700;
  color: #f5a623;
}

.banner-sidebar .btn-banner {
  background: #f5a623;
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 10px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main {
  flex: 1;
  min-width: 0;
}

/* Toolbar */
.toolbar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.toolbar select {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  color: #555;
}

.view-btns button {
  background: #f5a623;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 3px;
}

.view-btns button.outline {
  background: #fff;
  color: #999;
  border: 1px solid #ddd;
}

.result-count {
  font-size: 13px;
  color: #888;
  margin-left: auto;
}

/* =============================================
   PRODUCT GRID
   ============================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Product Card */
.product-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  border-color: #f5a623;
}

/* Badges */
.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  z-index: 2;
}

.product-badge.new {
  background: #27ae60;
}
.product-badge.sale {
  background: #e74c3c;
}
.product-badge.hot {
  background: #e67e22;
}

/* Product Image */
.product-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-img-placeholder {
  width: 100%;
  height: 150px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 36px;
}

/* Hover Action Buttons */
.product-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.action-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

.action-btn:hover {
  background: #f5a623;
  color: #fff;
  border-color: #f5a623;
}

/* Product Info */
.product-info {
  padding: 10px 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-cat {
  font-size: 11px;
  color: #aaa;
  margin-bottom: 2px;
}

.product-name {
  font-size: 13px;
  color: #222;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
  flex: 1;
}

.product-name a {
  color: #222;
  text-decoration: none;
}

.product-name a:hover {
  color: #f5a623;
}

.stars {
  color: #f5a623;
  font-size: 12px;
}

.reviews {
  font-size: 11px;
  color: #aaa;
  margin-left: 3px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.price-new {
  color: #e74c3c;
  font-size: 15px;
  font-weight: 700;
}

.price-old {
  color: #bbb;
  font-size: 12px;
  text-decoration: line-through;
}

.btn-cart {
  background: #f5a623;
  color: #fff;
  border: none;
  padding: 6px 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
  width: 100%;
  transition: background 0.15s;
}

.btn-cart:hover {
  background: #e67e22;
}

.stock-status {
  font-size: 11px;
  margin-top: 4px;
}

.in-stock {
  color: #27ae60;
}
.out-stock {
  color: #e74c3c;
}

/* Featured / Wide Card */
.product-card.featured {
  grid-column: span 2;
  flex-direction: row;
}

.product-card.featured .product-img-placeholder {
  width: 200px;
  min-width: 200px;
  height: 100%;
}

.product-card.featured .product-info {
  padding: 16px;
}

.product-card.featured .product-name {
  font-size: 15px;
}

.product-card.featured .price-new {
  font-size: 20px;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 22px;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  background: #fff;
}

.pagination a:hover,
.pagination a.active {
  background: #f5a623;
  color: #fff;
  border-color: #f5a623;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 36px 24px 16px;
  margin-top: 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-col {
  overflow: hidden;
}
.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  overflow: hidden;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  padding: 4px 0;
  font-size: 12px;
}

.footer-col ul li a {
  color: #aaa;
  text-decoration: none;
}

.footer-col ul li a:hover {
  color: #f5a623;
}

.footer-col .logo-f {
  color: #f5a623;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-col p {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}

.footer-bottom {
  text-align: center;
  color: #666;
  font-size: 12px;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid #2a2a3e;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.app-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.app-btn {
  background: #2a2a3e;
  color: #ccc;
  border: 1px solid #3a3a5e;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11px;
}

.social-icons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.social-icon {
  background: #2a2a3e;
  color: #ccc;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
}

.social-icon:hover {
  background: #f5a623;
  color: #fff;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 170px;
    min-width: 170px;
  }

  .product-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .container {
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    width: 100%;
    margin-right: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
