/* ==========================================================================
   SELLER CONTACT STYLES
   Slide-out drawer for listing cards and slide-down panel for detail page.
   ========================================================================== */

/* Ensure the form inside listing card action bar preserves the 5-button flex layout */
.listing-card-actions .seller-contact-form {
  display: contents;
}

/* --------------------------------------------------------------------------
   LISTING CARD SLIDE-OUT DRAWER
   -------------------------------------------------------------------------- */
.listing-seller-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - 16px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: var(--background);
  border-top: 1px solid rgba(222, 173, 170, 0.35);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease;
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  .listing-seller-drawer {
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid rgba(222, 173, 170, 0.4);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
  }
}

.listing-seller-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Header */
.seller-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(222, 173, 170, 0.15);
  flex-shrink: 0;
}

.seller-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seller-drawer-heading {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary, #deadaa);
}

/* Close Button (top-right corner) */
.seller-drawer-close-btn,
.agent-contact-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(222, 173, 170, 0.25);
  background: rgba(222, 173, 170, 0.08);
  color: var(--text-light, #ffffff);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

@media (prefers-color-scheme: light) {
  .seller-drawer-close-btn,
  .agent-contact-close-btn {
    color: #111827;
    background: rgba(0, 0, 0, 0.04);
  }
}

.seller-drawer-close-btn:hover,
.agent-contact-close-btn:hover {
  background: var(--secondary, #deadaa);
  color: #111827;
  border-color: var(--secondary, #deadaa);
  transform: scale(1.08) rotate(90deg);
}

.seller-drawer-close-btn:active,
.agent-contact-close-btn:active {
  transform: scale(0.92);
}

/* Drawer Content Body */
.seller-drawer-content {
  padding: 12px 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Seller Identity */
.seller-card-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seller-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seller-card-business-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light, #ffffff);
  margin: 0;
  line-height: 1.25;
}

@media (prefers-color-scheme: light) {
  .seller-card-business-name {
    color: #111827;
  }
}

.seller-card-business-type {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  font-weight: 500;
  margin: 0;
}

/* Verified Badge in Seller Card */
.seller-card-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.16);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.seller-card-verified-badge svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* Contact Links List */
.seller-contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.seller-contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  /* background: rgba(222, 173, 170, 0.08); */
  /* border: 1px solid rgba(222, 173, 170, 0.18); */
  color: var(--text-light, #ffffff);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  word-break: break-all;
}

@media (prefers-color-scheme: light) {
  .seller-contact-link {
    color: #111827;
    background: #fbf8f6;
  }
}

.seller-contact-link:hover {
  background: rgba(222, 173, 170, 0.2);
  border-color: var(--secondary, #deadaa);
  transform: translateX(2px);
}

.seller-contact-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--secondary, #deadaa);
}

.seller-contact-link-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--secondary, #deadaa);
  font-weight: 600;
  margin-right: 4px;
  text-wrap: nowrap;
}

/* Social Links Container */
.seller-socials-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(222, 173, 170, 0.15);
}

.seller-socials-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--secondary, #deadaa);
}

.seller-socials-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seller-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(222, 173, 170, 0.1);
  border: 1px solid rgba(222, 173, 170, 0.25);
  color: var(--text-light, #ffffff);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  text-decoration: none;
  flex-shrink: 0;
  padding: 6px;
}

.seller-social-btn img,
.seller-social-btn svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.seller-social-btn:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: var(--secondary, #deadaa);
  background: rgba(222, 173, 170, 0.25);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Specific Social Brand Accents on Hover */
.seller-social-btn[data-platform="whatsapp"]:hover {
  background: #25D366;
  border-color: #25D366;
}
.seller-social-btn[data-platform="facebook"]:hover {
  background: #1877F2;
  border-color: #1877F2;
}
.seller-social-btn[data-platform="instagram"]:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: #e6683c;
}
.seller-social-btn[data-platform="linkedin"]:hover {
  background: #0A66C2;
  border-color: #0A66C2;
}
.seller-social-btn[data-platform="youtube"]:hover {
  background: #FF0000;
  border-color: #FF0000;
}
.seller-social-btn[data-platform="tiktok"]:hover {
  background: #000000;
  border-color: #00f2fe;
}
.seller-social-btn[data-platform="x"]:hover {
  background: #000000;
  border-color: #ffffff;
}
.seller-social-btn[data-platform="website"]:hover {
  background: var(--accent, #e6b77c);
  border-color: var(--accent, #e6b77c);
  color: #111827;
}

/* --------------------------------------------------------------------------
   DETAIL PAGE SLIDE-DOWN PANEL
   -------------------------------------------------------------------------- */
.agent-contact-form {
  display: contents;
}

.agent-contact-panel {
  height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              margin-top 0.25s ease;
}

.agent-contact-panel.is-open {
  height: 100%;
  opacity: 1;
  margin-top: 12px;
}

.agent-contact-panel-inner {
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  /* border: 1px solid rgba(222, 173, 170, 0.28); */
  background: rgba(222, 173, 170, 0.06);
  padding: 14px 16px;
  text-align: left;
}

@media (prefers-color-scheme: light) {
  .agent-contact-panel-inner {
    background: #fbf8f6;
    border-color: rgba(222, 173, 170, 0.4);
  }
}

.agent-contact-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.agent-contact-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary, #deadaa);
}

.agent-contact-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   LOADING SKELETON & ERROR STATES
   -------------------------------------------------------------------------- */
.seller-contact-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.seller-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(222, 173, 170, 0.1) 25%, rgba(222, 173, 170, 0.22) 50%, rgba(222, 173, 170, 0.1) 75%);
  background-size: 200% 100%;
  animation: seller-skeleton-shimmer 1.4s infinite ease-in-out;
}

.seller-skeleton-title {
  width: 60%;
  height: 18px;
}
.seller-skeleton-sub {
  width: 40%;
}
.seller-skeleton-pill {
  width: 100%;
  height: 36px;
  border-radius: 8px;
}

@keyframes seller-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.seller-contact-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 6px;
  color: var(--text-light, #ffffff);
  font-size: 0.82rem;
}

.seller-contact-retry-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary, #deadaa);
  background: transparent;
  border: 1px solid var(--secondary, #deadaa);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seller-contact-retry-btn:hover {
  background: var(--secondary, #deadaa);
  color: #111827;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .listing-seller-drawer,
  .agent-contact-panel,
  .seller-drawer-close-btn,
  .agent-contact-close-btn {
    transition: none !important;
  }
  .seller-skeleton-line {
    animation: none !important;
  }
}
