/* Base styles */
.grd-container {
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--grd-bg-color, #ffffff);
    color: var(--grd-text-color, #333333);
}

/* Light Mode (default) */
.grd-light-mode {
    --grd-bg-color: #ffffff;
    --grd-card-bg: #f9f9f9;
    --grd-text-color: #333333;
    --grd-border-color: #e0e0e0;
    --grd-meta-color: #666666;
}

/* Dark Mode */
.grd-dark-mode {
    --grd-bg-color: #1a1a1a;
    --grd-card-bg: #2d2d2d;
    --grd-text-color: #ffffff;
    --grd-border-color: #444444;
    --grd-meta-color: #aaaaaa;
}



.grd-review {
    background-color: var(--grd-card-bg);
    border-color: var(--grd-border-color);
    color: var(--grd-text-color);
    border-radius: var(--grd-border-radius, 8px);
}

.grd-review-meta, .grd-review-date {
    color: var(--grd-meta-color);
}

.grd-star-rating {
    color: var(--grd-star-color);
}

.grd-review a {
    color: var(--grd-link-color);
}

/* Botón de alternar dark mode */
.grd-toggle-dark-mode {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: var(--grd-card-bg);
    color: var(--grd-text-color);
    border: 1px solid var(--grd-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.grd-toggle-dark-mode:hover {
    opacity: 0.8;
}



.grd-container {
  font-family: var(--grd-font-family, inherit);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* ============================================= */
/* BUSINESS PROFILE */
/* ============================================= */
.grd-business-profile {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 120px;
  background-color: var(--grd-card-bg);
  border-radius: var(--grd-border-radius, 8px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.grd-business-thumbnail-container {
  width: 100px;
  height: 100px;
  margin: 0 auto 15px;
  position: relative;
}

.grd-business-thumbnail {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.grd-default-business-icon {
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #757575;
  border: 1px solid #e0e0e0;
}

.grd-default-business-icon .material-icons {
  font-size: 48px;
  color: var(--grd-button-bg-color, #4285F4);
}

.grd-business-title {
  margin: 0 0 10px;
  font-size: 1.5em;
  font-weight: 600;
}

.grd-business-rating {
  margin-bottom: 10px;
}

.grd-review-count {
  margin-left: 10px;
  font-size: 0.9em;
  color: var(--grd-text-color);
}

.grd-business-address {
  margin: 0;
  color: var(--grd-text-color);
}

/* ============================================= */
/* REVIEW CARD */
/* ============================================= */
.grd-review {

max-height: 500px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.4s ease-in-out;
  opacity: 1;
  will-change: transform, box-shadow;
  overflow: hidden;
  transform: translateY(0);
}

.grd-review:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
  transform: translateY(-5px);
}

.grd-review-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.grd-reviewer-image {
  margin-right: 15px;
  flex-shrink: 0;
}

.grd-reviewer-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.grd-reviewer-info {
  flex-grow: 1;
  min-width: 0;
}

.grd-reviewer-name {
  font-size: 1.3em!important;
  margin: 0 0 5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grd-reviewer-name a {
  color: inherit;
  text-decoration: none;
}

.grd-review-date {
  font-size: 0.8em;
  color: #666;
  display: block;
}

.grd-review-platform img {
  height: 20px;
  width: auto;
}

/* ============================================= */
/* REVIEW CONTENT & READ MORE */
/* ============================================= */
.grd-review-content {
  flex-grow: 1;
  line-height: 1.6;
  margin-bottom: 15px;
}

 .grd-review-text {
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  overflow: hidden;
}
.grd-review-text.collapsed {
  max-height: 8em; /* Altura aproximada para 3 líneas de texto */
  opacity: 0.9;
}
.grd-review-text:not(.collapsed) {
  max-height: 1000px; /* Valor suficientemente grande */
  opacity: 1;
}



.grd-review-text.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    
    pointer-events: none;
    border-radius: 0 0 var(--grd-border-radius, 8px) var(--grd-border-radius, 8px);
}

.grd-read-more-container {
  text-align: center;
  margin-top: 10px;
}

.grd-read-more-btn {
  display: inline-flex;
  align-items: center;
  background: var(--grd-button-bg-color, #4285F4);
  color: var(--grd-button-text-color, #fff) !important;
  border: none;
  padding: 8px 16px;
  border-radius: var(--grd-button-border-radius, 4px);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-top: 10px;
}

.grd-read-more-btn:hover {
  background: var(--grd-button-hover-color, #3367d6);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.grd-read-more-btn .material-icons {
  font-size: 18px;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.grd-read-more-btn[aria-expanded="true"] .material-icons {
  transform: rotate(360deg);
}

/* ============================================= */
/* CAROUSEL */
/* ============================================= */
.grd-carousel-wrapper {
  position: relative;
  margin: 0 -40px;
  padding: 0 40px;
}

.grd-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 20px;
  padding: 20px 0;
  scrollbar-width: none;
}

.grd-carousel::-webkit-scrollbar {
  display: none;
}

.grd-carousel .grd-review {
  flex: 0 0 calc(100% - 40px);
  scroll-snap-align: start;
  margin: 0 10px;
  box-sizing: border-box;
  min-width: 0;
}

.grd-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grd-button-bg-color, #4285F4);
  transition: all 0.3s ease;
  opacity: 0.9;
}

.grd-carousel-arrow:hover {
  background: var(--grd-button-bg-color, #4285F4);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
}

.grd-carousel-arrow svg {
  width: 24px;
  height: 24px;
}

.grd-carousel-prev {
  left: 0;
}

.grd-carousel-next {
  right: 0;
}

.grd-carousel-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.grd-carousel-arrow.disabled:hover {
  background: white !important;
  color: var(--grd-button-bg-color, #4285F4) !important;
}

/* ============================================= */
/* GALLERY */
/* ============================================= */
.grd-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
}

/* ============================================= */
/* LOAD MORE */
/* ============================================= */


.grd-hidden-review {
    opacity: 0;
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
    transform: translateY(-20px);
    display: none; /* Añadido para eliminar espacio */
    pointer-events: none; /* Evitar interacciones durante la animación */
}

/* Asegurar que las transiciones se mantengan */
.grd-review:not(.grd-hidden-review) {
    display: block;
    opacity: 1;
    max-height: none;
    transform: translateY(0);
}

.grd-load-more-container {
    text-align: center;
    margin-top: 20px;
}


.grd-load-more {
  transition: all 0.3s ease;
  background: var(--grd-button-bg-color, #4285F4);
  color: var(--grd-button-text-color, #fff);
  border: none;
  padding: 12px 25px;
  border-radius: var(--grd-button-border-radius, 4px);
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.grd-load-more:hover {
    background-color: #3367d6;
}

.grd-load-more[data-state="less"] {
    background-color: #f1f1f1;
    color: #333;
}

.grd-load-more[data-state="less"]:hover {
    background-color: #e0e0e0;
}

.grd-load-more-spinner {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.grd-load-more-spinner svg {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

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

/* Estado de carga */
.grd-load-more.loading {
    opacity: 0.7;
    pointer-events: none;
}

.grd-load-more.loading .grd-load-more-spinner {
    display: inline-block;
}


/* ============================================= */
/* BADGE CONTAINER */
/* ============================================= */

.grd-badge-container {
    display: inline-block;
    font-family: var(--grd-font-family, inherit);
}

.grd-badge-link {
    text-decoration: none;
    color: inherit;
}

.grd-badge {
    display: flex;
    align-items: center;
    background-color: var(--grd-card-bg);
    border-color: var(--grd-border-color);
    border-radius: var(--grd-border-radius, 8px);
    padding: 10px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    gap: 12px;
}

.grd-badge:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.15);
}

.grd-badge-icon {
    display: flex;
    align-items: center;
}

.grd-badge-content {
    display: flex;
    flex-direction: column;
    line-height: 0.8;
}

.grd-badge-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--grd-text-color);
}

.grd-badge-rating-stars {
    display: flex;
    align-items: center;
    gap: 4px;
}

.grd-badge-rating {
    font-size: 16px;
    font-weight: bold;
    color: #1a73e8;
}

.grd-badge-count {
    font-size: 11px;
    color: var(--grd-text-color);
}

.grd-star-rating {
    display: inline-flex;
    align-items: center;
}

.grd-star {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 1px;
    background-size: contain;
    background-repeat: no-repeat;
}

.grd-star-full {
    background-image: url('../images/full-star.svg');
}

.grd-star-half {
    background-image: url('../images/half-star.svg');
}

.grd-star-empty {
    background-image: url('../images/empty-star.svg');
}


/* ============================================= */
/* STAR RATING */
/* ============================================= */
.grd-star-rating {
  display: inline-block;
  margin: 10px 0;
  font-size: 0;
}

.grd-star {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
}

.grd-star-full {
  background-image: url('../images/full-star.svg');
}

.grd-star-half {
  background-image: url('../images/half-star.svg');
}

.grd-star-empty {
  background-image: url('../images/empty-star.svg');
}

/* ============================================= */
/* RESPONSIVE */
/* ============================================= */
@media (min-width: 1024px) {
  .grd-carousel .grd-review {
    flex: 0 0 calc(33.333% - 40px);
  }
  
  .grd-business-profile {
    padding: 20px 120px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grd-carousel .grd-review {
    flex: 0 0 calc(50% - 40px);
  }
  
  .grd-reviewer-avatar {
    width: 50px;
    height: 50px;
  }
  
  .grd-carousel-arrow {
    width: 45px;
    height: 45px;
  }
  
  .grd-business-profile {
    padding: 20px 60px;
  }
}

@media (max-width: 767px) {
  .grd-container {
    padding: 0px;
  }
  
  .grd-carousel-wrapper {
    padding: 0 20px;
    margin: 0 -20px;
  }
  
  .grd-carousel .grd-review {
    flex: 0 0 calc(100% - 40px);
  }
  
  .grd-review {
    padding: 20px;
  }
  
  .grd-reviewer-avatar {
    width: 45px;
    height: 45px;
  }
  
  .grd-carousel-arrow {
    width: 50px;
    height: 50px;
  }
  
  .grd-business-profile {
    padding: 20px;
  }
}

@media (min-width: 1400px) {
  .grd-container {
    max-width: 1400px;
  }
}

