/* Global text selection prevention for shop pages */
*, *::before, *::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow interactions on buttons and form elements */
button, input, textarea, select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: auto !important;
}

a, a:visited, a:hover, span {
  text-decoration: none !important;
}

:root {
    --brown-bg: rgba(101,67,33,0.75);
    --white-bg: rgba(255,255,255,0.85);
    --primary-color: #5d4037;
    --accent-color: #ffcc80;
    --secondary-color: #8d6e63;
    --light-cream: #f7e7d3;
    --warm-beige: #e8dccf;
    --text-color: #333;
    --text-dark: #3b2a20;
    --text-brown: #654321;
    --gold-accent: #b8860b;
    --soft-shadow: rgba(101,67,33,0.12);
    --hover-shadow: rgba(101,67,33,0.25);
    --font-family: 'Poppins', sans-serif;
    --transition-speed: 0.4s;
    --border-radius: 16px;
    --gradient-primary: linear-gradient(135deg, #fff 0%, #f7e7d3 100%);
    --gradient-accent: linear-gradient(135deg, #ffcc80 0%, #ffe0b2 100%);
}

html, body { 
  height: 100%; 
  margin: 0; 
  padding: 0; 
  scroll-behavior: smooth;
}

body {
  display: flex; 
  flex-direction: column; 
  min-height: 100vh;
  font-family: var(--font-family); 
  color: var(--text-color);
  background: 
    linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)),
    url('../../Images/Background.png') no-repeat center/cover fixed;
  overflow-x: hidden;
}

main { 
  flex: 1 0 auto; 
  width: 100%; 
}

/* Enhanced scroll animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Modern shop section with enhanced design */
.shop-products {
  position: relative;
  background: var(--warm-beige);
  padding: 100px 0 80px;
  min-height: calc(100vh - 140px);
  overflow: hidden;
}

.shop-products::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 10%, rgba(255,204,128,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(139,110,99,0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Enhanced typography */
.products-heading {
  font-size: 3.2rem;
  text-align: center;
  color: var(--text-dark);
  margin: 0 0 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #3b2a20 0%, #654321 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(59,42,32,0.1);
}

.products-subheading {
  font-size: 1.3rem;
  text-align: center;
  color: var(--secondary-color);
  margin: 0 0 60px;
  font-weight: 400;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

/* Modern grid with enhanced spacing */
.product-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  margin-top: 40px;
}

/* Add Product Section - New Top Layout */
.add-product-section {
  background: linear-gradient(135deg, #fffbe9 0%, #fff9e1 100%);
  border: 2px solid rgba(184,134,11,0.3);
  border-radius: var(--border-radius);
  padding: 30px;
  margin: 40px 0;
  box-shadow: 0 8px 32px rgba(184,134,11,0.15);
}

.add-product-title {
  color: var(--text-brown);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 25px 0;
  text-align: center;
}

.add-product-container {
  max-width: 800px;
  margin: 0 auto;
}

.add-product-form-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.form-row.form-buttons {
  justify-content: center;
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-inputs {
  flex: 1;
  gap: 15px;
}

.add-image-placeholder-top {
  width: 150px;
  height: 150px;
  border: 3px dashed rgba(184,134,11,0.5);
  background: var(--light-cream);
  color: var(--secondary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  flex-shrink: 0;
}

.add-image-placeholder-top:hover {
  border-color: var(--gold-accent);
  background: #ffe7b8;
  transform: scale(1.02);
}

.add-product-input-top {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(184,134,11,0.2);
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255,255,255,0.8);
  transition: all 0.3s ease;
  font-family: var(--font-family);
}

.add-product-input-top:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.1);
  background: #fff;
}

.description-input {
  min-height: 100px;
  resize: vertical;
}

.btn-top {
  background: linear-gradient(135deg, var(--brown-bg) 0%, rgba(101,67,33,0.9) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(101,67,33,0.3);
  pointer-events: auto !important;
}

.btn-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(101,67,33,0.4);
}

.variations-btn {
  background: linear-gradient(135deg, #ffcc80 0%, #ffe0b2 100%) !important;
  color: var(--text-brown) !important;
}

.submit-btn {
  margin-left: 15px;
}

/* Remove old add-product-card styles since we moved it */
.add-product-card {
  display: none !important;
}

/* Transformed product cards with modern design */
.product-card:not(.add-product-card) {
  position: relative;
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
  padding: 30px 25px 35px;
  box-shadow: 
    0 10px 40px var(--soft-shadow),
    0 0 0 1px rgba(255,255,255,0.5) inset;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(10px);
}

.product-card:not(.add-product-card)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0.8;
}

.product-card:not(.add-product-card)::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,204,128,0.1) 0%, transparent 70%);
  transform: rotate(45deg);
  transition: transform 0.6s ease;
  z-index: 0;
}

.product-card:not(.add-product-card):hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 60px var(--hover-shadow),
    0 0 0 1px rgba(255,204,128,0.3) inset;
}

.product-card:not(.add-product-card):hover::after {
  transform: rotate(45deg) scale(1.2);
}

/* Modern product image styling */
.product-card:not(.add-product-card) .product-img-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto 25px;
  background: var(--light-cream);
  border-radius: 50%;
  border: 6px solid rgba(184,134,11,0.2);
  box-shadow: 
    0 8px 32px rgba(101,67,33,0.15),
    0 0 0 2px rgba(255,255,255,0.8) inset;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:not(.add-product-card):hover .product-img-placeholder {
  transform: scale(1.08) rotate(2deg);
  border-color: var(--gold-accent);
  box-shadow: 
    0 12px 48px rgba(101,67,33,0.25),
    0 0 0 2px rgba(184,134,11,0.3) inset;
}

/* Enhanced typography for product details */
.product-card:not(.add-product-card) .product-name {
  font-size: 1.4rem;
  color: var(--text-brown);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  min-height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  position: relative;
}

.product-card:not(.add-product-card) .product-price {
  font-size: 1.6rem;
  color: var(--gold-accent);
  margin: 0 0 20px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(184,134,11,0.1);
  z-index: 1;
  position: relative;
}

.product-card:not(.add-product-card) .product-price::before {
  content: '$';
  margin-right: 2px;
}

/* Enhanced description styling */
.product-desc {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transition: all 0.4s ease;
  max-height: 4.5em !important;
  position: relative;
  text-align: center;
  font-size: 1rem;
  padding: 0 10px;
  margin-bottom: 25px;
  line-height: 1.5;
  width: 100%;
  flex-grow: 1;
  color: var(--text-color);
  z-index: 1;
}

.product-desc.expanded {
  -webkit-line-clamp: unset !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal;
  margin-bottom: 30px;
  display: block !important;
}

.expand-hint {
  color: var(--secondary-color) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: all 0.3s ease !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto !important;
  z-index: 10;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.expand-hint:hover {
  color: var(--gold-accent) !important;
  transform: scale(1.05);
}

/* Modern button styling */
.product-card:not(.add-product-card) .product-btn {
  background: linear-gradient(135deg, var(--brown-bg) 0%, rgba(101,67,33,0.9) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 4px 16px rgba(101,67,33,0.3),
    0 0 0 1px rgba(255,255,255,0.1) inset;
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: 100%;
  max-width: 220px;
}

.product-card:not(.add-product-card) .product-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
  z-index: -1;
}

.product-card:not(.add-product-card) .product-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 8px 24px rgba(101,67,33,0.4),
    0 0 0 1px rgba(255,255,255,0.2) inset;
}

.product-card:not(.add-product-card) .product-btn:hover::before {
  left: 100%;
}

.product-btn:disabled {
  background: rgba(101,67,33,0.5);
  color: rgba(255,255,255,0.7);
  cursor: not-allowed;
  opacity: 0.7;
  transform: none !important;
}

/* Enhanced product card actions */
.product-card-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.edit-product-btn,
.delete-product-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(101,67,33,0.15);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-product-btn:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(101,67,33,0.25);
}

.delete-product-btn:hover {
  background: #ffebee;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(211,47,47,0.25);
}

.edit-product-btn i {
  color: var(--secondary-color);
}

.delete-product-btn i {
  color: #d32f2f;
}

/* Edit form styling */
.edit-product-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  position: relative;
}

.product-card:has(.edit-product-form) {
  background: linear-gradient(135deg, #fff9e1 0%, #fffbe9 100%);
  border: 2px solid rgba(184,134,11,0.3);
}

.product-card:has(.edit-product-form) .product-img-placeholder,
.edit-product-form .add-image-placeholder {
  width: 100px !important;
  height: 100px !important;
  border-radius: 12px !important;
  border: 2px dashed rgba(184,134,11,0.5) !important;
  margin: 10px auto 20px !important;
}

.edit-product-form .add-product-input {
  margin-bottom: 12px;
  width: 100%;
  max-width: 240px;
}

.edit-product-form .product-btn {
  padding: 10px 24px !important;
  margin: 8px !important;
  font-size: 0.95rem !important;
}

/* Success states */
.add-to-cart-btn.added {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  cursor: default;
  transform: scale(0.95);
}

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

/* Feedback animation */
@keyframes popInFeedback {
  0% { opacity: 0; transform: scale(0.8) translateY(8px); }
  80% { opacity: 1; transform: scale(1.1) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.add-to-cart-btn.added .feedback-text {
  display: inline-block;
  animation: popInFeedback 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Responsive design */
@media (max-width: 1200px) {
  .container {
    max-width: 1000px;
    padding: 0 30px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
  }
  
  .add-product-container {
    max-width: 700px;
  }
}

@media (max-width: 900px) {
  .products-heading {
    font-size: 2.8rem;
  }
  
  .products-subheading {
    font-size: 1.2rem;
    margin-bottom: 50px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
  }
  
  .product-card:not(.add-product-card) .product-img-placeholder {
    width: 160px;
    height: 160px;
  }
  
  /* Responsive form layout */
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-row.form-buttons {
    flex-direction: row;
    justify-content: center;
  }
  
  .add-image-placeholder-top {
    width: 120px;
    height: 120px;
    align-self: center;
  }
  
  .add-product-section {
    padding: 20px;
    margin: 30px 0;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }
  
  .shop-products {
    padding: 60px 0 50px;
  }
  
  .products-heading {
    font-size: 2.2rem;
  }
  
  .products-subheading {
    font-size: 1.1rem;
    margin-bottom: 40px;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .product-card:not(.add-product-card) {
    padding: 25px 20px 30px;
    min-height: 380px;
  }
  
  .product-card:not(.add-product-card) .product-img-placeholder {
    width: 140px;
    height: 140px;
  }
  
  .product-card:not(.add-product-card) .product-name {
    font-size: 1.2rem;
  }
  
  .product-card:not(.add-product-card) .product-price {
    font-size: 1.4rem;
  }
  
  .product-desc {
    font-size: 0.95rem;
    padding: 0 5px;
  }
  
  .product-card:not(.add-product-card) .product-btn {
    padding: 12px 24px;
    font-size: 1rem;
  }
  
  /* Mobile form layout */
  .add-product-section {
    padding: 15px;
    margin: 20px 0;
  }
  
  .add-product-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  .add-image-placeholder-top {
    width: 100px;
    height: 100px;
    font-size: 0.8rem;
  }
  
  .form-row.form-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn-top {
    width: 100%;
    max-width: 200px;
  }
  
  .submit-btn {
    margin-left: 0;
  }
}

/* Variations Modal Styles */
.variations-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}

.variations-modal-content {
  background: linear-gradient(135deg, #fffbe9 0%, #fff9e1 100%);
  margin: 15% auto;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  width: 85%;
  max-width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
  position: relative;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-variations-modal {
  color: #654321;
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 10px;
}

.close-variations-modal:hover {
  color: #000;
  transform: scale(1.1);
}

.variations-modal h3 {
  color: #654321;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.variations-container {
  margin: 15px 0;
}

.variation-input {
  margin-bottom: 12px;
}

.variation-field {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(184,134,11,0.2);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.8);
}

.variation-field:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 2px rgba(184,134,11,0.1);
  background: #fff;
}

.variations-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}

.variation-btn {
  background: linear-gradient(135deg, rgba(101,67,33,0.9) 0%, var(--brown-bg) 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 3px 8px rgba(101,67,33,0.3);
  flex: 1;
}

.variation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(101,67,33,0.4);
}

#add-more-variation {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

#add-more-variation:hover {
  background: linear-gradient(135deg, #3e8e41 0%, #4CAF50 100%);
}

/* Variations Banner */
.variations-banner {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.variations-banner i {
  font-size: 0.7rem;
}

/* Variations Selector */
.variations-selector {
  width: 100%;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
  position: relative;
}

.variation-label {
  font-size: 0.9rem;
  color: var(--text-brown);
  font-weight: 600;
  text-align: center;
}

.variation-dropdown {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(184,134,11,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.9);
  color: var(--text-brown);
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: all 0.3s ease;
  cursor: pointer;
}

.variation-dropdown:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.1);
  background: #fff;
}

.variation-dropdown:hover {
  border-color: var(--gold-accent);
}

/* Product cards with variations need more space */
.product-card:has(.variations-selector) {
  min-height: 480px;
}

/* Custom confirmation dialog styling (can't style native confirm, but this is for reference) */
.variation-warning {
  background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
  font-weight: 600;
  text-align: center;
}

#add-more-variation:hover {
  background: linear-gradient(135deg, #3e8e41 0%, #4CAF50 100%);
}

.add-variations-btn {
  transition: all 0.3s ease !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 10 !important;
}

.add-variations-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 15px rgba(255,204,128,0.4) !important;
}

/* Disable styling for buttons */
.variation-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.7;
}

/* Make sure the add product form allows button interactions */
.add-product-card form button {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Responsive styles for variations modal */
@media (max-width: 600px) {
  .variations-modal-content {
    width: 92%;
    max-width: 350px;
    padding: 15px;
    margin: 20% auto;
  }
  
  .variations-modal h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }
  
  .variation-field {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  
  .variation-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .variations-buttons {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .variations-modal-content {
    width: 95%;
    padding: 12px;
  }
  
  .close-variations-modal {
    font-size: 18px;
    right: 10px;
    top: 8px;
  }
}
  
  
  