/* GCO (Grocery Cart Optimization) page styles */

body {
  background-color: #fff;
}

.gco-page button {
  font: inherit;
  cursor: pointer;
}

.gco-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  color: #1e293b;
}

.gco-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #2C8746;
  padding: 12px 16px 4px;
}

.gco-logo svg {
  width: 13px;
  height: 10px;
}

.gco-logo-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: inherit;
}

.gco-heading {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: #1e293b;
  text-align: center;
  margin: 0 0 20px;
  padding: 0 40px;
  line-height: 1.3;
}

.gco-column-headers {
  display: flex;
  justify-content: space-between;
  padding: 8px 52px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #004E36;
  text-transform: uppercase;
}

.gco-column-headers span {
  flex: 1;
  text-align: center;
  max-width: 180px;
}

.gco-header-spacer {
  width: 36px;
  flex: none;
}

.gco-swap-pair {
  padding: 0 36px 4px;
  position: relative;
}

.gco-swap-pair + .gco-swap-pair::before {
  content: "";
  display: block;
  height: 1px;
  background: #d0d0d0;
  margin: 0 auto 0;
  width: 100%;
}

.gco-product-pair {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding: 12px 0;
  justify-content: center;
}

.gco-product-slot {
  flex: 1;
  padding: 8px 0;
  gap: 8px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gco-product-pair .gco-product-slot {
  flex: 1;
  max-width: 180px;
  text-align: center;
}

.gco-product-slot.gco-slot-selected .gco-product-card {
  outline: 8px solid #2C8746;
  outline-offset: -4px;
  box-shadow: 0 2px 8px rgba(27,94,60,0.15);
  border-radius: 12px;
}

/* slot-unselected: no special styling needed */

.gco-page :focus-visible {
  outline: 2px solid #1B5E3C;
  outline-offset: 2px;
}

.gco-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: 12px;
  background: #fff;
  padding: 8px 12px 16px 12px;
  width: 100%;
  overflow: visible;
  position: relative;
}

.gco-product-image {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gco-product-image img {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  object-fit: contain;
}

.gco-product-image-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  background-color: #f5f5f5;
}
.gco-product-name {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 130px;
  text-align: center;
}

.gco-see-more-link {
  display: inline-block;
  font-size: 13px;
  color: #004E36;
  text-decoration: underline;
  margin-top: 4px;
}

.gco-swap-icon {
  width: 52px;
  height: 52px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #1B5E3C;
  border-radius: 50%;
  z-index: 20;
}

.gco-badges {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
}

.gco-change-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px 0 0 6px;
  background: #144530;
  color: #fff;
  white-space: nowrap;
  display: block;
  text-transform: uppercase;
}

.gco-change-badge:first-child {
  border-radius: 6px 12px 0 6px;
}

.gco-change-badge:nth-child(1) {
  background: #144530;
}

.gco-change-badge:nth-child(2) {
  background: #246842;
}

.gco-change-badge:nth-child(3) {
  background: #348B54;
}

.gco-confirm-area {
  padding: 16px 24px;
  padding-top: 80px;
  margin-top: -80px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, white 60%, rgba(255,255,255,0));
  z-index: 100;
}

.gco-confirm-button {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 9999px;
  background: #1B5E3C;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.gco-dismiss-button {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 9999px;
  background: #f0f0f0;
  color: #1e293b;
  border: 2px solid #d0d0d0;
  cursor: pointer;
  transition: all 150ms ease;
}

.gco-confirm-button:hover {
  background: #164a30;
}

.gco-dismiss-button:hover {
  background: #e5e5e5;
}

.gco-confirm-button:active {
  transform: scale(0.98);
}

.gco-dismiss-button:active {
  transform: scale(0.98);
}

.gco-confirm-button:focus-visible {
  outline: 2px solid #1B5E3C;
  outline-offset: 2px;
}

.gco-dismiss-button:focus-visible {
  outline: 2px solid #1B5E3C;
  outline-offset: 2px;
}

.gco-no-swaps {
  display: flow-root;
  text-align: center;
  padding: 0 0 40px;
  color: #64748b;
}

.gco-skeleton {
  padding: 16px;
  text-align: center;
}

.gco-skeleton-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #64748b;
  margin-bottom: 16px;
}

.gco-skeleton-cards {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: center;
}

.gco-skeleton-card {
  width: 120px;
  height: 160px;
  background: #e2e8f0;
  border-radius: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.gco-error {
  text-align: center;
  padding: 24px 16px;
}

.gco-error-message {
  font-family: var(--font-sans);
  font-size: 16px;
  color: #64748b;
  margin: 16px 0;
}

.gco-error-link {
  color: #1B5E3C;
  text-decoration: underline;
}

.gco-content {
  padding-bottom: 0;
}

.gco-scroll-spacer {
  height: 60px;
}

/* Nutrition facts display */
.gco-nutrition {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 8px;
}

.gco-nutrition-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #004F2D;
    margin-bottom: 2px;
}

.gco-nutrition-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 15px;
    color: #64748b;
    line-height: 1.3;
}

.gco-nutrition-item + .gco-nutrition-item {
    margin-top: -4px;
}

.gco-nutrition-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
