/* Hide on desktop */
.cpc-mobile-only {
  display: none !important;
}


/* === Cart Popup Overlay === */
#cpcCartPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  align-items: flex-start;   /* Keep popup anchored to the top */
  justify-content: center;   /* Center horizontally */
  padding-top: 10vh;          /* Add top margin */
  padding-bottom: 2vh;       /* Optional: bottom breathing room */
}


#cpcCartPopup.open {
  display: flex;
}

/* === Inner Layout === */
.cpc-cart-inner {
  background-color: #2a313c;
  color: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 880px;
  width: 92%;
  max-height: 86vh; /* ✅ Allow shrinkage */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden; /* No scroll on outer box */
}
.cpc-cart-inner h2 {
  font-size: 24px;
  margin: 0;
  text-align: center;
}
/* Ensure cart items area takes up space even when empty */
#cpcCartItems {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 1rem;
  min-height: 300px; /* Optional: ensures some vertical space */
}

/* === Cart Close Button (Popup ❌) === */
.cpc-cart-close {
  position: absolute;
  top: 0px;
  right: 0px;
  background: transparent !important;
  border: none;
  font-size: 35px;
  color: #aaa;
  cursor: pointer;
  z-index: 100;
  transition: color 0.3s ease;
}

.cpc-cart-close:hover,
.cpc-cart-close:focus {
  background: transparent !important;
  color: black !important;
  outline: none !important;
}

/* === Character Name Input === */
.cpc-char-name {
  display: inline-block;
  width: 100%;
  margin-top: 1rem;
}

.cpc-char-name .char-bar {
  background-color: #000;
  color: #d4af37;
  border: 1px solid #333;
  padding: 1.2rem 1.25rem;
  font-size: 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: border 0.3s ease;
}

.cpc-char-name .char-bar:hover,
.cpc-char-name .char-bar:focus-within {
  border-color: #d4af37 !important;
}

.cpc-char-name .char-icon {
  margin-right: 8px;
  font-size: 1.2rem;
  color: #d4af37;
  flex-shrink: 0;
}

.cpc-char-name input {
  flex: 1;
  background-color: #000 !important; /* Force black */
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #d4af37 !important; /* Gold text */
  font-size: 1rem;
  padding: 0;
}

.cpc-char-name input::placeholder {
  color: #d4af37;
  opacity: 0.6;
}



/* === Cart Items Grid === */
.cpc-cart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* === Cart Card === */
#cpcCartPopup .cpc-card {
  background: #2d3550;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  min-height: 200px;
  max-height: 280px;
}
/* === Image Section (Reverted) === */
/* === Image Section (Centered & Scaled Responsively) === */
#cpcCartPopup .cpc-img-wrapper {
  margin-top: 3rem !important;
  margin-bottom: 0.5rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.5rem;
}

#cpcCartPopup .cpc-card-img {
  max-width: 70px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.7s ease;
}

#cpcCartPopup .cpc-img-wrapper:hover .cpc-card-img {
  transform: scale(1.1);
}


/* Title & Price */
#cpcCartPopup .cpc-title {
  font-size: 16px !important;
  text-align: left !important;
  color: #FCB900 !important;
  margin-bottom: 1rem !important; /* Space between title and price */
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#cpcCartPopup .cpc-price {
  font-size: 14px !important;
  text-align: left !important;
  color: #ffffff !important;

}



/* === Quantity Controls === */
#cpcCartPopup .cpc-card .cpc-qty-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

#cpcCartPopup .cpc-btn {
  background: transparent;
  border: none;
  color: #FCB900;
  font-size: 22px;
  padding: 0;
  width: 30px;
  height: 30px;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s;
}

#cpcCartPopup .cpc-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#cpcCartPopup .cpc-qty-input {
  width: 40px;
  height: 30px;
  text-align: center;
  background: #2A303C;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

#cpcCartPopup .cpc-qty-input::-webkit-outer-spin-button,
#cpcCartPopup .cpc-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* === Remove Button (❌) for Cart Cards — All Devices === */
#cpcCartPopup .cpc-remove-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 10 !important;
  font-size: 30px !important;
  color: #aaa !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: color 0.3s ease, background 0.3s ease !important;
}

#cpcCartPopup .cpc-remove-btn:hover,
#cpcCartPopup .cpc-remove-btn:focus {
  background: transparent !important;
  color: black !important;
  outline: none !important;
}

/* === Total Price === */

.cpc-cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  color: #fcb900;
  padding: 0.5rem 0;
  border-top: 1px solid #444;
  margin-top: auto;
}

/* === Checkout and Continue Shopping === */
.cpc-cart-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

/* Shared styles */
.cpc-cart-footer button {
  flex: 1;
  height: 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* space between text and icon if any */
  padding: 0 16px;
  line-height: 1;
}

/* Right Button - Checkout */
.cpc-checkout-btn {
  background-color: #fcb900;
  color: black;
  border: none;
}

.cpc-checkout-btn:hover {
  background-color: #fcb900;
  color: black; /* prevent turning white */
  transform: translateY(-3px);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}




/* === Cart Icon (Bottom Left) === */
.cpc-cart-icon {
  position: fixed;
  left: 20px;
  bottom: 20px;
  background-color: #2d3550;
  border: 2px solid transparent;
  color: #fff;
  padding: 10px 14px;
  border-radius: 50px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  z-index: 1000;
  transition: all 0.3s ease;
}

.cpc-cart-icon.show {
  border-color: red;
  visibility: visible;
  opacity: 1;
}

.cpc-cart-icon.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* === Cart Count Badge === */
.cpc-cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: red;
  color: white;
  font-size: 12px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #2d3550;
  transform: translate(50%, -50%);
}

/* === Fly-to-Cart Animation === */
.cpc-fly-clone {
  position: fixed;
  z-index: 9999;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.8s ease-in-out;
  pointer-events: none;
  opacity: 1;
}

/* === Bounce Scale Effect === */
@keyframes bounceScale {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.cpc-cart-icon.bounce {
  animation: bounceScale 0.6s ease;
}

/* === Scrollbar Styling === */
/* === Scrollbar Styling for Cart Popup === */
#cpcCartPopup .cpc-cart-inner::-webkit-scrollbar {
  width: 0.4vw;
  background: #293445;
}

#cpcCartPopup .cpc-cart-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(transparent, #FCB900);
  border-radius: 10px;
}

#cpcCartPopup .cpc-cart-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(transparent, #FDD25C);
}


/* Sticky footer section inside cart popup */
.cpc-cart-bottom {
  border-top: 1px solid #444;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #2a313c;
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding-bottom: 0.5rem;
}
/* === Compact Cart Cards === */
#cpcCartPopup .cpc-card {
  min-height: 180px;
  max-height: 220px;
  padding: 0.75rem;
}

/* Quantity Controls */
#cpcCartPopup .cpc-card .cpc-qty-controls {
  top: 6px;
  left: 6px;
}

#cpcCartPopup .cpc-btn {
  font-size: 18px;
  width: 26px;
  height: 26px;
}

#cpcCartPopup .cpc-qty-input {
  width: 34px;
  height: 26px;
  font-size: 14px;
}

/* Product Title */
#cpcCartPopup .cpc-title {
  font-size: 14px !important;
  margin-bottom: 0.5rem !important;
}

/* Product Price */
#cpcCartPopup .cpc-price {
  font-size: 13px !important;
}

/* Remove Button */
#cpcCartPopup .cpc-remove-btn {
  font-size: 24px !important;
  top: 6px !important;
  right: 6px !important;
}

/* === Compact Cart Cards === */
#cpcCartPopup .cpc-card {
  min-height: 180px;
  max-height: 220px;
  padding: 0.75rem;
}

/* Quantity Controls */
#cpcCartPopup .cpc-card .cpc-qty-controls {
  top: 6px;
  left: 6px;
}

#cpcCartPopup .cpc-btn {
  font-size: 18px;
  width: 26px;
  height: 26px;
}

#cpcCartPopup .cpc-qty-input {
  width: 34px;
  height: 26px;
  font-size: 14px;
}

/* Product Title */
#cpcCartPopup .cpc-title {
  font-size: 14px !important;
  margin-bottom: 0.5rem !important;
}

/* Product Price */
#cpcCartPopup .cpc-price {
  font-size: 13px !important;
}

/* Remove Button */
#cpcCartPopup .cpc-remove-btn {
  font-size: 24px !important;
  top: 6px !important;
  right: 6px !important;
}
/* === Animate Cart Removal === */
@keyframes cpcFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }/* Cleaned and compact CSS for cart popup with full-width checkout button */

/* === Cart Popup Overlay === */
#cpcCartPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  padding-bottom: 2vh;
}

#cpcCartPopup.open {
  display: flex;
}

.cpc-cart-inner {
  background-color: #2a313c;
  color: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 880px;
  width: 92%;
  max-height: 86vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.cpc-cart-inner h2 {
  font-size: 24px;
  margin: 0;
  text-align: center;
}

#cpcCartItems {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 1rem;
  min-height: 300px;
}

.cpc-cart-close {
  position: absolute;
  top: 0px;
  right: 0px;
  background: transparent !important;
  border: none;
  font-size: 35px;
  color: #aaa;
  cursor: pointer;
  z-index: 100;
  transition: color 0.3s ease;
}

.cpc-cart-close:hover,
.cpc-cart-close:focus {
  color: black !important;
  outline: none !important;
}

.cpc-char-name {
  display: inline-block;
  width: 100%;
  margin-top: 1rem;
}

.cpc-char-name .char-bar {
  background-color: #000;
  color: #d4af37;
  border: 1px solid #333;
  padding: 1.2rem 1.25rem;
  font-size: 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: border 0.3s ease;
}

.cpc-char-name .char-bar:hover,
.cpc-char-name .char-bar:focus-within {
  border-color: #d4af37 !important;
}

.cpc-char-name .char-icon {
  margin-right: 8px;
  font-size: 1.2rem;
  color: #d4af37;
  flex-shrink: 0;
}

.cpc-char-name input {
  flex: 1;
  background-color: #000 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #d4af37 !important;
  font-size: 1rem;
  padding: 0;
}

.cpc-char-name input::placeholder {
  color: #d4af37;
  opacity: 0.6;
}

.cpc-cart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

#cpcCartPopup .cpc-card {
  background: #2d3550;
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  min-height: 180px;
  max-height: 220px;
}

#cpcCartPopup .cpc-title {
  font-size: 14px !important;
  text-align: left !important;
  color: #FCB900 !important;
  margin-bottom: 0.5rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#cpcCartPopup .cpc-price {
  font-size: 13px !important;
  text-align: left !important;
  color: #ffffff !important;
}

#cpcCartPopup .cpc-qty-controls {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

#cpcCartPopup .cpc-btn {
  background: transparent;
  border: none;
  color: #FCB900;
  font-size: 18px;
  padding: 0;
  width: 26px;
  height: 26px;
  cursor: pointer;
  transition: color 0.2s;
}

#cpcCartPopup .cpc-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#cpcCartPopup .cpc-qty-input {
  width: 34px;
  height: 26px;
  background: #2A303C;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

#cpcCartPopup .cpc-remove-btn {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  font-size: 24px !important;
  background: transparent !important;
  color: #aaa !important;
  border: none !important;
  cursor: pointer !important;
}

#cpcCartPopup .cpc-remove-btn:hover,
#cpcCartPopup .cpc-remove-btn:focus {
  color: black !important;
}

.cpc-cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  color: #fcb900;
  padding: 0.5rem 0;
  border-top: 1px solid #444;
  margin-top: auto;
}

.cpc-cart-footer {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.cpc-cart-footer button {
  width: 100%;
  height: 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fcb900;
  color: black;
  border: none;
  transition: all 0.3s ease;
}

.cpc-cart-footer button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

.cpc-card.removing {
  animation: cpcFadeOut 300ms ease forwards;
}

/* === Popup Close Animation === */
.cpc-cart-inner.closing {
  animation: cpcClosePopup 300ms ease forwards;
}

@keyframes cpcClosePopup {
  0% {
    opacity: 1;
    transform: translateY(0px);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}

/* === Responsive === */
/* Reduce card width to fit more per row */
/* Tablets: 4 cards */
@media (min-width: 769px) and (max-width: 1024px) {
  .cpc-cart-grid {
    justify-content: center;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 0.5rem;
  }

  #cpcCartPopup .cpc-card {
    max-width: 170px;
    min-width: 160px;
    width: 100%;
  }
}

/* Laptops & Desktops: 5 cards */
@media (min-width: 1025px) {
  .cpc-cart-grid {
    justify-content: center;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  #cpcCartPopup .cpc-card {
    max-width: 160px;
    min-width: 140px;
    width: 100%;
  }
}



@media (max-width: 480px) {

  .cpc-cart-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  #cpcCartPopup .cpc-card {
    width: 100%;
    height: 100px;
  }

  #cpcCartPopup .cpc-card .cpc-qty-controls {
    position: absolute;
    top: 8px;
    left: 8px;
    margin: 0;
    justify-content: flex-start;
    z-index: 5;
  }

  #cpcCartPopup .cpc-btn {
    display: none !important;
  }

  #cpcCartPopup .cpc-qty-input {
    font-size: 14px;
    width: 36px;
    height: 26px;
    border-radius: 4px;
    padding: 2px;
    background-color: #1f2937;
    border: 1px solid #4b5563;
    color: #fff;
  }
  #cpcCartPopup .cpc-img-wrapper {
    margin-top: 2.8rem !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
    height: 60px !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  #cpcCartPopup .cpc-card-img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
  }
  #cpcCartPopup .cpc-title {
    font-size: 10px !important;
    margin-bottom: 4px !important;
    text-align: left !important;
  }

  #cpcCartPopup .cpc-price {
    font-size: 11px !important;
    text-align: left !important;
    margin-top: 2px !important;
  }
}
@media (max-width: 480px) {
  .cpc-cart-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cpc-cart-footer button {
    font-size: 14px;
    padding: 0.6rem 1rem;
    width: 100%;
    max-width: 100%;
    font-family: Arial, sans-serif;
    letter-spacing: normal;
    justify-content: center;
  }

  .cpc-checkout-btn {
    background-color: #fcb900;
    color: black;
  }

  .cpc-continue-btn {
    background-color: transparent;
    border: 1px solid #fcb900;
    color: #fcb900;
  }

  .cpc-continue-btn:hover {
    background-color: #fcb900;
    color: black;
  }
  #cpcCartItems {
    margin-bottom: 0 !important;
  }
  .cpc-cart-inner {
    gap: 0.5rem !important;
  }
  .cpc-mobile-only {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 14px;
    padding: 0.6rem 1rem;
    background-color: transparent;
    border: 1px solid #fcb900;
    color: #fcb900;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    letter-spacing: normal;
  }

  .cpc-mobile-only:hover {
    background-color: #fcb900;
    color: black;
  }
}


