/* ------------------------------------------------------------ */
/* General Giftwrapper button styles */
/* ------------------------------------------------------------ */
.giftwrapper-product-button,
.giftwrapper-cart-button {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.giftwrapper-product-button .add-icon,
.giftwrapper-cart-button .add-icon {
  font-size: 1.25rem;
}

/* ------------------------------------------------------------ */
/* Giftwrapper Product Page button styles */
/* ------------------------------------------------------------ */
.giftwrapper-product-button button:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ */
/* Giftwrapper Cart Page button styles */
/* ------------------------------------------------------------ */
.giftwrapper-cart-button button {
  display: flex;
  align-items: center;
  gap: 0.25rem; /* 4px */
  flex-wrap: nowrap;
  background-color: #f2f2f2;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.875rem; /* 14px */
  transition: all 0.3s ease-in-out;
}

.giftwrapper-cart-button button:hover,
.giftwrapper-cart-button button:focus-visible,
.giftwrapper-cart-button button:active {
  background-color: #e5e7eb;
}

.giftwrapper-cart-button .giftwrapper-remove-button {
  background-color: rgb(220 38 38); /* bg-red-600 */
  border-width: 2px;
  border-color: rgb(220 38 38); /* border-red-600 */
  color: rgb(255 255 255); /* text-white */
  margin-left: 0.5rem; /* 8px */
  font-size: 0.75rem; /* 12px */
  padding-block: 0.5rem;
  padding-inline: 1rem;
}

.giftwrapper-cart-button .giftwrapper-remove-button:hover,
.giftwrapper-cart-button .giftwrapper-remove-button:focus-visible,
.giftwrapper-cart-button .giftwrapper-remove-button:active {
  background-color: rgb(185 28 28); /* bg-red-700 */
  border-color: rgb(185 28 28); /* border-red-700 */
  color: rgb(255 255 255); /* text-white */
  text-decoration-line: none;
}

.giftwrapper-cart-button .giftwrapper-remove-button:disabled {
  background-color: rgb(107 114 128); /* bg-gray-500 */
  border-color: rgb(107 114 128); /* border-gray-500 */
  cursor: not-allowed;
}

.giftwrapper-cart-button .giftwrapper-count {
  background-color: black;
  color: white;
  border-radius: 0.75rem;
  padding-block: 0.125rem;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ------------------------------------------------------------ */
/* Giftwrapper Popup styles */
/* ------------------------------------------------------------ */
.giftwrapper-popup {
  background-color: rgb(255 255 255);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 1.5rem;
  animation: giftwrapper-popup-slide-in 0.3s ease-out;
}

@keyframes giftwrapper-popup-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Protect giftwrapper notices from cart fragment refreshes */
.giftwrapper-notices,
#giftwrapper-notices-wrapper {
  display: flex;
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 9999;
  pointer-events: auto;
}

/* ------------------------------------------------------------ */
/* Giftwrapper popup header styles */
/* ------------------------------------------------------------ */
.giftwrapper-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.giftwrapper-popup-header .giftwrapper-popup-title {
  margin: 0;
}

.giftwrapper-popup-header .giftwrapper-popup-close {
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  color: rgb(107 114 128);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition-property: all;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.giftwrapper-popup-header .giftwrapper-popup-close:hover {
  background-color: rgb(249 250 251);
  color: rgb(75 85 99);
}

.giftwrapper-popup-header .giftwrapper-popup-close:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.giftwrapper-popup-header .giftwrapper-popup-close:active {
  background-color: #e5e7eb;
}

/* ------------------------------------------------------------ */
/* Giftwrapper popup content styles */
/* ------------------------------------------------------------ */
.giftwrapper-popup-image {
  text-align: center;
  margin-bottom: 1.25rem; /* 20px */
}

.giftwrapper-popup-image img {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

.giftwrapper-popup-description {
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

/* Giftwrapper Options */
.giftwrapper-options {
  margin-bottom: 1.5rem;
}

.giftwrapper-option {
  cursor: pointer;
  transition-property: all;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.giftwrapper-options .giftwrapper-option-label:before {
  content: '\e835';
  color: black;
}

.giftwrapper-options .giftwrapper-option label {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin: 0;
  width: 100%;
}

.giftwrapper-options .giftwrapper-option input[type='checkbox'] {
  margin-right: 0.75rem;
}

.giftwrapper-options .giftwrapper-option-title {
  font-weight: 500;
  color: black;
  flex: 1 1 0%;
}

.giftwrapper-options .giftwrapper-option-price {
  font-weight: 500;
  color: black;
  font-size: 0.875rem;
}

/* Popup Footer */
.giftwrapper-options .giftwrapper-popup-footer {
  display: flex;
  width: 100%;
}

.giftwrapper-popup-submit {
  width: 100%;
  flex: 1 1 0%;
  padding-block: 0.75rem;
  padding-inline: 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition-property: all;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background-color: black;
  color: rgb(255 255 255); /* text-white */
  border: 2px solid black;
}

.giftwrapper-popup-submit:hover {
  background-color: transparent;
  color: black;
}

.giftwrapper-popup-submit:disabled {
  background-color: rgb(107 114 128); /* bg-gray-500 */
  border-color: rgb(107 114 128); /* border-gray-500 */
  cursor: not-allowed;
}

/* Ensure our notices stay visible even during cart updates */
.woocommerce-notices-wrapper.giftwrapper-notices,
.woocommerce-notices-wrapper#giftwrapper-notices-wrapper {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Protect individual notice messages */
.giftwrapper-notices .woocommerce-message,
.giftwrapper-notices .woocommerce-error,
.giftwrapper-notices .woocommerce-info {
  display: flex;
  align-items: center;
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 10000;
}

/* Giftwrapper Note Field Styles */
.giftwrapper-note-field {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: rgb(249 250 251);
  border-width: 1px;
  border-color: rgb(209 213 219);
  border-radius: 0.25rem;
  transition-property: all;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  border-left-width: 4px;
  border-left-color: black;
}

.giftwrapper-note-field textarea {
  width: 100%;
  min-height: 5rem; /* 80px */
  padding: 0.625rem; /* 10px */
  border-width: 1px;
  border-color: rgb(209 213 219); /* border-gray-300 */
  border-radius: 0.25rem; /* 4px */
  font-size: 0.875rem; /* 14px */
  resize: vertical;
  transition-property: color;
  transition-duration: 300ms;
}

.giftwrapper-note-field textarea:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: rgb(37 99 235); /* border-blue-600 */
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.giftwrapper-note-field textarea::placeholder {
  color: rgb(107 114 128); /* text-gray-500 */
  font-style: italic;
}

.giftwrapper-note-field .giftwrapper-note-counter {
  margin-top: 0.5rem; /* 8px */
  text-align: right;
  font-size: 0.75rem; /* 12px */
  color: rgb(107 114 128); /* text-gray-500 */
}

.giftwrapper-note-field .giftwrapper-note-characters {
  font-weight: 600;
  color: rgb(75 85 99); /* text-gray-600 */
}

/* Popup Overlay */
.giftwrapper-popup-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5); /* bg-black/50 */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem; /* 20px */
  box-sizing: border-box;
}

/* Messages */
.giftwrapper-message {
  position: fixed;
  top: 1.25rem; /* 20px */
  right: 1.25rem; /* 20px */
  padding: 1rem 1.5rem; /* 16px 24px */
  border-radius: 0.5rem; /* 8px */
  color: rgb(255 255 255); /* text-white */
  font-weight: 500;
  z-index: 10000;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
  animation: giftwrapper-message-slide-in 0.3s ease-out;
}

@keyframes giftwrapper-message-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.giftwrapper-message-success {
  background-color: rgb(22 163 74); /* bg-green-600 */
}

.giftwrapper-message-error {
  background-color: rgb(220 38 38); /* bg-red-600 */
}

/* Body class when popup is open */
body.giftwrapper-popup-open {
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .giftwrapper-popup {
    margin: 1.25rem; /* 20px */
    max-width: none;
    max-height: calc(100vh - 40px);
  }

  .giftwrapper-popup-header,
  .giftwrapper-popup-content,
  .giftwrapper-popup-footer {
    padding: 1rem; /* 16px */
  }

  .giftwrapper-popup-title {
    font-size: 1.125rem; /* 18px */
  }

  .giftwrapper-option {
    padding: 0.75rem; /* 12px */
  }

  .giftwrapper-popup-footer {
    flex-direction: column;
  }

  .giftwrapper-message {
    top: 0.625rem; /* 10px */
    right: 0.625rem; /* 10px */
    left: 0.625rem; /* 10px */
    text-align: center;
  }
}

@media (max-width: 480px) {
  .giftwrapper-popup-overlay {
    padding: 0.625rem; /* 10px */
  }

  .giftwrapper-popup {
    margin: 0.625rem; /* 10px */
    max-height: calc(100vh - 20px);
  }

  .giftwrapper-option label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem; /* 8px */
  }

  .giftwrapper-option-price {
    align-self: flex-end;
  }
}

/* ------------------------------------------------------------ */
/* Giftwrapper tooltip styles */
/* ------------------------------------------------------------ */
.giftwrapper-tooltip,
.giftwrapper-tooltip-order-detail{
  margin-bottom: 0;
}

/* ------------------------------------------------------------ */
/* Giftwrapper order details styles */
/* ------------------------------------------------------------ */

.woocommerce-order-received .giftwrapper-order-section {
  color: #ffffff;
  margin-top: 24px;
}
.giftwrapper-order-section {
  color: #4b4b4b; 
  border: 0;
  vertical-align: middle; 
  text-align: left; 
  border-bottom: 1px solid rgba(0,0,0,.2); 
  margin-bottom: 24px; 
  padding-bottom: 24px; 
  padding-top: 0px; 
  padding-left: 0; 
  padding-right: 0;
}

.giftwrapper-order-section h4 {
  font-weight: normal;
}

.giftwrapper-order-section-item {
  background-color: #ffffff;
  padding: 1rem;
  color: #4b4b4b;
}

.giftwrapper-order-section-item h5 {
  font-weight: normal;
}

.giftwrapper-order-section-options {
  margin-bottom: 1rem;
}

.woocommerce-table--order-details tr.bundled_table_item.no_line_subtotal td.woocommerce-table__product-total.product-total{
  visibility: visible !important;
}