/**
 * Advita Core - Frontend Subsystem Styles
 */

/* Modal Base */
.advita-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.advita-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(42, 33, 27, 0.65);
  backdrop-filter: blur(4px);
}

.advita-modal__dialog {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E8E2D9;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(42, 33, 27, 0.2);
  z-index: 10;
  animation: advitaModalSlide 0.25s ease-out;
}

@keyframes advitaModalSlide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.advita-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #736B63;
  cursor: pointer;
  line-height: 1;
}

.advita-modal__close:hover {
  color: #6B0F2B;
}

/* Slide-out Cart Drawer */
.advita-cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99998;
  visibility: hidden;
  transition: visibility 0.3s ease;
}

.advita-cart-drawer.is-open {
  visibility: visible;
}

.advita-cart-drawer__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(42, 33, 27, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.advita-cart-drawer.is-open .advita-cart-drawer__overlay {
  opacity: 1;
}

.advita-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 25px rgba(42, 33, 27, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.advita-cart-drawer.is-open .advita-cart-drawer__panel {
  transform: translateX(0);
}

.advita-cart-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #E8E2D9;
}

.advita-cart-drawer__close {
  background: transparent;
  border: none;
  font-size: 26px;
  color: #736B63;
  cursor: pointer;
}

.advita-cart-drawer__close:hover {
  color: #6B0F2B;
}

.advita-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.advita-cart-item {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #FAF7F2;
  position: relative;
}

.advita-cart-item__thumb img {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #E8E2D9;
}

.advita-cart-item__info {
  flex: 1;
}

.advita-cart-item__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}

.advita-cart-item__title a {
  color: #2A211B;
  text-decoration: none;
}

.advita-cart-item__title a:hover {
  color: #6B0F2B;
}

.advita-cart-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.advita-cart-item__price {
  font-weight: 700;
  color: #6B0F2B;
  font-size: 14px;
}

.advita-cart-item__qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid #E8E2D9;
  border-radius: 3px;
  background: #FAF7F2;
}

.advita-qty-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  color: #2A211B;
}

.advita-qty-val {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.advita-cart-item__remove {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
}

.advita-cart-item__remove:hover {
  color: #dc2626;
}

.advita-cart-drawer__footer {
  padding: 20px;
  border-top: 1px solid #E8E2D9;
  background: #FAF7F2;
}

.advita-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.advita-drawer-subtotal strong {
  color: #6B0F2B;
  font-size: 18px;
}

/* Feedback Box */
.advita-feedback-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.advita-feedback-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
