/**
 * File: public/styles.css
 * Description: Styles for the static simple online shop.
 */

/* Root tokens */
:root {
  --bg: #f7fafc;
  --card: #ffffff;
  --muted: #6b7280;
  --accent-1: #4f46e5;
  --accent-2: #7c3aed;
  --accent-3: #3730a3;
  --rose: #fb7185;
  --glass: rgba(255, 255, 255, 0.6);
  --container: 1100px;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

/* layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.site-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.site-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

/* buttons */
.btn {
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent-3);
  color: white;
  box-shadow: var(--shadow);
}
.btn.primary:hover {
  filter: brightness(0.95);
}
.btn.ghost {
  background: #f3f4f6;
  color: #111;
}

/* cart button */
.cart-btn {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 0;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}
.cart-count {
  background: var(--rose);
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  padding: 0 6px;
  margin-left: 4px;
}

/* hero */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 18px;
  background: var(--card);
  padding: 28px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero-left {
  flex: 1;
}
.hero-left h2 {
  margin: 0;
  font-size: 28px;
}
.hero-left p {
  color: var(--muted);
  margin-top: 8px;
}
.hero-right {
  width: 160px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.08),
    rgba(167, 139, 250, 0.06)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  font-weight: 700;
}

/* categories tabs */
.categories {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cat-btn {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.cat-btn.active {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow);
}

/* products grid */
.products-section {
  margin-top: 24px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

/* product card */
.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #dfdbdb; /* solid black border */
}
.card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.card .img {
  height: 160px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card h4 {
  margin: 0;
  font-size: 16px;
}
.card h4 .product-name {
  color: var(--accent-3);
  cursor: pointer;
  text-decoration: underline;
}
.card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.price {
  color: var(--accent-1);
  font-weight: 700;
}

/* cart drawer */
.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 360px;
  background: var(--card);
  box-shadow: -20px 40px 80px rgba(2, 6, 23, 0.12);
  transform: translateX(110%);
  transition: transform 0.28s ease-in-out;
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-left: 1px solid rgba(15, 23, 42, 0.04);
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-header {
  padding: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px;
}
.cart-items {
  padding: 12px;
  overflow: auto;
  flex: 1;
}
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-controls button {
  border: 0;
  background: #f3f4f6;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.cart-footer {
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.04);
}
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
}
.total-amount {
  font-size: 16px;
  color: var(--accent-1);
}

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.48);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* modal (product modal) */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
}
.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--card);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 18px;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

/* product gallery inside modal */
.gallery {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.gallery-main {
  flex: 1;
  min-height: 320px;
  background: #f3f4f6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 96px;
}
.gallery-thumbs img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}
.gallery-thumbs img.active {
  border-color: var(--accent-1);
}

/* toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(17, 24, 39, 0.95);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 80;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* small animations */
@keyframes bounce {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.2);
  }
  60% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
.cart-bounce {
  animation: bounce 0.45s;
}

/* responsive */
@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }
  .cart-drawer {
    width: 100%;
  }
  .gallery {
    flex-direction: column;
  }
  .gallery-thumbs {
    flex-direction: row;
    width: 100%;
    overflow: auto;
  }
}

/* Root tokens */
:root {
  --bg: #f7fafc;
  --card: #ffffff;
  --muted: #6b7280;
  --accent-1: #4f46e5;
  --accent-2: #7c3aed;
  --accent-3: #3730a3;
  --rose: #fb7185;
  --glass: rgba(255, 255, 255, 0.6);
  --container: 1100px;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

/* layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.site-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.site-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

/* buttons */
.btn {
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent-3);
  color: white;
  box-shadow: var(--shadow);
}
.btn.primary:hover {
  filter: brightness(0.95);
}
.btn.ghost {
  background: #f3f4f6;
  color: #111;
}

/* cart button */
.cart-btn {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 0;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}
.cart-count {
  background: var(--rose);
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  padding: 0 6px;
  margin-left: 4px;
}

/* hero */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 18px;
  background: var(--card);
  padding: 28px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero-left {
  flex: 1;
}
.hero-left h2 {
  margin: 0;
  font-size: 28px;
}
.hero-left p {
  color: var(--muted);
  margin-top: 8px;
}
.hero-right {
  width: 160px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.08),
    rgba(167, 139, 250, 0.06)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  font-weight: 700;
}

/* products grid */
.products-section {
  margin-top: 24px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

/* product card */
.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card .img {
  height: 160px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card h4 {
  margin: 0;
  font-size: 16px;
}
.card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.price {
  color: var(--accent-1);
  font-weight: 700;
}

/* cart drawer */
.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 360px;
  background: var(--card);
  box-shadow: -20px 40px 80px rgba(2, 6, 23, 0.12);
  transform: translateX(110%);
  transition: transform 0.28s ease-in-out;
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-left: 1px solid rgba(15, 23, 42, 0.04);
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-header {
  padding: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px;
}
.cart-items {
  padding: 12px;
  overflow: auto;
  flex: 1;
}
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-controls button {
  border: 0;
  background: #f3f4f6;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.cart-footer {
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.04);
}
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
}
.total-amount {
  font-size: 16px;
  color: var(--accent-1);
}

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.48);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* responsive */
@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }
  .cart-drawer {
    width: 100%;
  }
}
