/**
 * KeyNest Main Stylesheet
 * 
 * Converted from original HTML/CSS site with premium enhancements
 * 
 * @package KeyNest
 * @version 1.0.0
 */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #657086;
  --line: #e1e6ef;
  --brand: #145ce6;
  --brand-dark: #0d3f9f;
  --mint: #13a76b;
  --gold: #f1b72c;
  --coral: #e9534f;
  --shadow: 0 18px 55px rgba(22, 32, 51, 0.12);
  --shadow-lg: 0 25px 70px rgba(22, 32, 51, 0.18);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ===== TOP STRIP ===== */
.top-strip {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 9px 20px;
  color: #eef4ff;
  background: #14213d;
  font-size: 13px;
  transition: var(--transition);
}

/* ===== MAIN NAVIGATION ===== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: var(--transition);
}

.main-nav.is-sticky {
  padding: 12px clamp(18px, 5vw, 72px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  transition: var(--transition);
}

.brand:hover {
  transform: scale(1.02);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius);
  transition: var(--transition);
}

.brand:hover .brand-mark {
  transform: rotate(-5deg);
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: grid;
  grid-template-columns: 1fr 46px;
  min-height: 46px;
  background: #f0f3f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 92, 230, 0.1);
}

.search-bar input {
  min-width: 0;
  padding: 0 16px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-bar button,
.cart-button,
.menu-toggle,
.add-cart,
.newsletter button {
  cursor: pointer;
  border: 0;
  transition: var(--transition);
}

.search-bar button {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
}

.search-bar button:hover {
  background: var(--brand-dark);
}

.search-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
}

/* ===== NAV ACTIONS ===== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

.nav-actions a {
  position: relative;
}

.nav-actions a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s ease;
}

.nav-actions a:hover::after {
  width: 100%;
}

.cart-button {
  padding: 10px 13px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.cart-button:hover {
  background: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cart-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cart-button:active::before {
  width: 300px;
  height: 300px;
}

.cart-button span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  transition: var(--transition);
}

.cart-button.bounce span {
  animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ===== MOBILE MENU TOGGLE ===== */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--ink);
  border-radius: var(--radius);
  position: relative;
  z-index: 101;
}

.menu-toggle:hover {
  background: var(--brand);
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #fff;
  transition: var(--transition);
}

.menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== HERO SECTION ===== */
.hero {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 250px;
  gap: 22px;
  padding: 30px clamp(18px, 5vw, 72px);
}

.category-panel,
.deal-card,
.product-card,
.steps article,
.reviews article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: var(--transition);
}

.category-panel {
  padding: 18px;
}

.category-panel h2,
.footer h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.category-panel a {
  display: block;
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  position: relative;
  padding-left: 0;
}

.category-panel a::before {
  content: '→';
  position: absolute;
  left: -20px;
  opacity: 0;
  transition: var(--transition);
}

.category-panel a:hover {
  color: var(--brand);
  padding-left: 20px;
}

.category-panel a:hover::before {
  opacity: 1;
  left: 0;
}

.category-panel a:last-child {
  border-bottom: 0;
}

/* ===== HERO MAIN ===== */
.hero-main {
  position: relative;
  display: grid;
  min-height: 430px;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background:
    linear-gradient(120deg, rgba(20, 92, 230, 0.95), rgba(19, 167, 107, 0.88)),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.46), transparent 30%);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-copy {
  align-self: center;
  max-width: 630px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow,
.promo-band .eyebrow {
  color: #d7ffed;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ===== BUTTONS ===== */
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border-radius: var(--radius);
  font-weight: 800;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.button:active::before {
  width: 300px;
  height: 300px;
}

.button.primary {
  color: var(--brand-dark);
  background: #fff;
}

.button.primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.button.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  transform: translateY(-3px);
}

/* ===== HERO VISUAL ===== */
.hero-visual {
  position: relative;
  min-height: 300px;
}

.license-card {
  position: absolute;
  width: 210px;
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

.license-card span {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius);
  font-weight: 900;
}

.license-card strong,
.license-card small {
  display: block;
}

.license-card small {
  margin-top: 7px;
  color: var(--muted);
}

.card-one {
  top: 18px;
  right: 88px;
  transform: rotate(-5deg);
  animation-delay: 0s;
}

.card-two {
  right: 4px;
  bottom: 30px;
  transform: rotate(7deg);
  animation-delay: 2s;
}

.card-two span {
  background: var(--mint);
}

.key-chip {
  position: absolute;
  right: 64px;
  bottom: 145px;
  padding: 12px 16px;
  color: #143321;
  background: #d7ffed;
  border-radius: var(--radius);
  font-weight: 900;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* ===== DEAL STACK ===== */
.deal-stack {
  display: grid;
  gap: 22px;
}

.deal-card {
  min-height: 160px;
  padding: 20px;
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.deal-card span {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

.deal-card strong {
  font-size: 24px;
  line-height: 1.2;
}

.deal-card.accent {
  color: #fff;
  background: var(--coral);
  border-color: transparent;
}

.deal-card.accent span {
  color: rgba(255, 255, 255, 0.78);
}

/* ===== TRUST ROW ===== */
.trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 clamp(18px, 5vw, 72px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.trust-row div {
  padding: 20px;
  background: #fff;
  transition: var(--transition);
}

.trust-row div:hover {
  background: var(--bg);
}

.trust-row strong,
.trust-row span {
  display: block;
}

.trust-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== SECTION HEAD ===== */
.section-head {
  max-width: 1180px;
  margin: 62px auto 22px;
  padding: 0 clamp(18px, 5vw, 72px);
}

.section-head h2,
.promo-band h2,
.how-it-works h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  padding: 0 clamp(18px, 5vw, 72px);
}

.product-card {
  overflow: hidden;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-card.is-hidden {
  display: none;
}

.product-art {
  display: grid;
  height: 190px;
  place-items: center;
  color: #fff;
  font-size: 42px;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.product-art::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.product-card:hover .product-art::before {
  left: 100%;
}

.product-art.blue {
  background: linear-gradient(135deg, #145ce6, #61a8ff);
}

.product-art.green {
  background: linear-gradient(135deg, #13a76b, #8ae8bf);
}

.product-art.red {
  background: linear-gradient(135deg, #e9534f, #ffad78);
}

.product-art.gold {
  background: linear-gradient(135deg, #f1b72c, #ffe2a3);
}

.product-info {
  padding: 18px;
}

.tag {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-card h3 {
  margin: 10px 0 8px;
  font-size: 20px;
}

.product-card p {
  min-height: 54px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.price-row strong {
  font-size: 22px;
}

.add-cart {
  min-width: 72px;
  min-height: 40px;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius);
  font-weight: 800;
}

.add-cart:hover {
  background: var(--brand-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.add-cart:active {
  transform: scale(0.95);
}

/* ===== PROMO BAND ===== */
.promo-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 70px clamp(18px, 5vw, 72px);
  padding: 34px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.95), rgba(20, 92, 230, 0.88)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.08) 18px 20px);
  border-radius: var(--radius);
  transition: var(--transition);
}

.promo-band:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
  padding: 0 clamp(18px, 5vw, 72px);
}

.section-head.compact {
  margin: 0 0 22px;
  padding: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.steps article {
  padding: 24px;
}

.steps article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.steps span {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-weight: 900;
  transition: var(--transition);
}

.steps article:hover span {
  background: var(--brand);
  transform: scale(1.1);
}

.steps h3 {
  margin: 0 0 8px;
}

.steps p,
.reviews p,
.footer p {
  color: var(--muted);
  line-height: 1.55;
}

/* ===== REVIEWS ===== */
.reviews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 70px clamp(18px, 5vw, 72px);
}

.reviews article {
  padding: 24px;
}

.reviews article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* ===== FOOTER ===== */
.footer {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 26px;
  padding: 46px clamp(18px, 5vw, 72px);
  color: #dbe5f6;
  background: #14213d;
}

.footer a {
  display: block;
  margin: 10px 0;
  color: #dbe5f6;
  position: relative;
  width: fit-content;
}

.footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.3s ease;
}

.footer a:hover::after {
  width: 100%;
}

.footer .brand {
  display: inline-flex;
  color: #fff;
}

.newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.newsletter input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  transition: var(--transition);
}

.newsletter input:focus {
  outline: 2px solid var(--brand);
}

.newsletter button {
  padding: 0 14px;
  color: #fff;
  background: var(--mint);
  border-radius: var(--radius);
  font-weight: 800;
}

.newsletter button:hover {
  background: #0f8a58;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  padding: 13px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .deal-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-main {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  .top-strip {
    display: none;
  }

  .main-nav {
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .menu-toggle {
    display: block;
  }

  .search-bar,
  .nav-actions {
    display: none;
    grid-column: 1 / -1;
  }

  .main-nav.is-open .search-bar,
  .main-nav.is-open .nav-actions {
    display: grid;
  }

  .main-nav.is-open .nav-actions {
    align-items: stretch;
    gap: 10px;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }

  .hero-main {
    min-height: auto;
    padding: 28px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .category-panel {
    order: 2;
  }

  .deal-stack,
  .trust-row,
  .steps,
  .reviews,
  .footer {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .promo-band {
    align-items: flex-start;
    flex-direction: column;
    margin-block: 44px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .site-header,
  .toast,
  .menu-toggle {
    display: none !important;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  a {
    text-decoration: underline;
  }
}
