/* Candles & Gifts Section Styles - Figma Design Match */

/* Main Container */
.candles-gifts-section {
  width: 100%;
  padding: 20px 0;
  margin: 20px 0;
}

/* Individual Row (Candles or Gifts) */
.cgs-row {
  margin-bottom: 30px;
}

.cgs-row:last-child {
  margin-bottom: 0;
}

/* Row Title */
.cgs-row-title {
  margin-bottom: 15px;
  padding: 0 10px;
}

.cgs-row-title h3 {
  font-size: 24px;
  font-weight: 700;
  color: #892a46;
  margin: 0;
  display: inline-block;
  font-family: "Poppins", sans-serif;
}

.cgs-count {
  font-size: 24px;
  font-weight: 400;
  color: #000;
  font-family: "Poppins", sans-serif;
}

/* Horizontal Scroll Container */
.candles-gifts-scroll-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 10px;
  cursor: grab;
  user-select: none;
}

.candles-gifts-scroll-container.active-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.candles-gifts-scroll-container.active-dragging * {
  pointer-events: none;
  user-select: none;
}

/* Hide scrollbar on all screens */
.candles-gifts-scroll-container::-webkit-scrollbar {
  display: none;
}

/* Items Container - Horizontal Layout */
.candles-gifts-items {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 10px 20px;
  min-width: min-content;
}

/* Individual Item Card - Figma Design */
.candle-gift-item {
  position: relative;
  flex: 0 0 auto;
  width: 310px;
  min-height: 426px;
  background: linear-gradient(
      28.35deg,
      rgba(244, 244, 244, 0.2),
      rgba(137, 42, 70, 0.2)
    ),
    #fbfbfb;
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0px 0px 15px 4px rgba(137, 42, 70, 0.1);
  overflow: hidden;
}

/* Card Front and Back */
.cgi-card-front,
.cgi-card-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cgi-card-hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.95);
}

/* Animation states */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOutToLeft {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }
}

@keyframes slideOutToRight {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
}

.cgi-card-back:not(.cgi-card-hidden) {
  animation: slideInFromRight 0.2s ease forwards;
}

.cgi-card-front:not(.cgi-card-hidden) {
  animation: slideInFromLeft 0.2s ease forwards;
}

.cgi-card-front.cgi-animating-out {
  animation: slideOutToLeft 0.2s ease forwards;
}

.cgi-card-back.cgi-animating-out {
  animation: slideOutToRight 0.2s ease forwards;
}

.candle-gift-item:hover {
  /* Hover effect removed */
}

/* Days Left Badge - Top Right Corner */
.cgi-days-badge {
  position: absolute;
  top: 16px;
  right: 10px;
  background: #892a46;
  color: #fbf8fb;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: auto;
  letter-spacing: 0;
  padding: 3px 8px;
  border-radius: 15px;
  border: 2px solid #892a46;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 3px 8px rgba(137, 42, 70, 0.4);
}

/* Image Wrapper */
.cgi-image-wrapper {
  width: 280px;
  height: 280px;
  display: block;
  background: transparent;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 15px;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid #892a46;
  padding: 0;
}

/* Product Image */
.cgi-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Remembered Label */
.cgi-remembered-label {
  font-size: 12px;
  font-weight: 500;
  color: #892a46;
  text-align: left;
  margin-bottom: 0;
  line-height: 1.2;
  width: 100%;
}

/* Sender Name */
.cgi-sender-name {
  font-size: 20px;
  font-weight: 500;
  color: #000;
  text-align: left;
  line-height: 1.2;
  min-height: 24px;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}

/* View Message Button */
.cgi-view-message-btn {
  width: 100%;
  position: relative;
  border-radius: 15px;
  background-color: #892a46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 15px;
  box-sizing: border-box;
  font-size: 20px;
  color: #fbfbfb;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  border: 2px solid #892a46;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
  flex-shrink: 0;
}

.cgi-view-message-btn:hover {
  background-color: #fbfbfb;
  color: #892a46;
  border: 2px solid #892a46;
}

.cgi-view-message-btn:active {
  background-color: #f0f0f0;
  color: #892a46;
  border: 2px solid #892a46;
}

/* Gift Item Specific Styling - Removed to match candles */
/* All gifts now use the same styling as candles */

/* Responsive Design */

/* Desktop - Larger Size */
@media (min-width: 1200px) {
  .candles-gifts-section {
    padding: 30px 0;
    margin: 30px 0;
  }

  .cgs-row {
    margin-bottom: 40px;
  }

  .cgs-row-title {
    margin-bottom: 15px;
    padding: 0 10px;
  }

  .cgs-row-title h3 {
    font-size: 28px;
  }

  .cgs-count {
    font-size: 28px;
  }

  .candles-gifts-items {
    gap: 24px;
    padding: 15px 10px;
  }

  /* Card styles inherit from base - no overrides needed */
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1199px) {
  /* Card styles inherit from base - keeping your design exactly */
}

/* Mobile - Match Figma mobile design */
@media (max-width: 768px) {
  .candles-gifts-section {
    padding: 15px 0;
    margin: 15px 0;
  }

  .cgs-row {
    margin-bottom: 25px;
  }

  .cgs-row-title {
    margin-bottom: 15px;
    padding: 0 10px;
  }

  .cgs-row-title h3 {
    font-size: 20px;
  }

  .cgs-count {
    font-size: 20px;
  }

  .candles-gifts-items {
    padding: 10px 15px;
    gap: 18px;
  }

  .candle-gift-item {
    width: 310px;
    height: 426px;
    padding: 0;
    border-radius: 15px;
  }

  .cgi-card-front {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
  }

  .cgi-card-back {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 15px !important;
    box-sizing: border-box;
  }

  /* Override hidden class for visible card back */
  .cgi-card-back:not(.cgi-card-hidden) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10 !important;
  }

  .cgi-card-back.cgi-card-hidden {
    display: none !important;
  }

  .cgi-days-badge {
    top: 30px;
    right: 30px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 15px;
    border: 2px solid #892a46;
  }

  .cgi-image-wrapper {
    width: 90.32%;
    height: 65.73%;
    border-radius: 15px;
    position: absolute;
    top: 3.52%;
    left: 4.84%;
    right: 4.84%;
    margin: 0;
    display: block;
    border: 2px solid #892a46;
    overflow: hidden;
    margin-bottom: 15px;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
  }

  .cgi-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .cgi-remembered-label {
    font-size: 12px;
    position: absolute;
    top: 73.94%;
    left: 4.84%;
    width: auto;
    text-align: left;
  }

  .cgi-sender-name {
    font-size: 20px;
    font-weight: 500;
    position: absolute;
    top: 78.17%;
    left: 4.84%;
    width: auto;
    text-align: left;
  }

  .cgi-view-message-btn {
    padding: 6px 15px;
    font-size: 20px;
    border-radius: 15px;
    position: absolute;
    height: 10.33%;
    width: 90.32%;
    top: 86.15%;
    left: 4.84%;
    right: 4.84%;
    margin: 0;
  }

  .cgi-card-back .cgi-remembered-label {
    position: static !important;
    width: 100%;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-sender-name {
    position: static !important;
    width: 100%;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-message-content {
    position: static !important;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-message-content p {
    font-size: 16px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.7);
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-back-btn {
    position: static !important;
    width: 100%;
    font-size: 20px;
    padding: 6px 15px;
    border-radius: 15px;
    margin: 0;
    margin-top: auto;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Small Mobile - Scaled down Figma design */
@media (max-width: 480px) {
  .cgs-row-title h3 {
    font-size: 18px;
  }

  .cgs-count {
    font-size: 18px;
  }

  .candles-gifts-items {
    gap: 15px;
  }

  .candle-gift-item {
    width: 280px;
    height: 385px;
    padding: 0;
    border-radius: 13px;
  }

  .cgi-card-front {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
  }

  .cgi-card-back {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 13px !important;
    box-sizing: border-box;
  }

  /* Override hidden class for visible card back */
  .cgi-card-back:not(.cgi-card-hidden) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10 !important;
  }

  .cgi-card-back.cgi-card-hidden {
    display: none !important;
  }

  .cgi-days-badge {
    font-size: 11px;
    padding: 4px 9px;
    top: 27px;
    right: 27px;
    border-radius: 13px;
    border: 2px solid #892a46;
  }

  .cgi-image-wrapper {
    width: 90.32%;
    height: 65.73%;
    border-radius: 13px;
    position: absolute;
    top: 3.52%;
    left: 4.84%;
    right: 4.84%;
    margin: 0;
    display: block;
    border: 2px solid #892a46;
    margin-bottom: 15px;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
  }

  .cgi-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .cgi-remembered-label {
    font-size: 11px;
    position: absolute;
    top: 73.94%;
    left: 4.84%;
    width: auto;
    text-align: left;
  }

  .cgi-sender-name {
    font-size: 18px;
    font-weight: 500;
    position: absolute;
    top: 78.17%;
    left: 4.84%;
    width: auto;
    text-align: left;
  }

  .cgi-view-message-btn {
    padding: 6px 13px;
    font-size: 18px;
    border-radius: 13px;
    position: absolute;
    height: 10.33%;
    width: 90.32%;
    top: 86.15%;
    left: 4.84%;
    right: 4.84%;
    margin: 0;
  }

  .cgi-card-back .cgi-remembered-label {
    position: static !important;
    width: 100%;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-sender-name {
    position: static !important;
    width: 100%;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-message-content {
    position: static !important;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-message-content p {
    font-size: 15px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.7);
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .cgi-card-back .cgi-back-btn {
    position: static !important;
    width: 100%;
    font-size: 18px;
    padding: 6px 13px;
    border-radius: 13px;
    margin: 0;
    margin-top: auto;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Message Card Back Styles */
.cgi-card-back {
  padding: 0;
  justify-content: flex-start;
}

.cgi-message-content {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding: 0;
  margin-top: 15px;
  margin-bottom: 15px;
  max-height: 220px;
}

.cgi-message-content p {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
  text-align: left;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Custom scrollbar for message content */
.cgi-message-content::-webkit-scrollbar {
  width: 4px;
}

.cgi-message-content::-webkit-scrollbar-track {
  background: #d5c4d0;
  border-radius: 10px;
}

.cgi-message-content::-webkit-scrollbar-thumb {
  background: #892a46;
  border-radius: 10px;
}

.cgi-message-content::-webkit-scrollbar-thumb:hover {
  background: #6f2238;
}

/* Back Button */
.cgi-back-btn {
  width: 100%;
  position: relative;
  border-radius: 15px;
  background-color: #892a46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 15px;
  box-sizing: border-box;
  font-size: 20px;
  color: #fbfbfb;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  border: 2px solid #892a46;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
  flex-shrink: 0;
}

.cgi-back-btn:hover {
  background-color: #fbfbfb;
  color: #892a46;
  border: 2px solid #892a46;
}

.cgi-back-btn:active {
  background-color: #f0f0f0;
  color: #892a46;
  border: 2px solid #892a46;
}

/* Gift back button now uses same styling as candles */

/* Empty State */
.candles-gifts-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

/* Loading State */
.candles-gifts-loading {
  text-align: center;
  padding: 40px 20px;
  color: #892a46;
}

.candles-gifts-loading::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}
