/* ============================================================
   LaserCraft Shop – jasno-szary motyw
   ============================================================ */

:root {
  --bg:           #f4f4f5;
  --bg-card:      #ffffff;
  --bg-header:    #ffffff;
  --border:       #e2e2e6;
  --text:         #1a1a1f;
  --text-muted:   #6b6b80;
  --primary:      #3a3a8c;
  --primary-hover:#2e2e72;
  --primary-light:#eeeef8;
  --accent:       #d64f2a;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.06);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --transition:   .18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: .9375rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ────────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1030;
}

.header-inner { gap: 1rem; }

.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -.3px;
}

/* ─── Search ────────────────────────────────────────────── */
.search-box { position: relative; }

.search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  color: var(--text);
  font-size: .9rem;
  height: 38px;
}
.search-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58,58,140,.12);
}

.search-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  padding: 0 .9rem;
  height: 38px;
}
.search-btn:hover { background: var(--primary-hover); color: #fff; }

/* Live search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1050;
  max-height: 360px;
  overflow-y: auto;
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .85rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--bg);
  transition: background var(--transition);
}
.search-dropdown-item:hover { background: var(--bg); }
.search-dropdown-item img {
  width: 42px; height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.search-dropdown-item .sdi-info { flex: 1; min-width: 0; }
.search-dropdown-item .sdi-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-dropdown-item .sdi-price { font-size: .8rem; color: var(--primary); }
.search-empty { padding: .75rem 1rem; color: var(--text-muted); font-size: .875rem; }

/* ─── Cart button ───────────────────────────────────────── */
.cart-btn {
  color: var(--text);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.cart-btn:hover { background: var(--primary-light); color: var(--primary); }

.cart-badge {
  top: -4px; right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ─── Breadcrumb ────────────────────────────────────────── */
.breadcrumb-nav {
  background: #ededf0;
  border-bottom: 1px solid var(--border);
}
.breadcrumb { font-size: .83rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ─── Hero ──────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, #f0f0f8 0%, #e8e8f2 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}
.hero-title { font-size: 2rem; font-weight: 800; color: var(--primary); margin: 0 0 .4rem; }
.hero-sub { color: var(--text-muted); font-size: 1rem; margin: 0; }

/* ─── Section titles ────────────────────────────────────── */
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.section-title { font-size: 1rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .04em; }

/* ─── Album cards ───────────────────────────────────────── */
.album-card {
  display: block;
  color: var(--text);
  transition: transform var(--transition);
}
.album-card:hover { transform: translateY(-2px); }

.album-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #e8e8ec;
}
.album-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.album-card:hover .album-thumb img { transform: scale(1.05); }

.album-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

.album-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
  padding: .4rem .5rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.album-card:hover .album-overlay { opacity: 1; }
.album-count { color: #fff; font-size: .75rem; font-weight: 600; }

.album-label {
  margin-top: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Product cards ─────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  height: 100%;
  display: flex; flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-thumb-link { display: block; }
.product-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: #ededf0;
}
.product-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.product-card:hover .product-img { transform: scale(1.06); }

.product-info {
  padding: .65rem .75rem .75rem;
  display: flex; flex-direction: column; flex: 1;
}

.product-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-name:hover { color: var(--primary); }

.product-meta { margin-top: .25rem; }
.product-dims { font-size: .75rem; color: var(--text-muted); }

.product-footer {
  margin-top: .5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}

.product-price {
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary);
}
.product-price-na {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
}

.btn-add-cart {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .2rem .45rem;
  font-size: .85rem;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-add-cart:hover { background: var(--primary-hover); color: #fff; }

/* ─── Product detail ────────────────────────────────────── */
.product-gallery-wrap {}

.product-main-img {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ededf0;
  text-align: center;
}
.product-full-img {
  max-height: 480px;
  object-fit: contain;
  width: 100%;
}

.product-thumbs { gap: .5rem; }
.thumb-btn {
  width: 64px; height: 64px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ededf0;
  cursor: pointer;
  transition: border-color var(--transition);
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn.active,
.thumb-btn:hover { border-color: var(--primary); }

.product-detail-name { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }

.product-detail-price {
  display: flex; align-items: baseline; gap: .4rem;
}
.price-value { font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.price-currency { font-size: 1rem; color: var(--primary); }
.price-na { color: var(--text-muted); font-style: italic; }

.params-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.params-table th { width: 40%; font-weight: 600; color: var(--text-muted); font-size: .85rem; }
.params-table td { font-size: .875rem; }
.params-table tr:last-child td,
.params-table tr:last-child th { border-bottom: none; }

/* Qty control */
.qty-control { overflow: hidden; }
.btn-qty {
  background: var(--bg);
  border: none;
  padding: .25rem .6rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
}
.btn-qty:hover { background: var(--primary-light); color: var(--primary); }
.qty-input { width: 44px; font-size: .9rem; background: #fff; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-display { min-width: 36px; text-align: center; font-weight: 600; }

/* ─── Cart offcanvas ────────────────────────────────────── */
.cart-offcanvas { width: 380px; }
.offcanvas-footer { background: #fafafa; }

.cart-offcanvas-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem 0;
  border-bottom: 1px solid var(--bg);
}
.cart-offcanvas-item:last-child { border-bottom: none; }
.cart-item-img { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); }
.cart-item-name { font-size: .83rem; font-weight: 600; line-height: 1.3; }
.cart-item-price { font-size: .8rem; color: var(--primary); font-weight: 700; }
.cart-item-remove { background: none; border: none; color: var(--text-muted); padding: 0; font-size: .85rem; cursor: pointer; }
.cart-item-remove:hover { color: var(--accent); }

/* ─── Cart page ─────────────────────────────────────────── */
.cart-item { transition: box-shadow var(--transition); }
.cart-item:hover { box-shadow: var(--shadow-sm); }
.cart-summary { position: sticky; top: 80px; }

/* ─── Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ─── Empty state ───────────────────────────────────────── */
.empty-state { color: var(--text-muted); }

/* ─── Misc ──────────────────────────────────────────────── */
.main-content { flex: 1; }

/* Toast / alert animacja */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert { animation: fadeIn .2s ease; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 575px) {
  .logo-text { display: none; }
  .hero-title { font-size: 1.4rem; }
  .cart-offcanvas { width: 100vw; }
}

/* ─── Search results – thumbnail grid ──────────────────────────────────── */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}

@media (max-width: 767px) {
  .search-results-grid { grid-template-columns: repeat(2, 1fr); }
}

.search-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform var(--transition);
}
.search-thumb-card:hover { transform: translateY(-2px); }

.search-thumb-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #ededf0;
}
.search-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.search-thumb-card:hover .search-thumb-img img { transform: scale(1.06); }

.search-thumb-label {
  margin-top: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
  width: 100%;
}
/* ─── Cart item thumbnail ────────────────────────────────────────────────── */
.cart-item-thumb-link { display: block; flex-shrink: 0; }

.cart-item-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: opacity var(--transition);
  display: block;
}
.cart-item-thumb-link:hover .cart-item-thumb { opacity: .85; }
