/* Lil Things Club Product Manager */
:root {
  --pink: #f6b7c8;
  --pink-dark: #df7f9e;
  --cream: #fffaf6;
  --brown: #4b3b3b;
  --line: #eadbdd;
  --white: #ffffff;
  --shadow: 0 12px 35px rgba(92, 57, 65, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  color: var(--brown);
  background: var(--cream);
}

button, input, textarea { font: inherit; }

button { cursor: pointer; }

.admin-page {
  min-height: 100vh;
  padding-bottom: 60px;
}

.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 22px clamp(20px, 5vw, 70px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.admin-header h1,
.login-card h1,
.editor-card h2,
.products-card h2 {
  margin: 0;
}

.admin-logo {
  font-family: Pacifico, cursive;
  color: var(--pink-dark);
  font-size: 1.25rem;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-actions a,
.ghost-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--brown);
  border-radius: 12px;
  padding: 9px 14px;
  text-decoration: none;
}

.admin-shell {
  width: min(1150px, calc(100% - 30px));
  margin: 30px auto;
  display: grid;
  gap: 24px;
}

.editor-card,
.products-card,
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 35px);
}

.login-card {
  width: min(450px, calc(100% - 30px));
  margin: 10vh auto;
}

.login-card h1 { margin-top: 8px; }

.muted,
small {
  color: #8c777c;
}

.section-heading,
.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.eyebrow {
  display: block;
  color: var(--pink-dark);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 18px;
}

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--brown);
  background: #fffdfc;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--pink-dark);
  box-shadow: 0 0 0 3px rgba(246,183,200,.22);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 4px 0 20px;
}

.check {
  margin: 0;
  font-weight: 500;
}

.check input {
  display: inline-block;
  width: auto;
  margin: 0 5px 0 0;
}

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 35px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff0f4;
  border: 1px solid #f1c8d4;
  border-radius: 99px;
  padding: 4px 9px;
  font-size: .9rem;
}

.chip button {
  border: 0;
  background: transparent;
  padding: 0;
}

.small-btn,
.primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 14px;
}

.small-btn {
  background: #fff0f4;
  color: #a85e78;
  border: 1px solid #f1c8d4;
}

.primary-btn {
  background: var(--pink-dark);
  color: white;
  padding: 12px 22px;
  font-weight: 700;
}

.primary-btn:disabled {
  opacity: .6;
  cursor: wait;
}

.dynamic-row,
.variant-row {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.dynamic-row {
  grid-template-columns: 1fr auto;
}

.variant-row {
  grid-template-columns: 1.1fr 1.2fr .8fr .8fr auto;
}

.dynamic-row input,
.variant-row input {
  margin: 0;
}

.remove-btn {
  border: 0;
  background: #fff0f0;
  color: #c66c75;
  border-radius: 10px;
  padding: 8px 11px;
}

section {
  margin-top: 28px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.image-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: #fffafa;
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 9px;
}

.image-card small {
  display: block;
  padding: 5px;
}

.remove-image {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: white;
  color: #bd6170;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
}

.message {
  min-height: 20px;
  margin: 0;
}

.message.error { color: #c65361; }
.message.success { color: #4b9a73; }

.hidden { display: none !important; }

.search {
  width: min(300px, 50%);
  margin: 0;
}

.product-row-admin {
  display: grid;
  grid-template-columns: 75px 1fr auto;
  gap: 15px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}

.admin-product-image {
  width: 75px;
  height: 75px;
  border-radius: 13px;
  background: #fff0f4;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.admin-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-product-info strong,
.admin-product-info span,
.admin-product-info small {
  display: block;
}

.admin-product-info span {
  font-size: .95rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.admin-row-actions a {
  text-decoration: none;
  color: #a85e78;
  padding: 7px 10px;
}

.empty {
  padding: 30px;
  text-align: center;
  color: #8c777c;
}

@media (max-width: 700px) {
  .admin-header,
  .section-heading,
  .subheading {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .variant-row {
    grid-template-columns: 1fr 1fr;
  }

  .variant-row .remove-btn {
    width: max-content;
  }

  .product-row-admin {
    grid-template-columns: 60px 1fr;
  }

  .admin-product-image {
    width: 60px;
    height: 60px;
  }

  .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .search {
    width: 100%;
  }
}


/* =========================================
   PRODUCT IMAGE MANAGEMENT
========================================= */

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}


.image-card {
  position: relative;
  border: 2px solid #eadfe8;
  border-radius: 16px;
  padding: 10px;
  background: #fff;
  cursor: grab;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}


.image-card:hover {
  transform: translateY(-2px);
}


.image-card.dragging {
  opacity: 0.45;
}


.image-card.drag-over {
  border-color: #5c3f35;
  box-shadow: 0 0 0 3px rgba(92, 63, 53, 0.12);
}


.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}


.image-card-info {
  padding-top: 8px;
  text-align: center;
  font-size: 13px;
}


.image-card .remove-image {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}


/* Tablet */

@media (max-width: 900px) {

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

}


/* Mobile */

@media (max-width: 600px) {

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}



.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
