/**
 * Commerce / Shop specific styles
 * Styles for customer account left menu and shop pages
 */

/* Shop page row - white background for entire row */
.shop-page-row {
  background: #f6f6f6;
}

/* Cart product images */
.cart-product-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.cart-product-image-placeholder {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

/* Cart product links - no underline */
.cart-product-link {
  text-decoration: none !important;
}

.cart-product-link:hover {
  text-decoration: none !important;
}

/* Cart quantity input styling */
.cart-quantity-input {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin-left: auto;
}

.cart-qty-btn {
  border-radius: 0;
  padding: 0.25rem 0.5rem;
  border-top: 1px solid #ced4da;
  border-bottom: 1px solid #ced4da;
}

.cart-quantity-input .cart-qty-btn:first-child {
  border-left: 1px solid #ced4da;
  border-right: none;
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.cart-quantity-input .cart-qty-btn:last-child {
  border-right: 1px solid #ced4da;
  border-left: none;
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.cart-qty-input-field {
  border-left: none;
  border-right: none;
  border-top: 1px solid #ced4da;
  border-bottom: 1px solid #ced4da;
  border-radius: 0;
  width: 60px;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* When quantity input is focused, update button borders to match */
.cart-quantity-input.qty-focused .cart-qty-btn {
  border-color: var(--red);
}

.cart-quantity-input.qty-focused .cart-qty-input-field {
  border-color: var(--red);
}

/* Cart delete button hover */
button.btn-link[onclick*="removeItem"]:hover,
button.btn-link[onclick*="removeItem"]:hover .fa-trash {
  color: var(--red) !important;
}

.cart-qty-input-field::-webkit-outer-spin-button,
.cart-qty-input-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 767.98px) {
  .cart-quantity-input {
    margin-left: 0;
    margin-right: auto;
  }
}

/* Left menu container */
.left-menu-container {
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

/* Left menu navigation */
.left-menu {
  background: #ffffff;
  padding: 1rem 0;
}

.left-menu-header {
  font-size: 1rem;
  font-weight: 600;
  padding: 0 1rem;
  margin-bottom: 0.75rem;
  color: #212529;
}

.text-end {
  text-align:right; 
}

/* Left menu list */
.left-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Left menu items */
.left-menu-item {
  margin: 0;
  border-bottom: 1px solid #e9ecef;
}

.left-menu-item:last-child {
  border-bottom: none;
}

.left-menu-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #495057;
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.left-menu-link:hover {
  background-color: #e9ecef;
  color: #212529;
  text-decoration: none !important;
}

.left-menu-link:focus,
.left-menu-link:active,
.left-menu-link:visited {
  text-decoration: none !important;
}

/* Active menu item */
.left-menu-item.active > .left-menu-link {
  background-color: #dee2e6;
  color: #212529;
  font-weight: 600;
  border-left: 3px solid var(--red);;
  padding-left: calc(1rem - 3px);
}

/* Nested submenu */
.left-menu-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #ffffff;
  border-top: 1px solid #e9ecef;
}

.left-menu-sublist .left-menu-item {
  border-bottom: 1px solid #f1f3f5;
}

.left-menu-sublist .left-menu-item:last-child {
  border-bottom: none;
}

.left-menu-sublist .left-menu-link {
  padding-left: 2rem;
  font-size: 0.85rem;
  color: #6c757d;
  text-decoration: none !important;
}

.left-menu-sublist .left-menu-item.active > .left-menu-link {
  color: #212529;
  font-weight: 600;
  border-left: 3px solid #007bff;
  padding-left: calc(2rem - 3px);
}

.left-menu-sublist .left-menu-link:hover {
  background-color: #f8f9fa;
  color: #212529;
  text-decoration: none !important;
}

.left-menu-sublist .left-menu-link:focus,
.left-menu-sublist .left-menu-link:active,
.left-menu-sublist .left-menu-link:visited {
  text-decoration: none !important;
}


/* Mobile menu adjustments */
@media (max-width: 767.98px) {
  .left-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    overflow: auto;
    padding: 5rem 1rem 1rem 1rem !important;
    background: #fff;
    transition: transform 0.3s ease-out;
    transform: translateX(-100%);
  }
  
  .left-menu-container.active {
    transform: translateX(0);
  }
  
  .left-menu-container .mobile-menu-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    width: 100%;
    background-color: #fff;
    background: linear-gradient(#fff, #fff) 0 0/100% calc(100% - 14px) no-repeat, 
                linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) 0 calc(100% - 7px)/100% 7px no-repeat;
    height: 80px;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1rem;
    padding-bottom: calc(1rem + 14px);
    display: grid;
    grid-template-columns: auto min-content;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
  }
  
  .left-menu-container .mobile-menu-header h4 {
    display: inline;
    margin-bottom: 0;
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .left-menu-container .left-menu {
    margin-top: 1rem;
  }
}
