/**
 * MG Brand Carousel Styles
 *
 * @package MG_Brand_Carousel
 */

/* ==================== MAIN CONTAINER ==================== */

.mgbc-brand-carousel {
  position: relative;
  width: 100%;
}

/* ==================== TITLE ==================== */

.mgbc-title {
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

/* ==================== CATEGORY BUTTONS ==================== */

.mgbc-category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.mgbc-category-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.mgbc-category-btn:hover {
  background-color: #ffffff;
  color: #333;
  border-color: #333;
  font-weight: 600;
}

.mgbc-category-btn.active {
  background-color: #000;
  color: #fff;
  border-color: #000;
}

/* ==================== BRANDS CONTAINER ==================== */

.mgbc-brands-container {
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}

.mgbc-category-content {
  width: 100%;
}

.mgbc-category-content:not(.active) {
  display: none;
}

/* ==================== BRAND GRID ==================== */

.mgbc-brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Tablet: 2x2 grid */
@media (max-width: 1024px) {
  .mgbc-brand-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
  .mgbc-brand-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== BRAND CARD ==================== */

.mgbc-brand-card {
  display: block;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  padding: 20px;
  text-decoration: none;
  overflow: hidden;
}

/* Brand Image */
.mgbc-brand-image {
  width: 100%;
  height: 200px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #ffffff;
}

.mgbc-brand-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* 圖片 hover 放大效果 */
.mgbc-brand-card:hover .mgbc-brand-image img {
  transform: scale(1.1);
}

/* Brand Info */
.mgbc-brand-info {
  text-align: left;
}

.mgbc-brand-name {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  position: relative;
  display: inline-block;
}

/* 標題底線效果 */
.mgbc-brand-name::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #333;
  transition: width 0.6s ease;
}

.mgbc-brand-card:hover .mgbc-brand-name::after {
  width: 100%;
}

.mgbc-brand-location {
  margin: 0;
  font-size: 14px;
  color: #999;
}

/* ==================== SHOP ALL BUTTON ==================== */

.mgbc-shop-all-container {
  text-align: left;
}

.mgbc-shop-all-btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.mgbc-shop-all-btn:hover {
  background-color: #000;
  color: #fff;
}

/* ==================== ANIMATIONS ==================== */

/* Fade Animation */
.mgbc-category-content {
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Slide Animation Classes */
.mgbc-category-content.slide-out-left {
  animation: slideOutLeft 0.4s ease forwards;
}

.mgbc-category-content.slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade + Slide Animation Classes */
.mgbc-category-content.fade-slide-out {
  animation: fadeSlideOut 0.4s ease forwards;
}

.mgbc-category-content.fade-slide-in {
  animation: fadeSlideIn 0.4s ease forwards;
}

@keyframes fadeSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50px);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== DESCRIPTION MODE ==================== */

.mgbc-description-container {
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}

.mgbc-desc-content {
  width: 100%;
}

.mgbc-desc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Left side image */
.mgbc-desc-image {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.mgbc-desc-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right side content */
.mgbc-desc-content-wrapper {
  padding: 20px 0;
}

.mgbc-desc-quote {
  margin: 0 0 30px 0;
  padding: 0;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: #333;
  border: none;
}

.mgbc-desc-quote::before {
  content: '"';
}

.mgbc-desc-quote::after {
  content: '"';
}

.mgbc-desc-brand {
  margin-bottom: 10px;
}

.mgbc-desc-brand-link {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mgbc-desc-brand-link:hover {
  color: #000;
}

.mgbc-desc-brand-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.mgbc-desc-location {
  margin: 0 0 25px 0;
  font-size: 14px;
  color: #666;
}

.mgbc-desc-shop-btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.3s ease;
}

.mgbc-desc-shop-btn:hover {
  background-color: #000;
  color: #fff;
}

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

@media (max-width: 767px) {
  .mgbc-title {
    font-size: 24px;
  }

  .mgbc-category-buttons {
    gap: 8px;
  }

  .mgbc-category-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .mgbc-brand-card {
    padding: 15px;
  }

  .mgbc-brand-image {
    height: 150px;
  }

  .mgbc-shop-all-btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  /* Description Mode Mobile */
  .mgbc-desc-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mgbc-desc-quote {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .mgbc-desc-brand-link,
  .mgbc-desc-brand-name {
    font-size: 16px;
  }

  .mgbc-desc-location {
    margin-bottom: 20px;
  }

  .mgbc-desc-shop-btn {
    padding: 10px 24px;
    font-size: 13px;
  }
}
