/* Cafe Item Detail Popup Styles */

/* Prevent body scroll when popup is open */
body.cafe-popup-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Overlay */
.cafe-item-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cafe-item-detail-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cafe-item-detail-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

/* Popup Container */
.cafe-item-detail-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.08);
  max-height: 85vh;
  overflow: hidden;
}

.cafe-item-detail-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1) !important;
}

.cafe-item-detail-popup.hiding {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
}

/* Popup Content */
.cafe-item-detail-popup-content {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 42px 18px 22px 18px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Custom scrollbar for content area */
.cafe-item-detail-popup-content::-webkit-scrollbar {
  width: 6px;
}

.cafe-item-detail-popup-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}

.cafe-item-detail-popup-content::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 3px;
}

.cafe-item-detail-popup-content::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Hide scrollbar arrows/buttons completely */
.cafe-item-detail-popup-content::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

.cafe-item-detail-popup-content::-webkit-scrollbar-button:start:decrement,
.cafe-item-detail-popup-content::-webkit-scrollbar-button:end:increment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.cafe-item-detail-popup-content::-webkit-scrollbar-corner {
  display: none !important;
}

/* Firefox scrollbar */
.cafe-item-detail-popup-content {
  scrollbar-width: thin;
  scrollbar-color: #d9d9d9 transparent;
}

/* Close Button */
.cafe-item-detail-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #000;
  cursor: pointer;
  z-index: 1020;
  transition: color 0.2s;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cafe-item-detail-close:hover {
  color: #0097a7;
}

.cafe-item-detail-close svg {
  width: 24px;
  height: 24px;
}

/* Content Container */
#cafe-item-detail-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Item Header Row (Image + Name/Price Column) */
.cafe-item-detail-header {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
  padding: 0 24px;
}

/* Item Image Container */
.cafe-item-detail-image-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 248px;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

/* Item Image */
.cafe-item-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Item Info Column (Name + Price + Button) */
.cafe-item-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  gap: 12px;
}

/* Item Name */
.cafe-item-detail-name {
  font-size: 30px;
  font-weight: 500;
  color: #242a2e;
  margin: 0;
  text-align: left;
  font-family: "Geologica", sans-serif;
  padding: 0;
  width: 100%;
}

/* Item Price */
.cafe-item-detail-price {
  font-size: 24px;
  font-weight: 500;
  color: #242a2e;
  margin: 0;
  text-align: left;
  padding: 0;
  width: 100%;
}

/* Item Description */
.cafe-item-detail-description {
  font-size: 16px;
  line-height: 24px;
  color: #242A2E;
  margin-bottom: 24px;
  text-align: justify;
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

.cafe-item-detail-description p {
  margin-bottom: 12px;
}

.cafe-item-detail-description:last-child {
  margin-bottom: 0;
}

/* Add to Cart Button Container */
.cafe-item-detail-add-to-cart {
  margin-top: 0;
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding: 0;
}

.cafe-item-detail-add-to-cart button {
  background: #ffc013;
  border-radius: 30px;
  padding: 12px 32px;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 16px;
  text-transform: capitalize;
  border: 1px solid #ffc013;
  color: #242a2e;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cafe-item-detail-add-to-cart button:hover {
  background: #fff;
  color: #ffc013;
}

.cafe-item-detail-add-to-cart button:disabled {
  background: #d9d9d9;
  border-color: #d9d9d9;
  color: #666;
  cursor: not-allowed;
}

.cafe-item-detail-add-to-cart button.selected {
  background: #055d62;
  border-color: #055d62;
  color: #fff;
}

/* Align SVG checkmark vertically centered in button */
.cafe-item-detail-add-to-cart button svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.cafe-item-detail-add-to-cart button.selected:hover {
  background: #044a4e;
}

/* Tablet and Laptop Responsive */
@media (min-width: 768px) and (max-width: 1024px) {
  .cafe-item-detail-popup {
    max-width: 680px;
  }

  .cafe-item-detail-image-wrapper {
    background: transparent;
    width: 280px;
    height: 280px;
  }
}

/* Laptop and Desktop Large */
@media (min-width: 1025px) and (max-width: 1440px) {
  .cafe-item-detail-popup {
    max-width: 730px;
  }

  .cafe-item-detail-image-wrapper {
    width: 280px;
    height: 280px;
  }
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .cafe-item-detail-popup {
    max-width: 92%;
    max-height: 84vh;
  }

  .cafe-item-detail-popup-content {
    padding: 50px 16px 20px 16px;
  }

  .cafe-item-detail-close {
    top: 12px;
    right: 16px;
  }

  .cafe-item-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 16px;
  }

  .cafe-item-detail-image-wrapper {
    width: 100%;
    max-width: 300px;
    height: 280px;
    margin: 0 auto;
    background: transparent;
  }

  .cafe-item-detail-info {
    width: 100%;
  }

  .cafe-item-detail-name {
    font-size: 24px;
    text-align: left;
  }

  .cafe-item-detail-price {
    font-size: 20px;
    text-align: left;
  }

  .cafe-item-detail-description {
    font-size: 14px;
    padding: 0 16px;
    text-align: justify;
  }
}

