/* Side Cart Wrapper */
.p21-side-cart {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  max-width: 90%;
  height: 100vh;
  background: #fff;
  z-index: 99999;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.p21-side-cart-open .p21-side-cart {
  right: 0;
}

/* Overlay */
.p21-side-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.p21-side-cart-open .p21-side-cart-overlay {
  display: block;
  opacity: 1;
}
span.p21-cart-icon {
  color: #fff;
}
/* Header */
.p21-side-cart-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
}

.p21-side-cart-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.p21-side-cart-close {
  font-size: 24px;
  text-decoration: none;
  line-height: 1;
  color: #333;
}

/* Content Area */
.p21-side-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* List Items */
.p21-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p21-cart-item {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f1f1;
  padding-bottom: 15px;
  position: relative;
  list-style: none !important;
}

.p21-item-thumbnail {
  width: 60px;
  height: 60px;
  margin-right: 15px;
}

.p21-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.p21-item-details {
  flex: 1;
  padding-right: 20px;
}

.p21-item-name {
  display: block;
  font-weight: 500;
  margin-bottom: 5px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
}

.p21-item-price {
  font-size: 13px;
  color: #777;
}

.p21-remove-item {
  position: absolute;
  top: 0;
  right: 0;
  color: #999;
  font-size: 18px;
  text-decoration: none;
}

.p21-remove-item:hover {
  color: #d00;
}

/* Footer & Buttons */
.p21-cart-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fff;
}

.p21-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: 600;
}

.p21-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p21-btn-cart,
.p21-btn-checkout {
  text-align: center;
  padding: 10px;
  display: block;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
}

.p21-btn-cart {
  background: #f1f1f1 !important;
  color: #333 !important;
}

.p21-btn-checkout {
  background: #333 !important;
  color: #fff !important;
}

.p21-btn-checkout:hover {
  background: #000;
}

/* Header Icon */
.p21-cart-icon-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.p21-cart-count {
  background: #d00;
  color: #fff;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -5px;
  font-weight: bold;
}
a.added_to_cart.wc-forward {
  border-radius: 0 !important;
  padding: 6px !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  border: none !important;
  width: 100% !important;
  text-decoration: none !important;
  display: block !important;
  text-align: center !important;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════════
   Low Stock Modal
   ═══════════════════════════════════════════════════════════════════ */

.p21-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.p21-modal-overlay.p21-modal-active {
  display: flex;
  opacity: 1;
}

.p21-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}

.p21-modal-overlay.p21-modal-active .p21-modal {
  transform: scale(1);
}

.p21-modal-header {
  background: #8d1a1d;
  color: #fff;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #761216;
}

.p21-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.p21-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.p21-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.p21-modal-body {
  padding: 25px;
  flex: 1;
  overflow-y: auto;
}

.p21-modal-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.p21-modal-body strong {
  color: #8d1a1d;
  font-weight: 600;
}

.p21-modal-body a {
  color: #8d1a1d;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #8d1a1d;
  transition: all 0.2s;
}

.p21-modal-body a:hover {
  color: #761216;
  border-bottom-color: #761216;
}

.p21-modal-footer {
  padding: 15px 25px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
  display: flex;
  justify-content: flex-end;
}

.p21-modal-btn {
  background: #8d1a1d;
  color: #fff;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s;
}

.p21-modal-btn:hover {
  background: #761216;
}

/* Confirm modal: secondary (Cancel) button */
.p21-modal-btn-secondary {
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
}
.p21-modal-btn-secondary:hover {
  background: #f5f5f5;
  border-color: #aaa;
}

/* Confirm modal: danger (Confirm) button */
.p21-modal-btn-danger {
  background: #8d1a1d;
  border: 1px solid #8d1a1d;
}
.p21-modal-btn-danger:hover {
  background: #761216;
  border-color: #761216;
}

/* Confirm modal close × button */
.p21-confirm-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 3px;
}
.p21-confirm-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Prevent body scroll when modal is open */
body.p21-modal-open {
  overflow: hidden;
}
