@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --text: #1e293b;
  --muted: #475569;
  --accent: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --border: rgba(255, 255, 255, 0.4);
  --radius: 24px;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,86%,88%,1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(196,89%,82%,1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(328,89%,88%,1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(168,89%,85%,1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  transition: all 0.3s ease;
}

.wrap {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.narrow {
  max-width: 560px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.header-subscribe {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.header-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}

.header-stats span {
  white-space: nowrap;
}

.hero-shell {
  padding: 22px 0 8px;
}

.hero-copy {
  display: grid;
  gap: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  padding: 14px 24px;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
}

.lead {
  color: var(--muted);
  max-width: 640px;
  font-size: 1.12rem;
  margin: 0 auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.hero-note {
  margin: 0 auto;
  max-width: 660px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.seo-summary {
  max-width: 860px;
  margin: 0 auto 56px;
  color: var(--muted);
}

.seo-summary h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.25;
}

.seo-summary p {
  margin: 0 0 10px;
}

.feature {
  background: rgba(247, 250, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  padding: 18px 20px;
}

.feature strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.feature span {
  display: block;
  color: var(--muted);
  font-size: 0.98rem;
}

.grid-section {
  padding-top: 18px;
  padding-bottom: 64px;
}

.grid-header {
  margin-bottom: 24px;
}

.cta-row {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn.primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(139, 92, 246, 0.4);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.btn.danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
}

.btn.danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(239, 68, 68, 0.3);
}

.btn.block {
  width: 100%;
  margin-top: 12px;
  flex-shrink: 0;
}

.grid-section {
  padding-bottom: 80px;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.grid-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn.amazon {
  background: #FFD814; /* Amazon Yellow */
  color: #0F1111; /* Amazon Dark Text */
  box-shadow: 0 4px 10px rgba(255, 216, 20, 0.2);
  padding: 8px 20px;
  font-size: 14px;
  width: fit-content;
  align-self: center;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-weight: 400;
}

.btn.amazon:hover {
  background: #F7CA00;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 216, 20, 0.3);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(31, 38, 135, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.card-img {
  position: relative;
  height: 220px;
  flex-shrink: 0;
  background: white; 
  padding: 15px;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.5s ease;
}

.card:hover .card-img img {
  transform: scale(1.08);
}

.ph {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #cc0c39; /* Amazon Red */
  color: white;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.card-body {
  padding: 4px 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prices {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 0;
}

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

.price-new {
  color: #e11d48;
}

.price-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 1.1rem;
}

.rating {
  margin: 0;
  font-size: 0.9rem;
  color: #FFA41C; /* Amazon Star Orange */
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 42px 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.empty-state h3 {
  margin: 0;
  font-size: 1.4rem;
}

.empty-state p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
}

.site-footer {
  padding: 40px 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.modal-x {
  position: absolute;
  top: 16px;
  right: 20px;
  border: none;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-x:hover {
  background: rgba(255,255,255,0.9);
  color: var(--text);
}

.modal-panel h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.modal-panel label {
  display: block;
  margin: 20px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-panel input[type="email"],
.pad input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  margin-bottom: 16px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  outline: none;
}

.modal-panel input[type="email"]:focus,
.pad input[type="password"]:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-msg {
  margin-top: 12px;
  font-size: 0.95rem;
  text-align: center;
}

/* Admin */
.admin-body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding-top: 60px;
}

.wide {
  width: min(100%, 1280px);
}

.pad {
  padding: 32px;
}

.card.pad {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.stats {
  padding-left: 24px;
}

.stats li {
  margin-bottom: 12px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.admin-metrics div {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
}

.admin-inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
}

.admin-inline-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.admin-inline-form input {
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  font: inherit;
}

.admin-jobs {
  margin-top: 26px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-row form {
  margin: 0;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
  font-weight: 600;
}

.bundle-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.bundle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.bundle-main {
  display: grid;
  gap: 4px;
}

.bundle-main strong {
  font-size: 1rem;
}

.bundle-main span {
  color: var(--muted);
  font-size: 0.95rem;
}

.bundle-item form {
  margin: 0;
}

.admin-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-subtitle {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.admin-table.compact {
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: top;
}

.admin-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

.admin-table td code {
  font-size: 0.8rem;
}

.admin-table-btn {
  margin: 0 0 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.raw-json {
  max-width: 420px;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.cell-wrap {
  max-width: 320px;
  word-break: break-word;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.offer-detail {
  padding: 28px 0 70px;
}

.detail-nav {
  margin-bottom: 18px;
}

.detail-nav a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.offer-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.offer-detail-media img,
.offer-detail-media .ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.offer-detail-main {
  display: grid;
  gap: 16px;
  align-content: start;
}

.offer-detail-main h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.detail-discount,
.detail-note {
  margin: 0;
  color: var(--muted);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.pagination-btn, .pagination-current {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  color: var(--text);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.pagination-btn:hover:not(:disabled) {
  background: white;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(139, 92, 246, 0.15);
}

.pagination-current {
  background: var(--accent-gradient);
  border: none;
  color: white;
  box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card-grid img {
  display: block;
}

@media (max-width: 640px) {
  .wrap {
    width: min(100%, calc(100% - 24px));
  }

  .hero-shell {
    padding-top: 14px;
  }

  .hero-copy {
    padding: 14px 16px;
  }

  .grid-header {
    padding: 14px 16px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .offer-detail-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .nav {
    gap: 16px;
    font-size: 0.9rem;
  }
  
  .grid-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .pagination-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
}
