/* ==========================================================================
   FabFunda - Sliding Right Cart Drawer Styles
   Theme Color: #01aa95 (Teal Green) & Clean Modern eCommerce Design
   ========================================================================== */

:root {
  --ff-theme-color: #01aa95;
  --ff-theme-hover: #008f7d;
  --ff-theme-light: #e6f7f5;
  --ff-theme-border: #bfebe5;
  --ff-text-dark: #1e293b;
  --ff-text-muted: #64748b;
  --ff-border-color: #f1ebd8;
  --ff-bg-warm: #faf8f5;
  --ff-card-bg: #ffffff;
}

/* Cart Drawer Backdrop Overlay */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.cart-drawer-open {
  overflow: hidden !important;
}

body.cart-drawer-open .cart-drawer-overlay {
  opacity: 1;
  visibility: visible;
}

/* Cart Drawer Main Panel */
.cart-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  background-color: var(--ff-bg-warm);
  z-index: 999999;
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
}

body.cart-drawer-open .cart-drawer-panel {
  transform: translateX(0);
}

#load-shopcart-data-get {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.cart-drawer-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  background-color: var(--ff-bg-warm);
}

/* Drawer Header */
.cart-drawer-header {
  height: 56px;
  min-height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--ff-border-color);
  padding: 0 16px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-shrink: 0;
  z-index: 5;
  box-sizing: border-box;
}

.cart-drawer-header-left {
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer;
  user-select: none;
  gap: 8px;
  color: var(--ff-theme-color);
  line-height: 1 !important;
}

.cart-drawer-header-left:hover {
  color: var(--ff-theme-hover);
}

.cart-drawer-back-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px;
  line-height: 1 !important;
  color: inherit;
  transition: transform 0.2s ease;
}

.cart-drawer-header-left:hover .cart-drawer-back-icon {
  transform: translateX(-2px);
}

.cart-drawer-back-icon i,
.cart-drawer-back-icon .fa {
  display: inline-block;
  vertical-align: middle;
  line-height: 1 !important;
}

.cart-drawer-title {
  font-size: 16.5px !important;
  font-weight: 700 !important;
  color: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  letter-spacing: 0.2px;
}

.cart-drawer-close-btn {
  background: none;
  border: none;
  outline: none;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1 !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px;
  width: 32px;
}

.cart-drawer-close-btn:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

/* Drawer Scrollable Content Area */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 140px 16px;
}

.cart-drawer-body::-webkit-scrollbar {
  width: 5px;
}
.cart-drawer-body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

/* Cart Product Item Card */
.cart-drawer-item {
  position: relative;
  background: var(--ff-card-bg);
  border: 1px solid var(--ff-border-color);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s ease;
}

.cart-drawer-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cart-drawer-item-img {
  width: 82px;
  height: 108px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f1f5f9;
  margin-right: 14px;
}

.cart-drawer-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-drawer-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 20px;
}

.cart-drawer-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-text-dark);
  line-height: 1.35;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.cart-drawer-item-name:hover {
  color: var(--ff-theme-color);
}

.cart-drawer-item-attrib {
  font-size: 12px;
  color: var(--ff-text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
}

.cart-drawer-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ff-text-dark);
  margin-bottom: 8px;
}

.cart-drawer-item-price .cur-sym {
  font-size: 15px;
  font-weight: 600;
}

/* Quantity Controls */
.cart-drawer-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  width: fit-content;
}

.cart-drawer-qty-btn {
  width: 28px;
  height: 28px;
  background: #f8fafc;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: bold;
  color: var(--ff-theme-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.cart-drawer-qty-btn:hover {
  background-color: var(--ff-theme-light);
  color: var(--ff-theme-hover);
}

.cart-drawer-qty-btn:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  background: #f8fafc;
}

.cart-drawer-qty-val {
  min-width: 34px;
  padding: 0 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ff-text-dark);
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  line-height: 28px;
  height: 28px;
}

.cart-drawer-item-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.cart-drawer-item-remove:hover {
  color: #ef4444;
}

/* Trust Badges Section */
.cart-drawer-trust {
  background: #ffffff;
  border: 1px dashed var(--ff-border-color);
  border-radius: 10px;
  padding: 12px 6px;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  text-align: center;
}

.cart-trust-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-trust-icon {
  font-size: 20px;
  color: var(--ff-theme-color);
  margin-bottom: 4px;
  line-height: 1;
}

.cart-trust-text {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  line-height: 1.25;
}

/* Price Breakdown Summary Box */
.cart-drawer-summary {
  background: #ffffff;
  border: 1px solid var(--ff-border-color);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--ff-text-muted);
  margin-bottom: 8px;
}

.cart-summary-row:last-child {
  margin-bottom: 0;
}

.cart-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--ff-text-dark);
  margin-bottom: 10px;
}

.cart-summary-divider {
  border: none;
  border-bottom: 1px dashed #dcd3c4;
  margin: 10px 0 12px 0;
}

.cart-summary-calc {
  font-size: 12px;
  font-weight: 600;
  color: var(--ff-text-dark);
}

/* Bottom Sticky Checkout Bar */
.cart-drawer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--ff-border-color);
  padding: 12px 18px 10px 18px;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.cart-footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-footer-amount-wrap {
  display: flex;
  flex-direction: column;
}

.cart-footer-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--ff-text-dark);
  line-height: 1.1;
  white-space: nowrap;
}

.cart-footer-view-details {
  font-size: 11px;
  color: #dc2626;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  margin-top: 2px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.cart-footer-view-details:hover {
  color: #b91c1c;
}

.cart-footer-btn-checkout {
  background-color: var(--ff-theme-color);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 30px;
  padding: 12px 26px;
  text-decoration: none !important;
  border: none;
  outline: none;
  display: inline-block;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 170, 149, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cart-footer-btn-checkout:hover {
  background-color: var(--ff-theme-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(1, 170, 149, 0.45);
}

.cart-footer-secure {
  font-size: 11px;
  color: var(--ff-text-muted);
  text-align: center;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cart-footer-secure i {
  color: #dc2626;
  font-size: 11px;
}

/* Empty Cart State */
.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  height: 100%;
}

.cart-drawer-empty-icon {
  width: 90px;
  height: 90px;
  background-color: var(--ff-theme-light);
  color: var(--ff-theme-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
}

.cart-drawer-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ff-text-dark);
  margin: 0 0 8px 0;
}

.cart-drawer-empty p {
  font-size: 13px;
  color: var(--ff-text-muted);
  margin: 0 0 24px 0;
  max-width: 280px;
  line-height: 1.4;
}

.cart-drawer-empty-btn {
  background-color: var(--ff-theme-color);
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 30px;
  padding: 11px 28px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(1, 170, 149, 0.25);
  cursor: pointer;
  border: none;
}

.cart-drawer-empty-btn:hover {
  background-color: var(--ff-theme-hover);
  transform: translateY(-1px);
}

/* Loading Spinner for AJAX updates */
.cart-drawer-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(1px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--ff-theme-color);
  border-radius: 50%;
  animation: cart-spin 0.8s linear infinite;
}

@keyframes cart-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .cart-drawer-panel {
    width: 100vw;
  }
  .cart-drawer-header {
    height: 54px;
    padding: 0 14px;
  }
  .cart-drawer-body {
    padding: 12px 12px 130px 12px;
  }
  .cart-footer-btn-checkout {
    padding: 11px 18px;
    font-size: 13px;
  }
}
