@use "../../../styles/abstracts/variables" as *;

$green: #7a4b20;
$green: #5e3817;
$primary-soft: rgba(122, 75, 32, 0.08);
$text-dark: #1a1a1a;
$text-light: #5f5f5f;
$border: rgba(122, 75, 32, 0.15);

.branchCard {
  position: relative;
  background: #ffffff;
  border: 1px solid $border;
  border-radius: 14px;
  padding: 1.3rem;
  transition: all 0.25s ease;
  display: flex;
  flex: 0 0 380px;
  flex-direction: column;

  &:hover {
    border-color: rgba($green, 0.4);
    box-shadow: 0 8px 22px rgba($green, 0.08);
    transform: translateY(-2px);
  }

  /* ===== STATUS ===== */
  &__status {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: $primary-soft;
    color: $text-dark;
    border-radius: 20px;
    padding: 0.15rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
  }

  /* ===== HEADER (LOGO + NAME) ===== */
  &__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  &__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
  }

  &__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: $text-dark;
  }

  /* ===== DETAILS ===== */
  &__details {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  &__row {
    font-size: 0.83rem;
    color: $text-light;
    font-weight: 500;

    strong {
      color: $text-dark;
      font-weight: 600;
      margin-right: 4px;
    }
  }

  /* ===== DIVIDER ===== */
  &__divider {
    margin: 0.8rem 0;
    border: none;
    height: 1px;
    background: $border;
  }

  /* ===== FOOTER ===== */
  &__footer {
    font-size: 0.8rem;
    color: $text-light;
    font-weight: 500;

    strong {
      color: $text-dark;
      font-weight: 600;
    }
  }

  /* ===== BUTTON ===== */
  &__button {
    margin-top: 1rem;
    width: 100%;
    background: $green;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;

    &:hover {
      background: $text-dark;
    }

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
  }

  /* ===== MOBILE ===== */
  @media (max-width: 600px) {
    padding: 1rem;

    &__name {
      font-size: 0.9rem;
    }

    &__row {
      font-size: 0.8rem;
    }
  }
}

/* ===== SKELETON ===== */
.skeleton {
  pointer-events: none;
}

.skeletonLogo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e5e7eb;
  animation: shimmer 1.4s infinite;
}

.skeletonLine {
  height: 12px;
  border-radius: 6px;
  background: #e5e7eb;
  margin-top: 6px;
  animation: shimmer 1.4s infinite;
}

.skeletonButton {
  height: 36px;
  border-radius: 10px;
  background: #e5e7eb;
  margin-top: 1rem;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-color: #e5e7eb; }
  50% { background-color: #f3f4f6; }
  100% { background-color: #e5e7eb; }
}