/* ========================================
   Bakery Details
   Uses the existing Firozkala design system
======================================== */

.bakery-details-page {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.bakery-profile-card,
.bakery-products-section,
.bakery-reviews-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  box-shadow:
    -5px -5px 12px var(--shadow-light),
    5px 5px 12px rgba(218, 213, 206, 0.42);
}

.bakery-profile-card {
  overflow: hidden;
}

.bakery-profile-cover {
  position: relative;
  height: 15rem;
  overflow: visible;
}

.bakery-profile-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.75rem 1.75rem 0 0;
}

.bakery-profile-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(31, 37, 51, 0.22), transparent);
  pointer-events: none;
}

.bakery-profile-logo {
  position: absolute;
  right: 1.5rem;
  bottom: -2.8rem;
  z-index: 2;

  width: 6.25rem;
  height: 6.25rem;
  padding: .28rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.55rem;

  box-shadow:
    -4px -4px 10px rgba(255, 255, 255, .92),
    4px 4px 10px rgba(218, 213, 206, .42);
}

.bakery-profile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.25rem;
}

.bakery-profile-open {
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  z-index: 2;

  display: inline-flex;
  align-items: center;
  gap: .35rem;

  padding: .45rem .8rem;

  color: #fff;
  background: var(--secondary);

  border-radius: 999px;

  font-size: .75rem;
  font-weight: 800;
}

.bakery-profile-open::before {
  content: "";
  width: .45rem;
  height: .45rem;
  background: currentColor;
  border-radius: 50%;
}

.bakery-profile-content {
  padding: 3.75rem 1.5rem 1.5rem;
}

.bakery-profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bakery-profile-name-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.bakery-profile-name-row h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 900;
}

.bakery-profile-heading > div > p {
  margin-top: .35rem;
  color: var(--text-secondary);
  font-size: .78rem;
}

.bakery-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;

  min-height: 2.8rem;
  padding: .65rem 1rem;

  color: var(--primary);
  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 1rem;

  box-shadow:
    -3px -3px 8px rgba(255, 255, 255, .92),
    3px 3px 8px rgba(218, 213, 206, .34);

  font-size: .78rem;
  font-weight: 800;

  transition: transform .2s ease, box-shadow .2s ease;
}

.bakery-info-button:hover {
  transform: translateY(-1px);
}

.bakery-info-button:active {
  transform: translateY(0);
  box-shadow:
    inset -2px -2px 5px rgba(255, 255, 255, .85),
    inset 2px 2px 5px rgba(218, 213, 206, .26);
}

.bakery-info-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.bakery-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;

  margin-top: 1.4rem;
}

.bakery-profile-stats > div {
  display: flex;
  align-items: center;
  gap: .65rem;

  min-width: 0;
  padding: .8rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.05rem;

  box-shadow:
    -2px -2px 7px rgba(255, 255, 255, .9),
    2px 2px 7px rgba(218, 213, 206, .26);
}

.bakery-profile-stats svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  color: var(--primary);
}

.bakery-profile-stats > div:first-child svg {
  color: #facc15;
}

.bakery-profile-stats span {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bakery-profile-stats strong {
  color: var(--text-primary);
  font-size: .78rem;
  font-weight: 900;
}

.bakery-profile-stats small,
.bakery-profile-stats p {
  color: var(--text-muted);
  font-size: .66rem;
  line-height: 1.6;
}

.bakery-profile-stats p {
  margin-right: auto;
}

.bakery-profile-actions {
  display: flex;
  align-items: stretch;
  gap: .75rem;
  margin-top: 1rem;
}

.bakery-main-action,
.bakery-subscription-action {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 3rem;
  border-radius: 1rem;

  font-size: .78rem;
  font-weight: 900;

  transition: transform .2s ease;
}

.bakery-main-action {
  gap: .4rem;
  flex: 1;

  color: #fff;
  background: var(--primary);
}

.bakery-main-action:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.bakery-main-action svg {
  width: 1rem;
  height: 1rem;
  transform: rotate(90deg);
}

.bakery-subscription-action {
  flex-direction: column;
  min-width: 12rem;
  padding: .5rem 1rem;

  color: #fff;
  background: var(--secondary);
}

.bakery-subscription-action span {
  font-size: .67rem;
  opacity: .9;
}

.bakery-subscription-action strong {
  font-size: .76rem;
}

.bakery-products-section,
.bakery-reviews-preview {
  margin-top: 1.25rem;
  padding: 1.25rem;
}

.bakery-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.bakery-section-header > div > span {
  color: var(--primary);
  font-size: .7rem;
  font-weight: 800;
}

.bakery-section-header h2 {
  margin-top: .15rem;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 900;
}

.bakery-section-header p {
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .72rem;
}

.bakery-products-count {
  flex: 0 0 auto;
  padding: .4rem .7rem;

  color: var(--secondary);
  background: rgba(31, 157, 85, .08);

  border: 1px solid rgba(31, 157, 85, .14);
  border-radius: 999px;

  font-size: .68rem;
  font-weight: 800;
}

.bakery-category-pills {
  display: flex;
  align-items: center;
  gap: .5rem;
  overflow-x: auto;

  margin-top: 1rem;
  padding: .15rem .05rem .4rem;

  scrollbar-width: none;
}

.bakery-category-pills::-webkit-scrollbar {
  display: none;
}

.bakery-category-pills button {
  flex: 0 0 auto;
  padding: .5rem .9rem;

  color: var(--text-secondary);
  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 999px;

  font-size: .7rem;
  font-weight: 800;

  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, .86),
    2px 2px 6px rgba(218, 213, 206, .22);
}

.bakery-category-pills button.active {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
  box-shadow: none;
}

.bakery-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;

  margin-top: 1rem;
}

.bakery-products-grid .small-card {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.bakery-products-grid .small-card:hover {
  transform: translateY(-2px);
}

.bakery-reviews-preview {
  margin-bottom: 1rem;
}

.bakery-all-reviews {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
}

.bakery-review-summary {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  gap: .8rem;
  margin-top: 1rem;
}

.bakery-review-score,
.bakery-review-summary article {
  padding: 1rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;

  box-shadow:
    -2px -2px 7px rgba(255, 255, 255, .88),
    2px 2px 7px rgba(218, 213, 206, .24);
}

.bakery-review-score {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.bakery-review-score > strong {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 900;
}

.bakery-review-score span {
  display: flex;
  gap: .1rem;
  color: #facc15;
}

.bakery-review-score svg {
  width: .9rem;
  height: .9rem;
}

.bakery-review-score p {
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .65rem;
}

.bakery-review-summary article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.bakery-review-summary article strong {
  color: var(--text-primary);
  font-size: .76rem;
}

.bakery-review-summary article span {
  color: var(--secondary);
  font-size: .62rem;
  font-weight: 800;
}

.bakery-review-summary article p {
  margin-top: .65rem;
  color: var(--text-secondary);
  font-size: .7rem;
  line-height: 1.9;
}


/* ========================================
   Information modal
======================================== */

.bakery-info-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1rem;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity .25s ease, visibility .25s ease;
}

.bakery-info-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bakery-info-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  background: rgba(31, 37, 51, .38);
  border: 0;

  backdrop-filter: blur(4px);
}

.bakery-info-panel {
  position: relative;
  z-index: 1;

  width: min(36rem, 100%);
  max-height: min(42rem, calc(100dvh - 2rem));
  overflow-y: auto;

  padding: 1.2rem;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 1.6rem;

  box-shadow:
    -8px -8px 24px rgba(255, 255, 255, .35),
    12px 12px 30px rgba(31, 37, 51, .18);

  transform: translateY(1rem) scale(.985);
  transition: transform .25s ease;
}

.bakery-info-modal.is-open .bakery-info-panel {
  transform: translateY(0) scale(1);
}

.bakery-info-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bakery-info-panel-header > div > span {
  color: var(--primary);
  font-size: .66rem;
  font-weight: 800;
}

.bakery-info-panel-header h2 {
  display: flex;
  align-items: center;
  gap: .35rem;

  margin-top: .15rem;

  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 900;
}

.bakery-info-close {
  width: 2.4rem;
  height: 2.4rem;

  color: var(--text-secondary);
  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 50%;

  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, .9),
    2px 2px 6px rgba(218, 213, 206, .28);

  font-size: 1.25rem;
  line-height: 1;
}

.bakery-info-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;

  margin-top: 1rem;
  padding: .85rem;

  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.bakery-info-rating > div {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.bakery-info-rating strong {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 900;
}

.bakery-info-rating span {
  display: flex;
  gap: .08rem;
  color: #facc15;
}

.bakery-info-rating svg {
  width: .85rem;
  height: .85rem;
}

.bakery-info-rating p {
  color: var(--text-muted);
  font-size: .68rem;
}

.bakery-info-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-top: .85rem;
}

.bakery-info-list > div {
  display: flex;
  align-items: flex-start;
  gap: .75rem;

  padding: .8rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;

  box-shadow:
    -2px -2px 6px rgba(255, 255, 255, .86),
    2px 2px 6px rgba(218, 213, 206, .2);
}

.bakery-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;

  color: var(--primary);
  background: rgba(242, 147, 24, .08);

  border-radius: .8rem;
}

.bakery-info-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.bakery-info-list strong {
  color: var(--text-primary);
  font-size: .73rem;
}

.bakery-info-list p {
  margin-top: .18rem;
  color: var(--text-secondary);
  font-size: .68rem;
  line-height: 1.8;
}

.bakery-info-reviews {
  margin-top: 1rem;
}

.bakery-info-reviews-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;

  padding-bottom: .6rem;
}

.bakery-info-reviews-title h3 {
  color: var(--text-primary);
  font-size: .95rem;
  font-weight: 900;
}

.bakery-info-reviews-title span {
  color: var(--text-muted);
  font-size: .66rem;
}

.bakery-info-reviews article {
  padding: .75rem 0;
  border-top: 1px solid var(--border);
}

.bakery-info-reviews article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.bakery-info-reviews article strong {
  color: var(--text-primary);
  font-size: .72rem;
}

.bakery-info-reviews article span {
  color: var(--secondary);
  font-size: .68rem;
  font-weight: 800;
}

.bakery-info-reviews article p {
  margin-top: .4rem;
  color: var(--text-secondary);
  font-size: .68rem;
  line-height: 1.9;
}


/* ========================================
   Responsive
======================================== */

@media screen and (max-width: 1100px) {
  .bakery-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bakery-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bakery-review-summary {
    grid-template-columns: 1fr 1fr;
  }

  .bakery-review-score {
    grid-column: 1 / -1;
  }
}

@media screen and (max-width: 767px) {
  .bakery-details-page {
    padding-top: 5.1rem;
    padding-right: .75rem;
    padding-left: .75rem;
  }

  .bakery-profile-card,
  .bakery-products-section,
  .bakery-reviews-preview {
    border-radius: 1.35rem;
  }

  .bakery-profile-cover {
    height: 10.5rem;
  }

  .bakery-profile-cover > img {
    border-radius: 1.35rem 1.35rem 0 0;
  }

  .bakery-profile-logo {
    right: .9rem;
    bottom: -2.2rem;

    width: 4.8rem;
    height: 4.8rem;

    border-radius: 1.15rem;
  }

  .bakery-profile-logo img {
    border-radius: .9rem;
  }

  .bakery-profile-open {
    top: .75rem;
    left: .75rem;
    padding: .38rem .65rem;
    font-size: .66rem;
  }

  .bakery-profile-content {
    padding: 3rem .9rem .9rem;
  }

  .bakery-profile-heading {
    flex-direction: column;
  }

  .bakery-profile-name-row h1 {
    font-size: 1.12rem;
  }

  .bakery-info-button {
    width: 100%;
  }

  .bakery-profile-stats {
    gap: .5rem;
  }

  .bakery-profile-stats > div {
    padding: .65rem;
  }

  .bakery-profile-stats p {
    display: none;
  }

  .bakery-profile-actions {
    flex-direction: column;
  }

  .bakery-subscription-action {
    min-width: 0;
  }

  .bakery-products-section,
  .bakery-reviews-preview {
    padding: .85rem;
  }

  .bakery-section-header {
    align-items: flex-start;
  }

  .bakery-section-header h2 {
    font-size: 1rem;
  }

  .bakery-section-header p {
    line-height: 1.8;
  }

  .bakery-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .bakery-review-summary {
    grid-template-columns: 1fr;
  }

  .bakery-review-score {
    grid-column: auto;
  }

  .bakery-info-modal {
    align-items: flex-end;
    padding: 0;
  }

  .bakery-info-panel {
    width: 100%;
    max-height: 88dvh;

    padding: 1rem;

    border-radius: 1.45rem 1.45rem 0 0;

    transform: translateY(100%);
  }

  .bakery-info-modal.is-open .bakery-info-panel {
    transform: translateY(0);
  }
}

@media screen and (max-width: 390px) {
  .bakery-details-page {
    padding-right: .55rem;
    padding-left: .55rem;
  }

  .bakery-profile-cover {
    height: 9.4rem;
  }

  .bakery-profile-content {
    padding-right: .7rem;
    padding-left: .7rem;
  }

  .bakery-profile-stats > div {
    gap: .45rem;
    padding: .55rem;
  }

  .bakery-profile-stats svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .bakery-profile-stats strong {
    font-size: .69rem;
  }

  .bakery-profile-stats small {
    font-size: .58rem;
  }

  .bakery-products-grid {
    gap: .48rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bakery-info-modal,
  .bakery-info-panel,
  .bakery-info-button,
  .bakery-main-action,
  .bakery-products-grid .small-card {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* Bakery mobile stability patch */
@media screen and (max-width:767px){
 .bakery-details-page,
 .bakery-profile-card,
 .bakery-products-section,
 .bakery-products-grid,
 .bakery-profile-heading,
 .bakery-profile-stats{
   max-width:100%;
   overflow-x:hidden;
 }
 .bakery-profile-stats > div,
 .bakery-profile-heading > *,
 .bakery-products-grid .small-card{
   min-width:0;
 }
 .bakery-products-grid{
   grid-template-columns:repeat(2,minmax(0,1fr)) !important;
 }
}
@media screen and (max-width:360px){
 .bakery-products-grid{
   grid-template-columns:1fr !important;
 }
}

/* ========================================
   Bakery Details Mobile Product Grid Fix
   Only responsive dimensions - no design changes
======================================== */

.bakery-details-page,
.bakery-details-page * {
  box-sizing: border-box;
}

@media screen and (max-width: 767px) {

  .bakery-details-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .bakery-products-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .bakery-products-grid {
    width: 100%;
    max-width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
  }

  .bakery-products-grid .small-card,
  .bakery-products-grid .swiper-slide.small-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;

    overflow: hidden !important;
  }

  .bakery-products-grid .small-card img,
  .bakery-products-grid .small-card_img {
    max-width: 100% !important;
  }

  .bakery-products-grid .small-card_link {
    display: block;
    max-width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bakery-products-grid .small-card_price,
  .bakery-products-grid .product-card_price-wrapper {
    width: 100% !important;
    min-width: 0 !important;
  }

  .bakery-products-grid .small-card_price > div,
  .bakery-products-grid .small-card_price > h4 {
    min-width: 0 !important;
  }

  .bakery-products-grid .small-card button,
  .bakery-products-grid .small-card a {
    max-width: 100%;
  }
}

@media screen and (max-width: 390px) {

  .bakery-products-grid {
    gap: .45rem !important;
  }

  .bakery-products-grid .small-card {
    padding-inline: .45rem !important;
  }

  .bakery-products-grid .small-card_link {
    font-size: .72rem !important;
  }

}

@media screen and (max-width: 340px) {

  .bakery-products-grid {
    grid-template-columns: 1fr !important;
  }

}

/* ========================================
   Bakery Details Requested Adjustments
   Scoped only to bakery-details page
======================================== */

/* Move the page card slightly upward */
.bakery-details-page {
  padding-top: .55rem !important;
}

/* First bakery card: keep only details button visible */
.bakery-profile-content {
  padding-top: 1rem;
}

.bakery-profile-heading {
  justify-content: flex-end;
}

.bakery-profile-heading > div,
.bakery-profile-stats,
.bakery-profile-actions .bakery-main-action,
.bakery-profile-actions .bakery-subscription-action {
  display: none;
}

.bakery-profile-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.bakery-info-button {
  width: auto;
}


/* Discount product */
.bakery-product-card {
  position: relative;
}

.bakery-discount-label {
  position: absolute;
  top: .55rem;
  right: .55rem;
  z-index: 3;

  padding: .28rem .55rem;

  color: #fff;
  background: #ef4444;

  border-radius: 999px;

  font-size: .62rem;
  font-weight: 900;

  box-shadow: 0 5px 12px rgba(239,68,68,.18);
}

.bakery-discount-tab {
  color: #ef4444 !important;
}


/* Product cards compact only on bakery page */
.bakery-products-grid .small-card {
  min-height: 0 !important;
}

.bakery-products-grid .small-card_img {
  aspect-ratio: 1 / .9;
  object-fit: cover;
}

.bakery-products-grid .small-card_link {
  margin-top: .35rem;
}

@media screen and (max-width:767px) {
  .bakery-details-page {
    padding-top: .45rem !important;
    padding-right: .65rem !important;
    padding-left: .65rem !important;
  }

  .bakery-profile-card {
    width: 100%;
    overflow: hidden;
  }

  .bakery-profile-content {
    padding: .75rem !important;
  }

  .bakery-profile-actions {
    width: 100%;
    justify-content: center;
  }

  .bakery-info-button {
    width: 100%;
  }

  .bakery-products-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: .5rem !important;
  }

  .bakery-products-grid .small-card {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .bakery-products-grid .small-card_img {
    height: auto !important;
    max-height: 120px;
  }
}

@media screen and (max-width:360px) {
  .bakery-products-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ========================================
   Bakery Product Cards - minimal scoped fixes
======================================== */

/* only bakery page products */
.bakery-products-grid .product-card-top {
  position: relative;
  min-height: 2rem;
  justify-content: flex-end !important;
}

.bakery-products-grid .product-heart {
  position: absolute;
  top: 0;
  right: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 2rem;
  height: 2rem;

  z-index: 2;

  background: var(--fk-surface, #EEF1F4);
  border-radius: 50%;
}

.bakery-products-grid .bakery-discount-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: fit-content;

  margin-bottom: .25rem;
  padding: .25rem .6rem;

  color: #fff;
  background: #dc2626;

  border-radius: 999px;

  font-size: .62rem;
  font-weight: 900;
}

.bakery-products-grid .small-card_price > h4 {
  width: 100%;
  text-align: center;
}

.bakery-products-grid .small-card_price > h4 strong {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .25rem;

  color: var(--fk-primary, #F59E0B);
}

/* keep card compact only here */
.bakery-products-grid .small-card {
  min-width: 0;
}

.bakery-products-grid .small-card_link {
  text-align: center;
}

@media screen and (max-width: 767px) {
  .bakery-products-grid .small-card {
    overflow: hidden;
  }

  .bakery-products-grid .product-heart {
    width: 1.85rem;
    height: 1.85rem;
  }
}

@media screen and (max-width: 360px) {
  .bakery-products-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   Bakery Products — unified cards V16
   Scope: bakery-details / products section only
======================================== */

.bakery-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  width: 100%;
}

.bakery-products-grid .bakery-product-card {
  position: relative;
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: .62rem !important;
  overflow: hidden !important;
}

.bakery-products-grid .bakery-product-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / .78;
  overflow: hidden;
  border-radius: 1rem;
}

.bakery-products-grid .small-card_img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center;
  border-radius: inherit;
}

.bakery-products-grid .bakery-product-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: .5rem .12rem .08rem;
}

.bakery-products-grid .small-card_link {
  display: -webkit-box;
  width: 100%;
  min-width: 0;
  min-height: 2.7rem;
  margin: 0 !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-primary, #1f2937);
  font-size: .78rem !important;
  font-weight: 800;
  line-height: 1.7 !important;
  text-align: right !important;
}

.bakery-products-grid .product-card_price-wrapper {
  width: 100%;
  min-width: 0;
  margin-top: .3rem;
}

.bakery-products-grid .small-card_price {
  display: block !important;
  width: 100%;
  min-width: 0;
}

.bakery-products-grid .small-card_price > h4 {
  width: 100% !important;
  margin: 0;
  text-align: right !important;
}

.bakery-products-grid .small-card_price > h4 strong {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: .22rem !important;
  width: 100%;
  color: var(--fk-primary, var(--primary, #F29318));
  font-size: .88rem;
  font-weight: 900;
  white-space: nowrap;
}

.bakery-products-grid .bakery-product-currency {
  color: var(--text-muted, #8b929d);
  font-size: .58rem;
  font-weight: 700;
}

.bakery-products-grid .bakery-product-add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.35rem;
  margin-top: auto;
  padding: .48rem .4rem;
  color: #fff;
  background: var(--fk-primary, var(--primary, #F29318));
  border: 0;
  border-radius: .8rem;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  transition: transform .18s ease, filter .18s ease;
}

.bakery-products-grid .bakery-product-add-button:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
}

.bakery-products-grid .bakery-product-add-button:active {
  transform: translateY(0);
}

/* CheckoutStore may inject a subscription badge; hide it only in this product grid
   so the cards keep exactly the requested content. */
.bakery-products-grid .fk-subscription-mini-badge {
  display: none !important;
}

/* Only the first card differs: discount label on the left. */
.bakery-products-grid .bakery-product-discounted .bakery-discount-label {
  position: absolute !important;
  top: .55rem !important;
  left: .55rem !important;
  right: auto !important;
  z-index: 4;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin: 0 !important;
  padding: .28rem .58rem !important;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(220, 38, 38, .18);
}

/* Laptop */
@media screen and (max-width: 1279px) {
  .bakery-products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
  }

  .bakery-products-grid .bakery-product-card {
    padding: .56rem !important;
  }
}

/* Tablet */
@media screen and (max-width: 1023px) {
  .bakery-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .65rem !important;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .bakery-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .52rem !important;
  }

  .bakery-products-grid .bakery-product-card {
    padding: .42rem !important;
    border-radius: 1.08rem !important;
  }

  .bakery-products-grid .bakery-product-image-link {
    aspect-ratio: 1 / .76;
    border-radius: .78rem;
  }

  .bakery-products-grid .bakery-product-content {
    padding: .4rem .08rem .04rem;
  }

  .bakery-products-grid .small-card_link {
    min-height: 2.3rem;
    font-size: .67rem !important;
    line-height: 1.65 !important;
  }

  .bakery-products-grid .small-card_price > h4 strong {
    font-size: .76rem;
  }

  .bakery-products-grid .bakery-product-currency {
    font-size: .52rem;
  }

  .bakery-products-grid .bakery-product-add-button {
    min-height: 2.05rem;
    padding: .4rem .25rem;
    border-radius: .68rem;
    font-size: .58rem;
  }

  .bakery-products-grid .bakery-product-discounted .bakery-discount-label {
    top: .42rem !important;
    left: .42rem !important;
    padding: .24rem .46rem !important;
    font-size: .53rem;
  }
}

/* Small mobile: keep 2 columns but make every element fit cleanly */
@media screen and (max-width: 390px) {
  .bakery-products-grid {
    gap: .42rem !important;
  }

  .bakery-products-grid .bakery-product-card {
    padding: .36rem !important;
    border-radius: 1rem !important;
  }

  .bakery-products-grid .bakery-product-image-link {
    border-radius: .7rem;
  }

  .bakery-products-grid .small-card_link {
    min-height: 2.15rem;
    font-size: .62rem !important;
  }

  .bakery-products-grid .small-card_price > h4 strong {
    font-size: .71rem;
  }

  .bakery-products-grid .bakery-product-add-button {
    min-height: 1.95rem;
    font-size: .55rem;
  }
}

/* Very small mobile */
@media screen and (max-width: 340px) {
  .bakery-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .34rem !important;
  }

  .bakery-products-grid .bakery-product-card {
    padding: .3rem !important;
  }

  .bakery-products-grid .small-card_link {
    min-height: 2rem;
    font-size: .58rem !important;
    line-height: 1.55 !important;
  }

  .bakery-products-grid .small-card_price > h4 strong {
    font-size: .67rem;
  }

  .bakery-products-grid .bakery-product-currency {
    font-size: .48rem;
  }

  .bakery-products-grid .bakery-product-add-button {
    min-height: 1.85rem;
    padding: .34rem .15rem;
    font-size: .51rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bakery-products-grid .bakery-product-add-button {
    transition: none !important;
  }
}
