/* =========================================
   BASE MODAL LAYER
========================================= */

.commerce-cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  z-index: 999999;

  display: none;
}

.open {
  display: block;
}

body.ccm-lock {
  overflow: hidden;
}


/* =========================================
   OVERLAY
========================================= */

.ccm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 14, 0.85);
  backdrop-filter: blur(4px);
}


/* =========================================
   MODAL PANEL
========================================= */

.ccm-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);

  width: 700px;
  max-width: 92%;

  background: #131920;
  color: #ffffff;

  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);

  padding: 30px 28px 24px;

  opacity: 0;
  transition: all 0.25s ease;
}

/* Animate in */
.open .ccm-dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}


/* =========================================
   CLOSE BUTTON
========================================= */

.ccm-close {
  position: absolute;
  top: 12px;
  right: 14px;

  background: none;
  border: none;

  color: #aaa;
  font-size: 26px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ccm-close:hover {
  color: #fff;
}


/* =========================================
   TITLE
========================================= */

.ccm-title {
  font-family: 'Army', sans-serif;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 1px;

  margin-bottom: 20px;
}


/* =========================================
   CART CONTENT AREA
========================================= */

.ccm-cart-content {
  max-height: 280px;
  overflow-y: auto;

  margin-bottom: 22px;
  padding-right: 6px;
}

/* Scrollbar styling */
.ccm-cart-content::-webkit-scrollbar {
  width: 6px;
}
.ccm-cart-content::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}


/* =========================================
   CART TABLE (Commerce View Output)
========================================= */

.ccm-cart-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ccm-cart-content td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ccm-cart-content tr:last-child td {
  border-bottom: none;
}

.ccm-cart-content .views-field-quantity {
  width: 50px;
  color: #aaa;
}

.ccm-cart-content .views-field-title {
  font-weight: 600;
}

.ccm-cart-content .views-field-total-price__number {
  text-align: right;
  font-weight: bold;
}


/* =========================================
   CART LINKS
========================================= */

.ccm-cart-content a {
  color: #CF1F2E;
  text-decoration: none;
}

.ccm-cart-content a:hover {
  text-decoration: underline;
}


/* =========================================
   ACTION BUTTONS
========================================= */

.ccm-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

/* Base button */
.ccm-btn,
.ccm-checkout {
  flex: 1;

  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: 14px;

  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;

  transition: all 0.2s ease;
}

/* Continue */
.ccm-continue {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
}

.ccm-continue:hover {
  border-color: #888;
  color: #fff;
}

/* Checkout (PRIMARY CTA) */
.ccm-checkout {
  background: #CF1F2E;
  color: #fff;
  border: 1px solid #CF1F2E;
}

.ccm-checkout:hover {
  background: #a81824;
  border-color: #a81824;
}


/* =========================================
   LOADING + ERROR STATES
========================================= */

.ccm-loading,
.ccm-error {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #aaa;
}

/* =========================================
   MODAL CART CARD LAYOUT
========================================= */

.commerce-cart-modal .cart-card {
  display: block;
  background: transparent;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 12px 0;
  box-shadow: none;
  border-radius: 0;
}

.commerce-cart-modal .cart-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.commerce-cart-modal .cart-card__image {
  flex: 0 0 70px;
}

.commerce-cart-modal .cart-card__image img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.commerce-cart-modal .cart-card__info {
  flex: 1;
  min-width: 0;
}

.commerce-cart-modal .cart-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}

.commerce-cart-modal .cart-card__scent {
  font-size: 13px;
  color: #b8b8b8;
  margin-top: 3px;
}

.commerce-cart-modal .cart-card__scent:empty {
  display: none;
}

.commerce-cart-modal .cart-card__price {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 5px;
}

.commerce-cart-modal .cart-card__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding-left: 84px;
}

.commerce-cart-modal .cart-card__qty,
.commerce-cart-modal .cart-card__total {
  font-size: 13px;
  color: #ffffff;
}

.commerce-cart-modal .cart-card__qty .label,
.commerce-cart-modal .cart-card__total .label {
  display: block;
  font-size: 11px;
  color: #98999B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.commerce-cart-modal .cart-card__remove {
  display: none;
}


/* =========================================
   MOBILE MODAL CART
========================================= */

@media (max-width: 900px) {
  .ccm-dialog {
    width: calc(100vw - 28px);
    max-width: none;
    max-height: calc(100vh - 28px);
    padding: 22px 16px 18px;
    border-radius: 8px;
  }

  .ccm-title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .ccm-cart-content {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0;
  }

  .ccm-cart-content table,
  .ccm-cart-content thead,
  .ccm-cart-content tbody,
  .ccm-cart-content tr,
  .ccm-cart-content th,
  .ccm-cart-content td {
    display: block;
    width: 100%;
  }

  .ccm-cart-content thead {
    display: none;
  }

  .ccm-cart-content tr {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }

  .ccm-cart-content td {
    padding: 4px 0;
    border-bottom: none;
  }

  .ccm-cart-content .views-field-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
  }

  .ccm-cart-content .views-field-unit-price__number,
  .ccm-cart-content .views-field-total-price__number {
    text-align: left;
    font-size: 14px;
  }

  .ccm-cart-content .views-field-remove-button,
  .ccm-cart-content .views-field-edit-quantity,
  .ccm-cart-content .form-actions {
    display: none;
  }

  .ccm-actions {
    flex-direction: row;
    gap: 20px;
  }

  .ccm-btn,
  .ccm-checkout {
    width: 100%;
    height: 44px;
  }
  .commerce-cart-modal .cart-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  /* LEFT SIDE */
  .commerce-cart-modal .cart-card__top {
    width: 70%;
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  /* RIGHT SIDE */
  .commerce-cart-modal .cart-card__bottom {
    width: 30%;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;

    margin-top: 0;
    padding-left: 0;
    gap: 10px;
  }

  /* IMAGE */
  .commerce-cart-modal .cart-card__image {
    flex: 0 0 60px;
  }

  .commerce-cart-modal .cart-card__image img {
    width: 60px;
    height: 60px;
  }

  /* INFO */
  .commerce-cart-modal .cart-card__info {
    flex: 1;
    min-width: 0;
  }

  .commerce-cart-modal .cart-card__title {
    font-size: 14px;
    line-height: 1.25;
  }

  .commerce-cart-modal .cart-card__price {
    margin-top: 4px;
    font-size: 13px;
  }

  .commerce-cart-modal .cart-card__scent {
    font-size: 12px;
  }

  /* RIGHT COLUMN CONTENT */
  .commerce-cart-modal .cart-card__qty,
  .commerce-cart-modal .cart-card__total {
    text-align: right;
    width: 100%;
  }

  .commerce-cart-modal .cart-card__qty .label,
  .commerce-cart-modal .cart-card__total .label {
    margin-bottom: 2px;
  }
}