/* ============================================
   AI Toolbox - Styles
   Minimalist light theme with soft blue accent
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-accent: #4f8cff;
  --color-accent-hover: #3b78e6;
  --color-accent-light: #eef4ff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-overlay: rgba(0, 0, 0, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-height: 64px;

  --transition-fast: 200ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Dark Mode Overrides ---------- */
.dark {
  --color-bg: #0f0f13;
  --color-surface: #1a1a22;
  --color-text: #e8e8ed;
  --color-text-secondary: #94949e;
  --color-text-muted: #6b6b76;
  --color-accent: #6a9bff;
  --color-accent-hover: #5a8aee;
  --color-accent-light: #1e2a3d;
  --color-border: #2a2a35;
  --color-border-light: #22222d;
  --color-overlay: rgba(0, 0, 0, 0.6);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.dark .hero__bg {
  background: linear-gradient(135deg, #131323 0%, #0f0f13 50%, #141428 100%);
}

.dark .hero__bg::before {
  background: radial-gradient(circle, rgba(106, 155, 255, 0.08) 0%, transparent 70%);
}

.dark .hero__bg::after {
  background: radial-gradient(circle, rgba(106, 155, 255, 0.05) 0%, transparent 70%);
}

.dark .hero__grid-item {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.dark .tool-card__btn--added {
  background: var(--color-success);
}

.dark .toast {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.theme-toggle__sun,
.theme-toggle__moon {
  position: absolute;
  transition: all var(--transition-base);
}

.theme-toggle__sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__moon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

.dark .theme-toggle__sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.dark .theme-toggle__moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 140, 255, 0.3);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Section Header ---------- */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--color-text);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.6rem;
  }
  .section-desc {
    font-size: 0.95rem;
  }
  .section-header {
    margin-bottom: 40px;
  }
}

/* =============================================
   HEADER / NAVIGATION
   ============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition-base), background-color 0.3s ease, border-color 0.3s ease;
}

.dark .header {
  background: rgba(15, 15, 19, 0.88);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-text);
}

.header__logo-icon {
  flex-shrink: 0;
}

.header__logo-text {
  letter-spacing: -0.02em;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.header__link:hover {
  color: var(--color-text);
}

.header__link:hover::after {
  width: 100%;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cart Button */
.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.cart-btn:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  background: var(--color-accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9px;
  transform: scale(0);
  transition: transform var(--transition-base);
}

.cart-badge--visible {
  transform: scale(1);
}

/* Menu Toggle (Mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition-base);
  transform-origin: center;
}

.menu-toggle--active .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle--active .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle--active .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-overlay--visible {
  opacity: 1;
}

@media (max-width: 768px) {
  .header__nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    transition: all var(--transition-base);
    pointer-events: none;
  }

  .header__nav--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .header__link {
    display: block;
    padding: 14px 24px;
    width: 100%;
    font-size: 1rem;
  }

  .header__link::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-overlay--visible {
    display: block;
  }
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  padding: calc(var(--header-height) + 80px) 0 100px;
  overflow: hidden;
  min-height: 100dvh;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f0f4ff 0%, #fafafa 50%, #f5f8ff 100%);
  z-index: 0;
}

.hero__bg::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero__bg::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.04) 0%, transparent 70%);
  border-radius: 50%;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero__content {
  max-width: 540px;
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(79, 140, 255, 0.15);
}

.hero__title {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--color-text);
}

.hero__accent {
  color: var(--color-accent);
}

.hero__desc {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
}

.hero__stats {
  display: flex;
  gap: 40px;
}

.hero__stat {
  display: flex;
  flex-direction: column;
}

.hero__stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.hero__stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Hero Visual - Decorative Grid */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 340px;
  height: 340px;
}

.hero__grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.hero__grid-item svg {
  opacity: 0.5;
  transition: opacity var(--transition-base);
}

.hero__grid-item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.hero__grid-item:hover svg {
  opacity: 0.8;
}

.hero__grid-item--1 { grid-column: 1; grid-row: 1; }
.hero__grid-item--2 { grid-column: 2 / 4; grid-row: 1; }
.hero__grid-item--3 { grid-column: 1 / 3; grid-row: 2; }
.hero__grid-item--4 { grid-column: 3; grid-row: 2; }
.hero__grid-item--5 { grid-column: 1; grid-row: 3; }
.hero__grid-item--6 { grid-column: 2 / 4; grid-row: 3; }

@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero__content {
    max-width: 100%;
    text-align: center;
  }

  .hero__desc {
    margin: 0 auto 32px;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__visual {
    display: none;
  }

  .hero__title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--header-height) + 60px) 0 60px;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__desc {
    font-size: 1rem;
  }

  .hero__stats {
    gap: 24px;
  }

  .hero__stat-num {
    font-size: 1.25rem;
  }
}

/* =============================================
   TOOLS SECTION
   ============================================= */
.tools {
  padding: 100px 0;
}

.tools__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

@media (max-width: 640px) {
  .tools__grid {
    grid-template-columns: 1fr;
  }
}

/* Tool Card */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base), background-color 0.3s ease, border-color 0.3s ease;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--color-accent));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tool-card__icon--blue { background: #4f8cff; }
.tool-card__icon--green { background: #22c55e; }
.tool-card__icon--purple { background: #8b5cf6; }
.tool-card__icon--orange { background: #f59e0b; }
.tool-card__icon--pink { background: #ec4899; }
.tool-card__icon--teal { background: #14b8a6; }
.tool-card__icon--indigo { background: #6366f1; }
.tool-card__icon--red { background: #ef4444; }

.tool-card__category {
  display: inline-block;
  padding: 2px 10px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.tool-card__name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.tool-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.tool-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.tool-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.tool-card__price-currency {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.tool-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-accent);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.tool-card__btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.02);
}

.tool-card__btn:active {
  transform: scale(0.98);
}

.tool-card__btn--added {
  background: var(--color-success);
  pointer-events: none;
}

/* =============================================
   FEATURES SECTION
   ============================================= */
.features {
  padding: 100px 0;
  background: var(--color-surface);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

@media (max-width: 640px) {
  .features__grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  padding: 32px 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-card__icon--blue {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.feature-card__icon--green {
  background: #f0fdf4;
  color: var(--color-success);
}

.feature-card__icon--purple {
  background: #f5f3ff;
  color: #8b5cf6;
}

.feature-card__icon--orange {
  background: #fff7ed;
  color: var(--color-warning);
}

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* =============================================
   ABOUT SECTION
   ============================================= */
.about {
  padding: 100px 0;
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about__content .section-tag {
  margin-bottom: 16px;
}

.about__content .section-title {
  text-align: left;
  margin-bottom: 20px;
}

.about__text {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 500px;
}

.about__content .btn {
  margin-top: 16px;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.about__stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: all var(--transition-base);
}

.about__stat-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.about__stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.about__stat-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .about__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about__content .section-title {
    text-align: center;
  }

  .about__text {
    max-width: 100%;
    text-align: center;
  }

  .about__content {
    text-align: center;
  }

  .about__stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .about__stat-card {
    padding: 24px 16px;
  }

  .about__stat-num {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .about__stats {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 60px 0 32px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border-light);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.footer__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  max-width: 280px;
  line-height: 1.6;
}

.footer__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer__col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.footer__col a {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.footer__col a:hover {
  color: var(--color-accent);
}

.footer__bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer__desc {
    max-width: 100%;
  }

  .footer__links {
    gap: 24px;
  }
}

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

/* =============================================
   CART DRAWER
   ============================================= */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.cart-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--color-surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.cart--open {
  transform: translateX(0);
}

.cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.cart__title {
  font-size: 1.2rem;
  font-weight: 600;
}

.cart__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.cart__close:hover {
  background: var(--color-accent-light);
  color: var(--color-text);
}

.cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Empty state */
.cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.cart__empty svg {
  margin-bottom: 16px;
}

.cart__empty p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.cart__empty span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Cart items */
.cart__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.cart-item__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item__price {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.cart-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-item__qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.cart-item__qty-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cart-item__qty-num {
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.cart-item__remove {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.cart-item__remove:hover {
  color: var(--color-danger);
}

/* Cart footer */
.cart__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border-light);
}

.cart__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.cart__total-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
}

.cart__checkout {
  width: 100%;
}

@media (max-width: 480px) {
  .cart {
    width: 100vw;
  }
}

/* =============================================
   PURCHASE MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  z-index: 301;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.modal--open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal__title {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-accent-light);
  color: var(--color-text);
}

.modal__body {
  padding: 24px 28px;
  overflow-y: auto;
}

/* Order summary in modal */
.order-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}

.order-item__name {
  font-weight: 500;
}

.order-item__qty {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.order-item__price {
  font-weight: 600;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  font-size: 1rem;
}

.order-total__price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Form */
.purchase-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-input {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

/* Success state */
.modal__success {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px;
  text-align: center;
}

.modal__success--visible {
  display: flex;
}

.modal__success-icon {
  margin-bottom: 16px;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.modal__success h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal__success p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  max-width: 320px;
}

.modal__footer {
  display: flex;
  gap: 12px;
  padding: 0 28px 24px;
}

.modal__footer .btn {
  flex: 1;
}

/* =============================================
   TOOL DETAIL MODAL
   ============================================= */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.detail-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 680px;
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 60px);
  z-index: 251;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
}

.detail-modal--open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.detail-modal__inner {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}

.detail-modal__inner::-webkit-scrollbar {
  width: 6px;
}

.detail-modal__inner::-webkit-scrollbar-track {
  background: transparent;
}

.detail-modal__inner::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

/* Header area with icon */
.detail-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 40px 36px 32px;
  background: var(--detail-bg, var(--color-accent));
  overflow: hidden;
}

.detail-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.detail-header__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.detail-header__info {
  flex: 1;
  min-width: 0;
  position: relative;
}

.detail-header__category {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 8px;
}

.detail-header__name {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.detail-header__version {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.detail-header__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
  z-index: 1;
}

.detail-header__close:hover {
  background: rgba(0, 0, 0, 0.25);
  color: white;
}

/* Body content */
.detail-body {
  padding: 28px 36px;
}

.detail-body__desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: 28px;
}

.detail-body__section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* Features list */
.detail-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.detail-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.detail-feature:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.detail-feature__check {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--detail-check, var(--color-accent));
  color: white;
  flex-shrink: 0;
}

.detail-feature__check svg {
  width: 10px;
  height: 10px;
}

/* Footer */
.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 32px;
  margin: 0 36px;
  border-top: 1px solid var(--color-border-light);
}

.detail-footer__price {
  display: flex;
  flex-direction: column;
}

.detail-footer__price-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.detail-footer__price-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.detail-footer__price-currency {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.detail-footer__actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 640px) {
  .detail-modal {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 40px);
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px 24px;
  }

  .detail-header__name {
    font-size: 1.3rem;
  }

  .detail-body {
    padding: 24px 24px;
  }

  .detail-features {
    grid-template-columns: 1fr;
  }

  .detail-footer {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    margin: 0 24px;
  }

  .detail-footer__actions {
    flex-direction: column;
  }

  .detail-footer__actions .btn {
    width: 100%;
  }
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 200px;
}

.toast--exit {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal].revealed:nth-child(2) { transition-delay: 100ms; }
[data-reveal].revealed:nth-child(3) { transition-delay: 200ms; }
[data-reveal].revealed:nth-child(4) { transition-delay: 300ms; }
[data-reveal].revealed:nth-child(5) { transition-delay: 400ms; }
[data-reveal].revealed:nth-child(6) { transition-delay: 500ms; }

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .cart {
    transition: none;
  }

  .modal {
    transition: none;
  }
}

/* =============================================
   UTILITY
   ============================================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
