/* Breads Page Styles - mobile-first, smooth scroll */
.ws-breads-list {
  margin-top: 0;
  padding-top: 0;
  position: relative;
  z-index: 1;
  contain: layout style;
}

.ws-bread-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 40px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
  contain: layout style;
}

.ws-bread-section-title {
  font-family: var(--font-primary);
  font-size: 2.2rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 2px;
  grid-column: 1 / -1; /* Make title span full width */
}

.ws-bread-section-desc {
  text-align: center;
  color: var(--charcoal);
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  grid-column: 1 / -1; /* Make description span full width */
}

/* Bread Card Styles */
.ws-bread-card {
  display: flex;
  flex-direction: row;
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease, border-color 0.2s ease;
  border: 1px solid rgba(124, 92, 62, 0.1);
  height: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  max-height: 100px;
  padding: 16px 20px;
  z-index: 1;
  contain: layout style paint;
}

/* Expanded state - fixed max-height for smooth animation (no layout thrash) */
.ws-bread-card.expanded {
  max-height: 1200px;
  flex-direction: column;
  padding: 25px;
}

.ws-bread-card.expanded .ws-bread-img {
  width: 100%;
  height: 200px;
  margin-bottom: 20px;
  margin-right: 0;
  border-radius: 12px;
}

.ws-bread-card.expanded .ws-bread-info {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.ws-bread-card.expanded .ws-bread-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
  width: 100%;
}

.ws-bread-card.expanded .ws-bread-desc,
.ws-bread-card.expanded .ws-bread-options {
  display: block;
  opacity: 1;
  width: 100%;
}

/* Collapsed state */
.ws-bread-card.collapsed {
  max-height: 100px;
  flex-direction: row;
  padding: 16px 20px;
}

.ws-bread-card.collapsed .ws-bread-img {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
  margin-right: 16px;
  border-radius: 8px;
}

.ws-bread-card.collapsed .ws-bread-info {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.ws-bread-card.collapsed .ws-bread-title {
  font-size: 1.1rem;
  margin-bottom: 0;
  flex: 1;
}

.ws-bread-card.collapsed .ws-bread-desc,
.ws-bread-card.collapsed .ws-bread-options {
  display: none;
  opacity: 0;
}

.ws-bread-card.collapsed .ws-bread-option-select-wrapper {
  display: none;
}

/* Tablet and up - multi-column grid */
@media (min-width: 600px) {
  .ws-bread-section {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
    margin-top: 32px;
  }
  .ws-bread-card {
    max-height: 120px;
    padding: 20px 25px;
  }
  .ws-bread-card.collapsed {
    max-height: 120px;
    padding: 20px 25px;
  }
  .ws-bread-card .ws-bread-img {
    width: 80px;
    height: 80px;
    margin-right: 20px;
  }
  .ws-bread-card.collapsed .ws-bread-img {
    width: 80px;
    height: 80px;
    margin-right: 20px;
  }
  .ws-bread-card .ws-bread-title {
    font-size: 1.1rem;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .ws-bread-section {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    margin-top: 40px;
  }
}

.ws-bread-card .ws-bread-img {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
  margin-right: 16px;
  flex-shrink: 0;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, border-radius 0.3s ease;
  border-radius: 8px;
  object-fit: cover;
}

.ws-bread-card .ws-bread-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  transition: flex-direction 0.3s ease, align-items 0.3s ease;
  min-width: 0;
}

.ws-bread-card .ws-bread-title {
  font-size: 1rem;
  margin-bottom: 0;
  flex: 1;
  transition: font-size 0.3s ease, margin 0.3s ease;
  color: var(--primary-color);
  font-family: var(--font-primary);
  line-height: 1.3;
}

.ws-bread-card .ws-bread-desc,
.ws-bread-card .ws-bread-options {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Removed duplicate ::after pseudo-element - using .ws-bread-arrow element instead */

.ws-bread-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(44,38,33,0.12);
}

.ws-bread-card:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(44,38,33,0.15);
}

.ws-bread-card:focus .ws-bread-arrow {
  color: var(--accent-color);
}

/* Bread Options Styles */
.ws-bread-options {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(124, 92, 62, 0.1);
}

.ws-bread-option-section {
  margin-bottom: 15px;
}

.ws-bread-option-section:last-child {
  margin-bottom: 0;
}

.ws-bread-option-label {
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ws-bread-option-values {
  font-size: 0.9rem;
  color: var(--charcoal);
  line-height: 1.4;
  margin-bottom: 8px;
}

.ws-bread-option-select-wrapper {
  margin-top: 8px;
}

.ws-bread-option-select {
  width: 100%;
  max-width: 300px;
  padding: 8px 12px;
  border: 1px solid rgba(124, 92, 62, 0.2);
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  color: var(--charcoal);
  cursor: pointer;
  transition: border-color 0.3s ease;
  font-family: var(--font-secondary);
}

.ws-bread-option-select:hover {
  border-color: var(--primary-color);
}

.ws-bread-option-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(124, 92, 62, 0.1);
}

/* Responsive Design for Bread Cards */
@media (max-width: 768px) {
  .ws-bread-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px;
  }
  
  .ws-bread-card {
    max-height: 100px;
    padding: 15px 20px;
  }
  
  .ws-bread-card .ws-bread-img {
    width: 60px;
    height: 60px;
    margin-right: 15px;
  }
  
  .ws-bread-card .ws-bread-title {
    font-size: 1rem;
  }
  
  .ws-bread-arrow {
    right: 15px;
  }
  
  .ws-bread-arrow i {
    font-size: 1rem;
  }
  
  /* Mobile expanded state */
  .ws-bread-card.expanded {
    max-height: 1200px;
    padding: 20px;
  }
  
  .ws-bread-card.expanded .ws-bread-img {
    width: 100%;
    height: 150px;
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .ws-bread-card.expanded .ws-bread-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }
  
  .ws-bread-card.expanded .ws-bread-desc {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .ws-bread-section {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 12px;
  }
  
  .ws-bread-card {
    max-height: 90px;
    padding: 12px 15px;
  }
  
  .ws-bread-card .ws-bread-img {
    width: 50px;
    height: 50px;
    margin-right: 12px;
  }
  
  .ws-bread-card .ws-bread-title {
    font-size: 0.9rem;
  }
  
  .ws-bread-arrow {
    right: 12px;
  }
  
  .ws-bread-arrow i {
    font-size: 0.9rem;
  }
  
  /* Small mobile expanded state */
  .ws-bread-card.expanded {
    max-height: 1200px;
    padding: 15px;
  }
  
  .ws-bread-card.expanded .ws-bread-img {
    width: 100%;
    height: 120px;
    margin-right: 0;
    margin-bottom: 12px;
  }
  
  .ws-bread-card.expanded .ws-bread-title {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .ws-bread-card.expanded .ws-bread-desc {
    font-size: 0.85rem;
    line-height: 1.4;
  }
}

/* Ensure bread cards don't overlap with header */
.ws-bread-card {
  position: relative;
  z-index: 1;
}

/* Ensure breads list spacing (contain already set at top for scroll perf) */
.ws-breads-list {
  margin-top: 0;
  padding-top: 0;
}

/* Additional spacing fixes */
.ws-hero-small {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Ensure proper container spacing */
.ws-bread-section:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Dropdown Arrow Indicator */
.ws-bread-arrow {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: var(--primary-color);
  transition: transform 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.ws-bread-arrow i {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
  will-change: transform;
}

.ws-bread-card:hover .ws-bread-arrow {
  color: var(--accent-color);
}

.ws-bread-card.expanded .ws-bread-arrow i {
  transform: rotate(180deg);
}

.ws-bread-card.collapsed .ws-bread-arrow i {
  transform: rotate(0deg);
}

/* Bread Order Controls */
.ws-bread-order-controls {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(124, 92, 62, 0.1);
}

.ws-bread-order-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.ws-bread-quantity-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-bread-quantity-group label {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95rem;
  white-space: nowrap;
}

.ws-bread-quantity {
  padding: 10px 12px;
  border: 1px solid rgba(124, 92, 62, 0.2);
  border-radius: 6px;
  font-size: 0.95rem;
  width: 80px;
  text-align: center;
  font-family: var(--font-secondary);
}

.ws-bread-quantity:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(124, 92, 62, 0.1);
}

.ws-add-to-order-btn {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ws-add-to-order-btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 92, 62, 0.3);
}

.ws-add-to-order-btn:active {
  transform: translateY(0);
}

.ws-remove-from-order-btn {
  padding: 12px 24px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.ws-remove-from-order-btn:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.ws-remove-from-order-btn:active {
  transform: translateY(0);
}

/* Cart Badge in Navigation */
.ws-bread-cart-badge {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

#breadOrderNavLink {
  position: relative;
}

/* Responsive adjustments for order controls */
@media (max-width: 768px) {
  .ws-bread-order-form {
    gap: 10px;
  }
  
  .ws-bread-quantity-group {
    flex-wrap: wrap;
  }
  
  .ws-add-to-order-btn {
    width: 100%;
  }
  
  .ws-bread-option-select {
    max-width: 100%;
  }
}