/* ===== SHOPPING CART STYLES ===== */

/* Logo Top Section */
.logo-top {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px;
}

.logo-container {
  flex-shrink: 0;
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 8px;
}

.language-selector .btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Language Flags */
.language-flags {
  display: flex;
  gap: 5px;
  align-items: center;
}

.flag-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flag-icon {
  width: 20px !important;
  height: 20px !important;
  object-fit: cover;
  border-radius: 2px;
}

.flag-btn:hover {
  transform: scale(1.05);
}

/* Cart Toggle Button */
#cartToggle {
  position: relative;
}

.cart-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  background: #f78da7;
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  margin-left: 4px;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  right: -450px;
  top: 0;
  width: 450px;
  height: 100vh;
  background: white;
  border-left: 1px solid var(--border);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fff, #ffe6e6);
}

.cart-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--accent);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--accent);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  opacity: 0.7;
}

/* Filter Dropdown Panel */
.filter-dropdown {
  position: relative;
  display: inline-block;
  overflow: visible;
}

header .actions {
  overflow: visible !important;
}

.filter-panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 380px;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.filter-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  display: block !important;
  background: #fff !important;
}

.filter-panel .filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 150px;
}

.cart-filter-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  text-align: left;
  white-space: nowrap;
}

.cart-filter-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cart-filter-btn.active {
  background: linear-gradient(135deg, #f78da7 0%, #f6c69f 100%);
  color: white;
  border: 2px solid #f78da7;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.empty-message {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 14px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--card);
}

.cart-item-image-container {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
}

.cart-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-image-placeholder {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
  word-break: break-word;
}

.cart-item-type {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cart-item-price {
  font-size: 12px;
  color: var(--text);
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.cart-item-price .unit-price {
  font-weight: 600;
  color: var(--accent);
}

.cart-item-price .item-total {
  color: var(--muted);
}

.cart-item-price .item-total strong {
  color: var(--text);
  font-weight: 700;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #999;
}

.qty-value {
  width: 30px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-remove:hover {
  opacity: 0.7;
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.cart-item-count {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: normal;
  margin-top: 4px;
}

.btn-block {
  width: 100%;
  margin-bottom: 8px;
}

.cart-footer-buttons {
  display: flex;
  flex-direction:row;
  gap: 8px;
}

.cart-footer-buttons .btn-block {
  flex: 1;
  margin-bottom: 0;
}

/* Floating Cart Bar */
.floating-cart-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #f87171);
  color: white;
  padding: 18px 36px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(247, 141, 167, 0.3);
  display: flex;
  align-items: center;
  align-content: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.floating-cart-bar.visible {
  opacity: 1;
  visibility: visible;
}

.floating-cart-bar:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 12px 32px rgba(247, 141, 167, 0.4);
}

.cart-info {
  font-weight: 600;
  font-size: 21px;
}

.btn-view-cart {
  background: white;
  color: var(--accent);
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  transition: all 0.2s;
}

.btn-view-cart:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

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

/* Add to Cart Button on Products */
.add-to-cart-btn {
  position: relative !important;
  width: auto;
  height: auto;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f78da7, #f6c69f);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s;
  opacity: 0;
  visibility: hidden;
  z-index: 10;
  box-shadow: 0 8px 22px rgba(247, 141, 167, 0.45);
}

/* Button Wrapper for Select and Remove */
.thumb-buttons-wrapper {
  position: absolute !important;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  transition: all 0.2s;
  align-items: center;
}

.thumb:hover .thumb-buttons-wrapper {
  opacity: 1;
  visibility: visible;
}

/* Add to Cart Button - Default State (Desktop) */
.add-to-cart-btn {
  opacity: 0;
  visibility: hidden;
}

.thumb:hover .add-to-cart-btn {
  opacity: 1;
  visibility: visible;
}

/* Selected Product - Always show Selected button */
.thumb.selected .add-to-cart-btn {
  opacity: 1;
  visibility: visible;
  background: linear-gradient(135deg, #f78da7, #f6c69f);
  color: #fff;
  cursor: not-allowed;
  border: none;
  box-shadow: 0 8px 22px rgba(247, 141, 167, 0.45);
}

/* Remove Button - Only show on selected and hover on desktop */
.remove-from-cart-btn {
  opacity: 0;
  visibility: hidden;
}

.thumb.selected:hover .remove-from-cart-btn {
  opacity: 1;
  visibility: visible;
}

/* Mobile & Tablet - Show both buttons always when selected */
@media (max-width: 992px) {
  /* Always show Select button on mobile/tablet */
  .add-to-cart-btn {
    opacity: 1;
    visibility: visible;
    font-size: 11px;
    padding: 8px 14px;
  }

  .thumb.selected .add-to-cart-btn {
    opacity: 1;
    visibility: visible;
  }

  .thumb.selected .remove-from-cart-btn {
    opacity: 1;
    visibility: visible;
  }
}

/* Selected Product Styling */
.thumb.selected {
  border: 2px solid transparent !important;
  background-image: linear-gradient(white, white), linear-gradient(135deg, #f78da7, #f46a8f) !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow: 0 4px 12px rgba(247, 141, 167, 0.3) !important;
}

.thumb:hover .add-to-cart-btn {
  opacity: 1;
  visibility: visible;
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #f78da7, #f6c69f);
  box-shadow: 0 8px 22px rgba(247, 141, 167, 0.45);
}

.add-to-cart-btn:active {
  transform: scale(0.95);
}

.add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Remove from Cart Button on Products */
.remove-from-cart-btn {
  position: relative !important;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  font-weight: 400;
  font-size: 12px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  margin: 0;
}

.remove-from-cart-btn:active {
  transform: scale(0.95);
}

.remove-from-cart-btn:active {
  transform: scale(0.95);
}

/* Download Button on Products */
.thumb-download {
  width: 34px;
  height: 34px;
}


.cart-footer-buttons .btn {
  flex: 1;
}

/* Clear Cart Button */
.btn-danger {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  background: white !important;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #fee2e2 !important;
  border-color: #b91c1c !important;
}

.btn-danger:active {
  background: #fecaca !important;
}

/* Quantity Input Modal */
.modal-qty {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-qty.open {
  opacity: 1;
  visibility: visible;
}

.modal-qty h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--text);
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qty-selector input {
  width: 60px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

.modal-qty .btn {
  width: 100%;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .floating-cart-bar {
    bottom: 10px;
    padding: 15px 24px;
    gap: 12px;
    justify-content: space-between;
  }

  .cart-info {
    font-size: 18px;
  }

  .btn-view-cart {
    font-size: 16px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .floating-cart-bar {
    width: 90%;
  }
}

/* Modal and order styles moved to quote.php */

