/* ===== Overlay ===== */

.product-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    animation: fade .2s;
}


/* ===== Bottom Sheet ===== */

.product-sheet {

    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    box-shadow: 0 -10px 35px rgba(0,0,0,.18);
    animation: sheetUp .25s ease;
}


/* ===== Image ===== */

.product-sheet img {

    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 16px;
}


/* ===== Close ===== */

.sheet-close {

    float: right;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f4f4f4;
    cursor: pointer;
    font-size: 20px;
}


/* ===== Typography ===== */

.product-info{
    margin-top:20px;
}

.product-title{
    font-size:28px;
    font-weight:700;
    margin-bottom:8px;
}

.product-price{
    font-size:32px;
    font-weight:700;
    color:#2E7D32;
    margin-bottom:18px;
}

.product-price span{
    font-size:16px;
    color:#777;
    font-weight:500;
}

.product-badges{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:20px;
}

.badge{
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 14px;
    border-radius:999px;
    background:#F5F8F3;
    border:1px solid #E2E8E2;
    font-size:14px;
}

.badge-icon{
    font-size:18px;
}

.info-card{
    background:#FAFAFA;
    border-radius:16px;
    padding:16px;
    margin-bottom:18px;
}

.info-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 0;
}

.info-row:not(:last-child){
    border-bottom:1px solid #ECECEC;
}

.label{
    color:#777;
    font-weight:500;
}

.value{
    font-weight:600;
}

.stock{
    color:#2E7D32;
}

.product-message{
    background:#FFF9E8;
    border-left:5px solid #F4B400;
    padding:14px 16px;
    border-radius:12px;
    line-height:1.5;
    margin-bottom:22px;
}


/* ===== Footer ===== */

.sheet-footer {

    position: sticky;
    bottom: 0;
    background: white;
    padding-top: 18px;
}


/* ===== Add Button ===== */

.btn-add-cart {

    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #2E7D32;
    color: white;
    font-size: 18px;
    cursor: pointer;
}


/* ===== Quantity ===== */

.quantity-controls {

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quantity-controls button {

    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: #2E7D32;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.quantity-controls span {

    font-size: 22px;
    font-weight: bold;
}

/*
similar products
*/
/* ============ SIMILAR PRODUCTS SECTION ============ */
.similar-products-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}

.similar-title {
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--green-dark);
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.similar-title-icon {
    color: var(--amber);
  font-size: 1rem;
}

/* Horizontal Scroll Container */
.similar-products-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px; /* Space for shadow */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-snap-type: x mandatory;
}

.similar-products-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Individual Product Card */
.similar-product-card {
  flex: 0 0 130px; /* Fixed width, no shrinking */
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.similar-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
}

.similar-product-card:active {
  transform: scale(0.98);
}

/* Image Wrapper */
.similar-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.similar-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.similar-product-card:hover .similar-img-wrap img {
  transform: scale(1.05);
}

/* Product Details */
.similar-details {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.similar-name {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;

  /* Truncate to 2 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em; /* Ensures uniform height even with 1-line names */
}

.similar-price {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--amber);
  margin-top: auto; /* Pushes price to the bottom */
}

.similar-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
}

/* ============ DESKTOP ADJUSTMENT ============ */
@media (min-width: 768px) {
  .similar-product-card {
    flex: 0 0 150px; /* Slightly larger on desktop */
  }

  .similar-name {
    font-size: 0.9rem;
  }

  .similar-price {
    font-size: 1rem;
  }
}


/* ===== Animation ===== */

@keyframes sheetUp {

    from {

        transform: translateY(100%);
    }

    to {

        transform: translateY(0);
    }

}

@keyframes fade{
    from{
        opacity:0;
    }

    to{
        opacity:1;
    }
}