/* =========================================================
   Clubcards - isolated shopping-tab add-on
   ========================================================= */

#listsTab .clubcards-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(108, 82, 248, 0.18);
  border-radius: 999px;
  background: rgba(242, 239, 255, 0.88);
  color: #5b3ff4;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

#listsTab .clubcards-trigger i {
  font-size: 13px;
}

.clubcards-backdrop[hidden] {
  display: none !important;
}

.clubcards-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.clubcards-dialog {
  width: min(640px, 100%);
  max-height: min(86dvh, 780px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(108, 82, 248, 0.16);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(45, 39, 92, 0.22);
}

.clubcards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(108, 82, 248, 0.10);
}

.clubcards-header p {
  margin: 0 0 3px;
  color: #8a7cf4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clubcards-header h2 {
  margin: 0;
  color: #20243a;
  font-size: 22px;
  font-weight: 900;
}

.clubcards-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(242, 239, 255, 0.95);
  color: #5b3ff4;
  cursor: pointer;
}

.clubcards-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.8fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 20px;
}

.clubcards-field {
  display: grid;
  gap: 7px;
  color: #4b5068;
  font-size: 12px;
  font-weight: 850;
}

.clubcards-field input {
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(108, 82, 248, 0.16);
  border-radius: 16px;
  background: rgba(248, 247, 255, 0.85);
  color: #20243a;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  outline: none;
  padding: 0 14px;
}

.clubcards-field input:focus {
  border-color: rgba(108, 82, 248, 0.42);
  box-shadow: 0 0 0 4px rgba(108, 82, 248, 0.10);
}

.clubcards-upload {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px dashed rgba(108, 82, 248, 0.30);
  border-radius: 16px;
  background: rgba(248, 247, 255, 0.86);
  cursor: pointer;
}

.clubcards-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.clubcards-upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #ede9fe;
  color: #6c52f8;
}

.clubcards-upload-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.clubcards-upload-text strong {
  color: #262a43;
  font-size: 13px;
  font-weight: 900;
}

.clubcards-upload-text small {
  overflow: hidden;
  color: #737993;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clubcards-preview {
  position: relative;
  grid-column: 1 / -1;
  width: min(260px, 100%);
  overflow: hidden;
  border: 1px solid rgba(108, 82, 248, 0.14);
  border-radius: 18px;
  background: #fff;
}

.clubcards-preview img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.clubcards-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  cursor: pointer;
}

.clubcards-save {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: #6c52f8;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.clubcards-save:disabled {
  opacity: 0.68;
  cursor: wait;
}

.clubcards-list {
  min-height: 140px;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.clubcards-card {
  overflow: hidden;
  border: 1px solid rgba(108, 82, 248, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 12px 28px rgba(45, 39, 92, 0.08);
}

.clubcards-card-image {
  width: 100%;
  height: 120px;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(135deg, rgba(242, 239, 255, 0.98), rgba(255, 255, 255, 0.94));
  cursor: pointer;
}

.clubcards-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.clubcards-card-image span {
  color: #7c6af6;
  font-weight: 850;
}

.clubcards-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
}

.clubcards-card-footer strong {
  min-width: 0;
  overflow: hidden;
  color: #20243a;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clubcards-delete {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.9);
  color: #ef4444;
  cursor: pointer;
}

.clubcards-empty {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(248, 247, 255, 0.76);
  color: #737993;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.clubcards-full-image {
  margin-top: 12px;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid rgba(108, 82, 248, 0.12);
  border-radius: 18px;
  background: #fff;
}

.clubcards-full-image img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

@media (max-width: 820px) {
  #listsTab .overview-shopping-title-row .overview-card-actions {
    gap: 7px;
  }

  #listsTab .clubcards-trigger {
    min-height: 31px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .clubcards-backdrop {
    padding: 10px;
  }

  .clubcards-dialog {
    max-height: calc(100dvh - 20px);
    border-radius: 26px;
  }

  .clubcards-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .clubcards-list {
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }

  .clubcards-save {
    width: 100%;
  }
}

@media (max-width: 430px) {
  #listsTab .clubcards-trigger span {
    display: none;
  }

  #listsTab .clubcards-trigger {
    width: 34px;
    height: 34px;
    padding: 0;
  }
}
