/**
 * CardRelics Base Styles
 * Clean, modern, responsive layout & header navigation
 */

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

html, body {
  background-color: var(--cr-white);
  color: var(--cr-slate-900);
  font-family: var(--cr-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

button {
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
}

img, svg {
  display: block;
  max-width: 100%;
}

.cr-container {
  width: 100%;
  max-width: var(--cr-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===================================================
   1. TOP ANNOUNCEMENT BAR
   =================================================== */
.cr-topbar {
  background-color: var(--cr-dark-surface);
  color: var(--cr-topbar-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 34px;
  display: flex;
  align-items: center;
}

.cr-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cr-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cr-topbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #E2E8F0;
}

.cr-top-icon {
  width: 13px;
  height: 13px;
  stroke: #94A3B8;
}

.cr-topbar-sep {
  color: #475569;
  font-size: 10px;
}

.cr-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #F8FAFC;
}

.cr-top-star {
  display: inline-block;
}

/* ===================================================
   2. PRIMARY NAVBAR & HEADER
   =================================================== */
.cr-header {
  background-color: var(--cr-white);
  border-bottom: 1px solid var(--cr-slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

.cr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.cr-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cr-logo-img {
  width: 180px;
  height: auto;
}

.cr-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.cr-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cr-slate-800);
  padding: 6px 0;
}

.cr-nav-link:hover,
.cr-nav-link.active {
  color: var(--cr-primary);
}

.cr-chevron {
  width: 12px;
  height: 12px;
  stroke: var(--cr-slate-500);
  transition: transform 0.2s;
}

.cr-nav-link:hover .cr-chevron {
  stroke: var(--cr-primary);
}

/* Search Input */
.cr-search-form {
  position: relative;
  flex: 0 1 380px;
  display: flex;
  align-items: center;
}

.cr-search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  stroke: var(--cr-slate-400);
  pointer-events: none;
}

.cr-search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background-color: var(--cr-slate-50);
  border: 1px solid var(--cr-slate-200);
  border-radius: var(--cr-radius-full);
  font-size: 13px;
  color: var(--cr-slate-900);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.cr-search-input::placeholder {
  color: var(--cr-slate-400);
}

.cr-search-input:focus {
  background-color: var(--cr-white);
  border-color: var(--cr-slate-400);
  box-shadow: 0 0 0 3px rgba(255, 71, 34, 0.1);
}

/* Actions */
.cr-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.cr-action-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cr-slate-700);
}

.cr-action-link:hover {
  color: var(--cr-primary);
}

.cr-action-icon {
  width: 19px;
  height: 19px;
  stroke: var(--cr-slate-700);
}

.cr-action-link:hover .cr-action-icon {
  stroke: var(--cr-primary);
}

.cr-cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cr-cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--cr-primary);
  color: var(--cr-white);
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: var(--cr-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================================
   3. BREADCRUMBS
   =================================================== */
.cr-breadcrumb-bar {
  padding: 16px 0 10px;
  font-size: 13px;
  color: var(--cr-slate-500);
}

.cr-breadcrumb-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cr-breadcrumb-bar a {
  color: var(--cr-slate-500);
}

.cr-breadcrumb-bar a:hover {
  color: var(--cr-slate-900);
  text-decoration: underline;
}

.cr-crumb-sep {
  color: var(--cr-slate-300);
  font-size: 14px;
}

.cr-crumb-current {
  color: var(--cr-slate-800);
  font-weight: 500;
}

/* ===================================================
   4. FOOTER
   =================================================== */
.cr-footer {
  background-color: var(--cr-slate-900);
  color: var(--cr-slate-300);
  padding: 60px 0 30px;
  margin-top: 60px;
  border-top: 1px solid var(--cr-slate-800);
}

.cr-footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.cr-footer-brand p {
  margin-top: 16px;
  font-size: 13px;
  color: var(--cr-slate-400);
  line-height: 1.6;
  max-width: 320px;
}

.cr-footer-col h4 {
  color: var(--cr-white);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.cr-footer-col li {
  margin-bottom: 10px;
}

.cr-footer-col a {
  color: var(--cr-slate-400);
  font-size: 13px;
}

.cr-footer-col a:hover {
  color: var(--cr-primary);
}

.cr-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid var(--cr-slate-800);
  font-size: 12px;
  color: var(--cr-slate-500);
}

.cr-payment-badges {
  display: flex;
  gap: 8px;
}

.cr-pay-pill {
  background-color: var(--cr-slate-800);
  color: var(--cr-slate-300);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Mini Cart Drawer */
.cr-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.cr-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cr-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--cr-white);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.cr-drawer.active {
  transform: translateX(0);
}

.cr-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--cr-slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cr-drawer-title {
  font-size: 18px;
  font-weight: 700;
}

.cr-drawer-close {
  color: var(--cr-slate-500);
}

.cr-drawer-body {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
}

.cr-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--cr-slate-200);
}

.cr-btn-checkout {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--cr-primary);
  color: var(--cr-white);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--cr-radius-md);
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .cr-nav { display: none; }
  .cr-footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .cr-topbar-left { display: none; }
  .cr-topbar-inner { justify-content: center; }
  .cr-search-form { display: none; }
  .cr-footer-inner { grid-template-columns: 1fr; }
  .cr-footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}
