/* =============================================================================
   COMPONENT: catalog.detail
   ============================================================================= */

/* --- Base Styles --- */
.catalog-detail-component {
  width: 100%;
  background-color: #f8f9fa;
  padding: 40px 0;
  box-sizing: border-box;
  font-family: 'Open Sans', sans-serif;
}

.catalog-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Image --- */
.catalog-detail-image {
  width: 100%;
  height: 350px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: block;
  object-fit: cover;
}

.catalog-detail-image-placeholder {
  width: 100%;
  height: 350px;
  background: #f0f0f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  margin-bottom: 30px;
}

/* --- Content Layout --- */
.catalog-detail-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.catalog-detail-left {
  flex: 1;
  min-width: 40%;
}

.catalog-detail-right {
  flex: 2;
  min-width: 300px;
}

/* --- Title & Tags --- */
.catalog-detail-title {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.catalog-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.catalog-detail-tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  background-color: #D3C7FF;
  color: #3E026D;
}

.catalog-detail-tag:nth-child(3) {
  background-color: #C8E8FF;
  color: #0076C9;
}

.catalog-detail-tag:nth-child(4) {
  background-color: #B4FCCD;
  color: #026D27;
}

/* --- Investment Block --- */
.catalog-detail-investment {
  margin-bottom: 20px;
}

.catalog-detail-investment-label {
  font-size: 14px;
  color: #777;
  margin-bottom: 5px;
  font-weight: 500;
}

.catalog-detail-investment-amount {
  font-size: 35px;
  font-weight: 600;
}

.catalog-detail-invest-btn {
  padding: 14px 20px;
  background-color: #0D96F7;
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(13, 150, 247, 0.3);
}

.catalog-detail-invest-btn:hover {
  background-color: #0b85e0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 150, 247, 0.4);
}

.catalog-detail-invest-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(13, 150, 247, 0.3);
}

.catalog-detail-invest-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 150, 247, 0.3);
}

/* --- Experts Badge --- */
.catalog-detail-experts-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #878787;
  font-weight: 400;
  margin-bottom: 25px;
  background: #f8f9fa;
  border-radius: 12px;
}

.catalog-detail-experts-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #0D96F7;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.catalog-detail-experts-text {
  color: #878787;
  line-height: 1.4;
}

/* --- Description --- */
.catalog-detail-description {
  margin-bottom: 30px;
}

.catalog-detail-description-section {
  margin-bottom: 25px;
}

.catalog-detail-description-title {
  font-size: 14px;
  font-weight: 400;
  color: #101010B2;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.catalog-detail-description p {
  font-size: 16px;
  line-height: 1.7;
  color: #555;
  margin: 0;
}

/* --- Details Grid --- */
.catalog-detail-details {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: space-between;
}

.catalog-detail-detail {
  flex: 1;
  min-width: 120px;
}

.catalog-detail-detail-label {
  font-size: 14px;
  color: #777;
  margin-bottom: 5px;
  font-weight: 500;
}

.catalog-detail-detail-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

/* =============================================================================
   ACCORDION
   ============================================================================= */
.catalog-detail-accordion {
  margin-top: 40px;
  width: 100%;
}

.catalog-detail-accordion-item {
  background: white;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.catalog-detail-accordion-header {
  width: 100%;
  padding: 20px;
  background: white;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: 'Open Sans', sans-serif;
  transition: background 0.3s ease;
}

.catalog-detail-accordion-left {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.catalog-detail-accordion-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #0D96F7;
  color: #0D96F7;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  background-color: transparent;
}

.catalog-detail-accordion-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-align: left;
  margin-left: auto;
  max-width: 680px;
}

.catalog-detail-document-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.catalog-detail-accordion-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
  text-align: left;
}

.catalog-detail-accordion-arrow-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0D96F7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-detail-accordion-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.catalog-detail-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  width: 680px;
  margin-left: auto;
  padding-left: 0;
  box-sizing: border-box;
}

.catalog-detail-accordion-content-open {
  padding: 0 20px 20px;
  max-height: 1000px;
  width: 680px;
  margin-left: auto;
  box-sizing: border-box;
}

.catalog-detail-accordion-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #555;
  margin: 0;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* =============================================================================
   AUTH RESTRICTION (for unauthorized users)
   ============================================================================= */
.catalog-detail-auth-restriction {
  padding: 20px 15px;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.catalog-detail-auth-text {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin: 0 0 20px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.catalog-detail-auth-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.catalog-detail-auth-btn {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}

.catalog-detail-auth-btn-primary {
  background-color: #0D96F7;
  color: white;
  border: 2px solid #0D96F7;
}

.catalog-detail-auth-btn-primary:hover {
  background-color: #0b85e0;
  border-color: #0b85e0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 150, 247, 0.3);
}

.catalog-detail-auth-btn-secondary {
  background-color: transparent;
  color: #0D96F7;
  border: 2px solid #0D96F7;
}

.catalog-detail-auth-btn-secondary:hover {
  background-color: #0D96F7;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 150, 247, 0.3);
}

/* =============================================================================
   ERROR & EMPTY STATES
   ============================================================================= */
.catalog-detail-error {
  padding: 20px;
  background: #ffebee;
  color: #c62828;
  border-radius: 8px;
  margin: 20px 0;
}

.catalog-detail-empty {
  padding: 20px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 8px;
  margin: 20px 0;
}

.invest-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.invest-popup {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  position: relative;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.invest-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invest-popup-close:hover {
  color: #000;
}

.invest-popup-content {
  overflow-y: auto;
  flex: 1;
}

.invest-popup-content iframe {
  width: 100% !important;
  min-height: 500px !important;
  border: none !important;
  display: block !important;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* Tablet: ≤ 768px */
@media (max-width: 768px) {
  .catalog-detail-content {
    flex-direction: column;
  }
  
  .catalog-detail-left { order: 1; }
  .catalog-detail-right { order: 2; }
  
  .catalog-detail-image { height: auto; }
  
  .catalog-detail-accordion-header { padding: 15px; }
  
  .catalog-detail-accordion-left { min-width: 50px; }
  .catalog-detail-accordion-number {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .catalog-detail-accordion-center {
    max-width: calc(100% - 100px) !important;
    margin-left: 0 !important;
  }
  
  .catalog-detail-accordion-title { font-size: 15px; }
  
  .catalog-detail-accordion-arrow-wrapper {
    width: 28px;
    height: 28px;
  }
  
  .catalog-detail-accordion-icon {
    width: 14px;
    height: 14px;
  }
  
  .catalog-detail-accordion-content,
  .catalog-detail-accordion-content-open {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 0 15px 15px !important;
    box-sizing: border-box;
  }
  
  .catalog-detail-accordion-content-open {
    max-height: 1500px;
  }
  
  .catalog-detail-accordion-content p {
    font-size: 14px;
    line-height: 1.5;
  }
  
  .catalog-detail-invest-btn {
    padding: 12px;
    font-size: 15px;
  }
  
  .catalog-detail-experts-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .catalog-detail-experts-number {
    align-self: flex-start;
  }
  
  /* Popup */
  .invest-popup {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 12px;
  }
  
  .invest-popup-content {
    padding: 16px 20px 20px;
  }
  
  .invest-popup-content iframe {
    min-height: 600px !important;
  }
}

/* Mobile: ≤ 576px */
@media (max-width: 576px) {
  .catalog-detail-accordion-left { display: none; }
  
  .catalog-detail-accordion-header { padding: 12px 15px; }
  
  .catalog-detail-accordion-center {
    max-width: calc(100% - 40px) !important;
  }
  
  .catalog-detail-accordion-title {
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
  }
  
  .catalog-detail-accordion-arrow-wrapper {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }
  
  .catalog-detail-accordion-icon {
    width: 13px;
    height: 13px;
  }
  
  .catalog-detail-accordion-content-open {
    padding: 0 12px 15px !important;
    max-height: 2000px;
  }
  
  .catalog-detail-accordion-content p {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  
  .catalog-detail-experts-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .catalog-detail-experts-number {
    align-self: flex-start;
  }
  
  .catalog-detail-invest-btn {
    padding: 16px;
    font-size: 17px;
  }
  
  /* Auth restriction */
  .catalog-detail-auth-restriction { padding: 15px 12px; }
  
  .catalog-detail-auth-text {
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    padding: 0 5px;
  }
  
  .catalog-detail-auth-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 5px;
  }
  
  .catalog-detail-auth-btn {
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* Small Mobile: ≤ 380px */
@media (max-width: 380px) {
  .catalog-detail-auth-text { font-size: 12px; }
  
  .catalog-detail-auth-btn {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .catalog-detail-accordion-title { font-size: 13px; }
}