/* =========================================================
   components.css — KUKA HOME (Premium Minimal UI)
   Purpose: UI components built on base.css tokens
   Load order:
     1) base.css
     2) components.css
     3) style.css / admin.css / responsive.css
   ========================================================= */

/* ---------------------------
   1) Topbar / Header
---------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(11,11,12,0.86), rgba(11,11,12,0.62));
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(201,169,106,0.35);
  background: radial-gradient(120% 120% at 30% 20%, rgba(201,169,106,0.55), rgba(255,255,255,0.02));
  box-shadow: 0 14px 40px rgba(201,169,106,0.10);
}

.brand__name {
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand__tag {
  font-size: var(--fs-2);
  color: var(--text-3);
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav__link {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background var(--t) var(--ease),
              color var(--t) var(--ease),
              border-color var(--t) var(--ease),
              transform var(--t-fast) var(--ease);
}

.nav__link:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
  transform: translateY(-1px);
}

.nav__link.is-active {
  background: rgba(201,169,106,0.12);
  border-color: rgba(201,169,106,0.24);
  color: var(--brand-2);
}

/* Right side actions */
.actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  display: grid;
  place-items: center;
  transition: transform var(--t-fast) var(--ease),
              background var(--t) var(--ease),
              border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(201,169,106,0.22);
  box-shadow: var(--shadow-sm);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-sm);
}

.badge-dot {
  position: relative;
}

.badge-dot::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(201,169,106,0.18);
}

/* ---------------------------
   2) Search
---------------------------- */
.search {
  position: relative;
  width: min(520px, 100%);
}

.search__input {
  width: 100%;
  padding-left: 42px;
  padding-right: 14px;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* ---------------------------
   3) Hero
---------------------------- */
.hero {
  padding: var(--s-7) 0 var(--s-6);
}

.hero__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
}

.hero__title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  margin-top: var(--s-3);
  color: var(--text-2);
  line-height: var(--lh-loose);
}

.hero__cta {
  margin-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.hero__panel {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: radial-gradient(120% 120% at 20% 0%, rgba(201,169,106,0.14), rgba(255,255,255,0.03));
  box-shadow: var(--shadow-md);
  padding: var(--s-5);
}

.hero__panel .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.stat {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 14px;
}

.stat__kpi {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.stat__label {
  margin-top: 6px;
  font-size: var(--fs-2);
  color: var(--text-3);
}

/* ---------------------------
   4) Section Head
---------------------------- */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.section-head__title {
  font-size: var(--fs-6);
  line-height: var(--lh-tight);
}

.section-head__meta {
  color: var(--text-3);
  font-size: var(--fs-2);
}

/* ---------------------------
   5) Product Card Grid
---------------------------- */
.products-grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(4, 1fr);
}

.product-card {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(201,169,106,0.22);
}

.product-card__media {
  aspect-ratio: 4 / 3;
  background: rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform var(--t) var(--ease);
}

.product-card:hover .product-card__media img {
  transform: scale(1.06);
}

.product-card__body {
  padding: var(--s-4);
  display: grid;
  gap: 10px;
}

.product-card__title {
  font-weight: 750;
  line-height: 1.2;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-weight: 850;
  letter-spacing: -0.01em;
}

.price .old {
  font-weight: 650;
  color: var(--text-3);
  text-decoration: line-through;
  margin-right: 8px;
  font-size: var(--fs-2);
}

.product-card__actions {
  display: flex;
  gap: 10px;
}

/* Small label on image (e.g., "Ramazon") */
.pill {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: var(--fs-2);
  font-weight: 750;
  border: 1px solid rgba(201,169,106,0.30);
  background: rgba(201,169,106,0.14);
  color: rgba(201,169,106,0.95);
  backdrop-filter: blur(8px);
}

/* ---------------------------
   6) Product Page Gallery
---------------------------- */
.product {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-6);
  align-items: start;
}

.gallery {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gallery__main {
  aspect-ratio: 4 / 3;
  background: rgba(255,255,255,0.04);
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.thumb {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease);
}

.thumb:hover {
  transform: translateY(-1px);
  border-color: rgba(201,169,106,0.22);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.is-active {
  border-color: rgba(201,169,106,0.55);
  box-shadow: 0 0 0 4px rgba(201,169,106,0.14);
}

/* ---------------------------
   7) Cart Drawer / Cart Page Blocks
---------------------------- */
.cart-block {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cart-block__head {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--s-4);
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item__img {
  width: 96px;
  height: 80px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__title {
  font-weight: 750;
  line-height: 1.2;
}

.cart-item__sub {
  margin-top: 6px;
  color: var(--text-3);
  font-size: var(--fs-2);
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 8px 10px;
}

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease);
}

.qty button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.07);
}

.qty .val {
  min-width: 18px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.summary {
  padding: var(--s-4);
  display: grid;
  gap: 12px;
}

.summary .rowline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
}

.summary .rowline strong {
  color: var(--text);
}

.summary .total {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Voucher input */
.voucher {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.voucher .input {
  border-radius: 14px;
}

.voucher .btn {
  width: auto;
  border-radius: 14px;
}

/* ---------------------------
   8) Empty State
---------------------------- */
.empty {
  border-radius: var(--r-xl);
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03);
  padding: var(--s-6);
  text-align: center;
  display: grid;
  gap: 12px;
  place-items: center;
}

.empty__icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(201,169,106,0.30);
  background: rgba(201,169,106,0.12);
  box-shadow: 0 18px 55px rgba(201,169,106,0.12);
  display: grid;
  place-items: center;
}

.empty__title {
  font-size: var(--fs-5);
  font-weight: 850;
}

.empty__text {
  color: var(--text-2);
  max-width: 54ch;
  line-height: var(--lh-loose);
}

/* ---------------------------
   9) Tabs
---------------------------- */
.tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.tab {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}

.tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.tab.is-active {
  background: rgba(201,169,106,0.14);
  border-color: rgba(201,169,106,0.24);
  color: var(--brand-2);
}

/* ---------------------------
   10) Pagination
---------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--s-6);
}

.pager .btn {
  width: auto;
}

/* ---------------------------
   11) Footer
---------------------------- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.30);
  padding: var(--s-6) 0;
  margin-top: var(--s-7);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--s-6);
}

.footer__title {
  font-weight: 850;
  margin-bottom: 10px;
}

.footer__link {
  display: inline-flex;
  padding: 8px 0;
  color: var(--text-2);
  transition: color var(--t) var(--ease);
}

.footer__link:hover {
  color: var(--brand-2);
}

.footer__meta {
  color: var(--text-3);
  font-size: var(--fs-2);
  margin-top: 12px;
}

/* ---------------------------
   12) Responsive (components)
---------------------------- */
@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .hero__grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar__inner { flex-wrap: wrap; }
  .brand { min-width: auto; }
  .search { width: 100%; order: 3; }
  .nav { width: 100%; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
}

@media (max-width: 520px) {
  .products-grid { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
  .gallery__thumbs { grid-template-columns: repeat(4, 1fr); }
  .cart-item { grid-template-columns: 84px 1fr; }
  .cart-item__right { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .footer__grid { grid-template-columns: 1fr; }
}
