@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #8b8686;
  color: #0d0c22;
  line-height: 1.6;
  font-size: 16px;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.product-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 50px;
}

@media (min-width: 992px) {
  .product-container {
    grid-template-columns: 2fr 1fr;
    align-items: stretch; /* Añadir esto */
  }
}

.viewer-container {
  background: #f8f9fa;
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e21690;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

#renderCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  border-radius: 16px;
}

model-viewer {
  width: 100%;
  height: 100%;
  background-color: #f8f9fa !important;
  border-radius: 16px;
}

model-viewer::part(ar-button) {
  display: none !important;
}

.loading-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
  border-radius: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(103, 232, 249, 0.1);
  border-radius: 50%;
  border-top-color: #67e8f9;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: #67e8f9;
  font-size: 16px;
  font-weight: 600;
}

.bottom-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid #000000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.control-button {
  background: transparent;
  color: #6b7280;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.control-button:hover {
  background: linear-gradient(135deg, #67e8f9, #a855f7);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(103, 232, 249, 0.3);
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-info {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  height: 70vh; /* Mismo alto que viewer-container */
  min-height: 500px; /* Mismo min-height que viewer-container */
  border: 1px solid #898994;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Añadir para controlar overflow */
}

.product-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #0d0c22;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.category-badge-meta {
  padding: 8px 16px;
  border-radius: 50px;
  background: #f8f9fa;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e7e7e9;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profiles-container {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.user-profile,
.brand-profile {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  flex: 1;
  border: 1px solid #e7e7e9;
  transition: all 0.2s ease;
}

.user-profile:hover,
.brand-profile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #67e8f9;
}

.user-avatar-wrapper {
  position: relative;
  margin-right: 12px;
}

.user-avatar,
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #67e8f9, #a855f7);
  color: white;
  font-weight: bold;
  font-size: 14px;
  border: 2px solid #e7e7e9;
}

.brand-logo {
  margin-right: 12px;
}

.user-avatar img,
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info,
.brand-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name,
.brand-name {
  font-weight: 600;
  color: #0d0c22 !important; /* Forzar color oscuro para visibilidad */
  display: block;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 2px;
}

.user-stats,
.brand-stats {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.product-description {
  margin-bottom: 30px;
  color: #6b7280;
  line-height: 1.8;
  font-size: 15px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e7e7e9;
  flex: 1; /* Tomar espacio disponible */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* Máximo 6 líneas */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: auto;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
  text-decoration: none;
}

.website-button {
  background: #f8f9fa;
  color: #6b7280;
  border-color: #e7e7e9;
  flex: 2;
}

.website-button:hover {
  background: linear-gradient(135deg, #67e8f9, #a855f7);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(103, 232, 249, 0.3);
  text-decoration: none;
}

.share-button {
  background: #f8f9fa;
  color: #6b7280;
  border-color: #e7e7e9;
  flex: 1;
}

.share-button:hover {
  background: linear-gradient(135deg, #67e8f9, #a855f7);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(103, 232, 249, 0.3);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fallback styles */
.fallback-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  background: #f8f9fa;
  border-radius: 16px;
  padding: 40px 20px;
}

.fallback-icon {
  font-size: 80px;
  color: #67e8f9;
  margin-bottom: 25px;
}

.fallback-title {
  font-size: 28px;
  font-weight: 800;
  color: #0d0c22;
  margin-bottom: 20px;
}

.fallback-message {
  color: #6b7280;
  margin-bottom: 30px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 400px;
}

.fallback-image {
  max-width: 300px;
  max-height: 200px;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  padding: 30px;
  position: relative;
  transform: translateY(20px);
  transition: all 0.3s ease;
  border: 1px solid #e7e7e9;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #0d0c22;
  background: #f8f9fa;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #0d0c22;
}

/* AR Loading */
.ar-loading-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  color: #fff;
  z-index: 10000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 18px;
}

.ar-loading-message .spinner {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #67e8f9;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.ar-loading-message p {
  font-weight: 600;
}

/* Info card for not found */
.info-card {
  text-align: center;
  padding: 60px 40px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e7e7e9;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.info-card h2 {
  color: #0d0c22;
  margin-bottom: 20px;
  font-size: 32px;
  font-weight: 800;
}

.info-card p {
  color: #6b7280;
  margin-bottom: 30px;
  font-size: 16px;
  line-height: 1.6;
}

.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #67e8f9, #a855f7);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(103, 232, 249, 0.3);
}

.btn-create:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(103, 232, 249, 0.4);
  color: white;
}

/* Banner CTA Styles */
.cta-banner {
  margin: 60px auto 40px;
  max-width: 1400px;
  background: linear-gradient(135deg, #67e8f9 0%, #a855f7 100%);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(103, 232, 249, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  pointer-events: none;
}

.cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  gap: 30px;
}

.cta-text {
  flex: 1;
}

.cta-title {
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
}

.cta-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 500;
}

.cta-action {
  flex-shrink: 0;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.95);
  color: #0d0c22;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  background: white;
  color: #0d0c22;
  text-decoration: none;
}

.cta-button i:first-child {
  font-size: 18px;
}

.cta-button i:last-child {
  transition: transform 0.3s ease;
}

.cta-button:hover i:last-child {
  transform: translateX(4px);
}

.cta-decoration {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  opacity: 0.1;
  pointer-events: none;
}

.cta-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 60px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-container {
    padding: 15px;
  }

  .product-container {
    gap: 20px;
  }

  .viewer-container {
    height: 50vh;
    min-height: 400px;
  }

  .product-info {
    padding: 25px;
  }

  .product-title {
    font-size: 24px;
  }

  .profiles-container {
    flex-direction: column;
    gap: 10px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .bottom-controls {
    bottom: 15px;
    padding: 10px 20px;
  }

  .control-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Responsive para el banner */
@media (max-width: 768px) {
  .cta-banner {
    margin: 40px 15px 30px;
    padding: 30px 25px;
  }

  .cta-content {
    flex-direction: column;
    text-align: center;
    gap: 25px;
  }

  .cta-title {
    font-size: 24px;
  }

  .cta-subtitle {
    font-size: 16px;
  }

  .cta-button {
    padding: 14px 28px;
    font-size: 14px;
  }

  .cta-decoration {
    top: -10px;
    right: -10px;
    width: 80px;
    height: 80px;
  }

  .cta-icon {
    font-size: 40px;
  }
}
