* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  padding: 20px;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f2f5;
  font-family: 'Helvetica Neue', sans-serif;
}

.wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.card {
  width: 340px;
  height: 480px;
  perspective: 1000px;
}

.card .content {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.75, 0, 0.85, 1);
}

.more {
  display: none;
}

.more:checked ~ .content {
  transform: rotateY(180deg);
}

.front,
.back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.front {
  background-size: cover;
  background-position: center;
}

.front:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.front .inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 2rem;
  color: #f7f7f7;
  text-align: center;
}

.front h2 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.front .tag {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #e67e22;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

.front .rating {
  margin-bottom: 1.5rem;
  color: #cba279;
  font-size: 0.9rem;
}

.front .rating span {
  color: rgba(255, 255, 255, 0.7);
  margin-left: 5px;
}

.back {
  transform: rotateY(180deg);
  background-color: #fff;
  color: #2c211b;
}

.back .inner {
  height: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.back .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #eee;
  padding-bottom: 1rem;
}

.back .header .origin {
  font-weight: bold;
  color: #6f4e37;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.back .header .price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #2c211b;
}

.back .roast-container .label {
  font-size: 0.8rem;
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  color: #888;
}

.back .roast-container .meter {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.back .roast-container .meter .fill {
  height: 100%;
  background: linear-gradient(90deg, #cba279, #6f4e37);
}

.back .specs {
  display: flex;
  justify-content: space-around;
}

.back .specs .spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #6f4e37;
}

.back .specs .spec-item i {
  font-size: 1.2rem;
}

.back .specs .spec-item span {
  font-size: 0.75rem;
  font-weight: 600;
}

.back .description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
  flex-grow: 1;
}

.back .actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-action {
  cursor: pointer;
  background: transparent;
  border: 1px solid #f7f7f7;
  color: #f7f7f7;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-action:hover {
  background: #f7f7f7;
  color: #2c211b;
}

.btn-cart {
  flex-grow: 1;
  background: #6f4e37;
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
}

.btn-cart:hover {
  background: #4b3525;
}

.btn-icon {
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #ddd;
  color: #888;
  transition: 0.2s;
}

.btn-icon:hover {
  border-color: #6f4e37;
  color: #6f4e37;

}

@media (max-width: 768px) {
  
  .wrapper {
    gap: 1.5rem;
    width: 100%;
  }

  .card {
    width: 100%;
    max-width: 360px; 
    height: 500px; 
  }

  .front h2 {
    font-size: 1.8rem;
  }
}


@media (max-width: 380px) {
  .card {

    height: 520px;
  }
  
  .back .inner {
    padding: 1.5rem; 
  }
}
