/* ==========================================
   YSHOP — style.css
   ========================================== */

:root {
  --black: #0a0a0a;
  --white: #fafafa;
  --accent: #ff4d00;
  --accent2: #ffb800;
  --gray: #888;
  --light: #f2f2f0;
  --card-bg: #fff;
  --border: #e8e8e8;
  --radius: 16px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
}

/* ---- HEADER ---- */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--black); letter-spacing: -1px;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

nav {
  display: flex; align-items: center;
  gap: 24px; margin-left: 32px; flex: 1;
}

nav a {
  font-size: 14px; font-weight: 500;
  color: var(--gray); text-decoration: none;
  transition: color 0.2s;
}
nav a:hover { color: var(--black); }

.tg-link {
  display: flex; align-items: center; gap: 6px;
  background: #0088cc; color: white !important;
  padding: 8px 14px; border-radius: 50px;
  font-size: 13px !important; font-weight: 600 !important;
  transition: opacity 0.2s !important;
}
.tg-link:hover { opacity: 0.85; }

.cart-btn {
  margin-left: auto; display: flex;
  align-items: center; gap: 8px;
  background: var(--black); color: white;
  border: none; padding: 10px 20px;
  border-radius: 50px; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}
.cart-btn:hover { background: var(--accent); transform: scale(1.03); }

.badge {
  background: var(--accent); color: white;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 50px;
}

/* ---- HERO ---- */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 60px; min-height: 88vh;
}

.hero-tag {
  display: inline-block;
  background: var(--accent2); color: var(--black);
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 5px 14px;
  border-radius: 50px; margin-bottom: 20px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -2px; margin-bottom: 20px;
}
.hero-text h1 em {
  font-style: normal; color: var(--accent);
}

.hero-text p {
  font-size: 16px; color: var(--gray);
  line-height: 1.7; max-width: 380px; margin-bottom: 36px;
}

.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
}

.hero-actions button {
  background: var(--black); color: white;
  border: none; padding: 14px 28px;
  border-radius: 50px; font-size: 16px;
  font-family: var(--font-body); font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.hero-actions button:hover { background: var(--accent); transform: translateY(-2px); }

.outline-btn {
  display: inline-flex; align-items: center;
  border: 2px solid var(--black); color: var(--black);
  padding: 12px 26px; border-radius: 50px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: all 0.2s;
}
.outline-btn:hover { background: var(--black); color: white; }

/* Hero visual */
.hero-visual {
  position: relative; display: flex;
  justify-content: center; align-items: center;
  height: 440px;
}

.blob {
  width: 340px; height: 340px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 55%;
  animation: morph 6s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes morph {
  0%, 100% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 55%; }
  33%       { border-radius: 40% 60% 45% 55% / 60% 40% 55% 50%; }
  66%       { border-radius: 50% 50% 60% 40% / 45% 55% 50% 60%; }
}

.floating-card {
  position: absolute; top: 60px; right: 20px;
  background: white; padding: 14px 20px;
  border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ---- PRODUCTS SECTION ---- */
#products {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px;
}

.section-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 36px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800;
  letter-spacing: -1px;
}

.refresh-btn {
  background: var(--light); border: none;
  padding: 10px 20px; border-radius: 50px;
  font-family: var(--font-body); font-size: 14px;
  font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.refresh-btn:hover { background: var(--border); }

/* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Loading */
.loading {
  grid-column: 1/-1; text-align: center; padding: 80px 0;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Product Card */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.10);
}

.product-card img {
  width: 100%; height: 240px;
  object-fit: cover; display: block;
  background: var(--light);
}

.product-info { padding: 18px; }

.product-date {
  font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 6px;
}

.product-info h3 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: -0.3px;
}

.product-desc {
  font-size: 13px; color: var(--gray);
  line-height: 1.5; margin-bottom: 14px;
}

.product-footer {
  display: flex; align-items: center;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--black);
}

.add-btn {
  background: var(--black); color: white;
  border: none; width: 38px; height: 38px;
  border-radius: 50%; font-size: 20px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.add-btn:hover { background: var(--accent); transform: rotate(90deg); }
.add-btn.added { background: #22c55e; }

/* Empty state */
.empty {
  grid-column: 1/-1; text-align: center; padding: 80px 0;
}
.empty h3 { font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--gray); }

/* ---- CART SIDEBAR ---- */
.cart-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 200;
}
.cart-overlay.open { display: block; }

.cart-sidebar {
  position: fixed; top: 0; right: -420px;
  width: 420px; max-width: 100vw;
  height: 100vh; background: white;
  z-index: 201; padding: 28px;
  display: flex; flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.cart-sidebar.open { right: 0; }

.cart-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 24px;
}
.cart-header h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
}
.cart-header button {
  background: var(--light); border: none;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

#cart-list {
  list-style: none; flex: 1;
  display: flex; flex-direction: column; gap: 12px;
}

.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--border);
  border-radius: 12px;
}
.cart-item img {
  width: 56px; height: 56px; border-radius: 8px;
  object-fit: cover; background: var(--light);
}
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; font-weight: 600; }
.cart-item-info span { font-size: 13px; color: var(--gray); }

.cart-item-actions {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  background: var(--light); border: none;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.qty-num { font-weight: 700; font-size: 15px; min-width: 20px; text-align: center; }

.cart-empty {
  color: var(--gray); text-align: center;
  padding: 40px 0; font-size: 15px;
}

.cart-footer { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 20px; }

.total-row {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 20px;
  font-size: 18px;
}
.total-row strong { font-family: var(--font-display); font-size: 26px; }

.order-form { display: flex; flex-direction: column; gap: 10px; }

.order-form input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.2s;
}
.order-form input:focus {
  outline: none; border-color: var(--black);
}

.place-order-btn {
  background: var(--accent); color: white;
  border: none; padding: 14px;
  border-radius: 12px; font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s, transform 0.2s;
}
.place-order-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.place-order-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#order-status {
  text-align: center; font-size: 14px; font-weight: 600; min-height: 20px;
}

/* ---- ABOUT ---- */
.about {
  background: var(--black); color: white;
  padding: 80px 24px;
}
.about-inner { max-width: 1200px; margin: 0 auto; }
.about h2 {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 800;
  margin-bottom: 48px; letter-spacing: -1px;
}
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.feature span { font-size: 36px; display: block; margin-bottom: 12px; }
.feature h4 { font-family: var(--font-display); font-size: 20px; margin-bottom: 6px; }
.feature p { color: #999; font-size: 14px; line-height: 1.6; }

/* ---- FOOTER ---- */
footer {
  text-align: center; padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--gray);
}
footer a { color: var(--black); text-decoration: none; font-weight: 600; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 20px; min-height: auto;
  }
  .hero-visual { height: 280px; }
  nav .tg-link { display: none; }
  nav a:not(.tg-link) { display: none; }
  .cart-sidebar { width: 100%; }
  .blob { width: 240px; height: 240px; }
}
