:root {
  --color-black: #1a1a1a;
  --color-red: #e8332a;
  --color-gray-100: #f7f7f8;
  --color-gray-200: #ececec;
  --color-gray-400: #b0b0b0;
  --color-gray-600: #6b6b6b;
  --color-white: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background: var(--color-gray-100);
  color: var(--color-black);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Header */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-daily { color: var(--color-black); }
.logo-hotdeal { color: var(--color-red); }

.admin-btn {
  background: var(--color-black);
  color: var(--color-white);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.admin-btn:hover { opacity: 0.85; }

/* Main */
.main-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
}
.page-subtitle {
  color: var(--color-gray-600);
  margin: 0 0 28px;
  font-size: 15px;
}

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

.empty-msg {
  text-align: center;
  color: var(--color-gray-600);
  padding: 60px 0;
}

.deal-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.deal-card-link { display: flex; flex-direction: column; height: 100%; }

.deal-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-gray-200);
  overflow: hidden;
}
.deal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.discount-badge {
  background: var(--color-red);
  color: var(--color-white);
  font-weight: 800;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: auto;
}
.ended-badge {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.deal-info {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.deal-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}
.original-price {
  color: var(--color-gray-400);
  text-decoration: line-through;
  font-size: 13px;
}
.sale-price {
  color: var(--color-red);
  font-weight: 800;
  font-size: 20px;
}

/* Footer */
.site-footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-200);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  text-align: center;
}
.partners-notice {
  font-size: 13px;
  color: var(--color-gray-600);
  margin: 0 0 8px;
}
.copyright {
  font-size: 12px;
  color: var(--color-gray-400);
  margin: 0;
}

/* Geo block */
.geo-block {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.geo-block-inner h1 { font-size: 22px; margin-bottom: 12px; }
.geo-block-inner p { color: var(--color-gray-600); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-inner {
  background: var(--color-white);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-gray-600);
}

.admin-actions { margin-bottom: 16px; }
.import-btn {
  width: 100%;
  background: #03c75a;
  color: var(--color-white);
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.publish-note {
  font-size: 12px;
  color: var(--color-gray-600);
  background: var(--color-gray-100);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.product-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.product-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-600);
}
.product-form input {
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-black);
}
.product-form input:focus {
  outline: none;
  border-color: var(--color-red);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.form-buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.save-btn {
  flex: 1;
  background: var(--color-red);
  color: var(--color-white);
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
}
.cancel-btn {
  flex: 1;
  background: var(--color-gray-200);
  color: var(--color-black);
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
}

.list-title { font-size: 15px; margin: 0 0 10px; }
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 8px 10px;
}
.admin-row img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--color-gray-200);
}
.admin-row-info {
  flex: 1;
  min-width: 0;
}
.admin-row-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row-price {
  font-size: 12px;
  color: var(--color-gray-600);
}
.admin-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.admin-row-actions button {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.btn-edit { background: var(--color-gray-200); }
.btn-end { background: #ffedd5; color: #9a5b00; }
.btn-delete { background: #fde2e1; color: var(--color-red); }
.row-ended { opacity: 0.55; }

/* Responsive */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .main-inner { padding: 20px 14px 40px; }
  .page-title { font-size: 22px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sale-price { font-size: 17px; }
}
