/* Add this near the top of modal.css */
[hidden] {
  display: none !important;
}

/* Overlay */
#dvly-atc-overlay.dvly-atc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
}

/* Modal */
#dvly-atc-modal.dvly-atc-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 900px;
  width: 92vw;
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  height: 90vh;
  overflow: auto;
}

/* Header */
#dvly-atc-modal .dvly-atc-header h3 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}
#dvly-atc-modal .dvly-atc-header p {
  margin: 0 0 14px;
  font-size: 18px;
  color: #555;
}

/* Close button */
#dvly-atc-modal .dvly-atc-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* Cross-sells */
#dvly-atc-modal .dvly-atc-cross-sells {
  margin-top: 10px;
}
#dvly-atc-modal .dvly-atc-cross-sells h4 {
  margin: 0 0 10px;
  font-size: 24px;
}
#dvly-atc-modal .dvly-atc-products {
  margin-bottom: 10px;
}

/* Actions */
#dvly-atc-modal .dvly-atc-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-direction: column;
}
#dvly-atc-modal .dvly-atc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid #ddd;
  background: #f7f7f7;
  cursor: pointer;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}
#dvly-atc-modal .dvly-atc-view-cart {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* Products grid */

#dvly-atc-modal.dvly-atc-modal ul.products {
  padding: 0;
  display: grid;
  width: 100%;
  list-style: none;
  gap: 16px;
  grid-template-columns: 1fr;
}

#dvly-atc-modal.dvly-atc-modal ul.products li.product {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  overflow: hidden;
  flex-wrap: nowrap;
}

#dvly-atc-modal
  .dvly-atc-modal
  ul.products
  li.product
  .woocommerce-loop-product__link {
  flex-grow: 1;
}

#dvly-atc-modal.dvly-atc-modal ul.products li.product img {
  width: 70px;
  max-width: 70px;
  margin: 0;
}

#dvly-atc-modal.dvly-atc-modal
  ul.products
  li.product
  h2.woocommerce-loop-product__title {
  font-size: 14px;
}

#dvly-atc-modal.dvly-atc-modal ul.products li.product .price {
  font-size: 14px;
  margin: 0;
}

#dvly-atc-modal.dvly-atc-modal ul.products a.add_to_cart_button,
#dvly-atc-modal .button.dvly-view-product {
  position: relative;
  border-radius: 100px;
  padding: 4px 12px;
  font-family: "Poppins";
  text-transform: uppercase;
  text-align: center;
  background: #d1d1d1;
  color: black;
  font-weight: 700;
  font-size: 12px;
  min-height: auto;
  align-self: flex-start;
}

#dvly-atc-modal.dvly-atc-modal ul.products a.add_to_cart_button {
  background-color: var(--primary);
  color: var(--white);
}

#dvly-atc-modal .dvly-atc-products-grid-item-content {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex-grow: 1;
  gap: 12px;
}

#dvly-atc-modal .dvly-atc-products-grid-item-content-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Mobile fixes */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  #dvly-atc-modal .dvly-atc-actions {
    flex-direction: row;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  #dvly-atc-modal.dvly-atc-modal {
    height: auto;
  }

  #dvly-atc-modal.dvly-atc-modal ul.products {
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #dvly-atc-modal.dvly-atc-modal ul.products li.product {
    height: 100%;
    padding: 16px;
    flex-direction: column;
  }
  #dvly-atc-modal.dvly-atc-modal ul.products li.product img {
    width: calc(100% + 32px);
    max-width: calc(100% + 32px);
    margin: -16px -16px 16px -16px;
  }
  #dvly-atc-modal .dvly-atc-products-grid-item-content {
    text-align: center;
  }
  #dvly-atc-modal.dvly-atc-modal ul.products a.add_to_cart_button,
  #dvly-atc-modal .button.dvly-view-product {
    padding: 10px 20px;
    font-size: 16px;
    align-self: auto;
  }
  #dvly-atc-modal.dvly-atc-modal
    ul.products
    li.product
    h2.woocommerce-loop-product__title {
    font-size: 16px;
  }
  #dvly-atc-modal.dvly-atc-modal ul.products li.product .price {
    font-size: 16px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  #dvly-atc-modal.dvly-atc-modal ul.products {
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
