/* Custom Wishlist Plugin Styles */

/* Base Wishlist Page Layout */
.custom-wishlist-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.wishlist-empty {
    text-align: center;
    font-size: 18px;
    margin-top: 20px;
}
.wishlist-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wishlist-items li.row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #c2c2c2;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* Wishlist Item Title & Price */
.wishlist-item-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.wishlist-item-title a {
    text-decoration: none;
    color: #333;
}
.wishlist-item-title a:hover {
    text-decoration: underline;
}
.wishlist-item-price {
    font-size: 14px;
    font-weight: 300;
}

/* Base Button & Transition */
.ncw-heart-button,
.ncw-bell-discount,
.ncw-stock-out,
.ncw-stock-subbed,
.btn-wishlist-atc-ajax {
    transition: transform 0.2s ease;
    cursor: pointer;
}
.ncw-heart-button:hover,
.ncw-bell-discount:hover,
.ncw-stock-out:hover,
.ncw-stock-subbed:hover,
.btn-wishlist-atc-ajax:hover {
    transform: none;
}

/* HEART ICON */
.ncw-heart-button {
    width: 40px !important;
    height: 40px !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    color: #999 !important;
    /* fully clickable circle */
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    transition: box-shadow 0.2s !important;
}
.ncw-heart-button:hover {
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2) !important;
}
.ncw-heart-button i.far,
.ncw-heart-button i.fas {
    color: #999 !important;
}
.ncw-heart-button i.fas {
    color: #f1303d !important;
}

/* UNIFIED BUTTON STYLE */
.ncw-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 160px !important;
    height: 44px !important;
    box-sizing: border-box !important;
    background-color: #e8d3ca !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center;
    border: 1px solid #999 !important;
    border-radius: 5px !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s !important;
}
.ncw-button:hover {
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2) !important;
}

/* OUT-OF-STOCK */
.ncw-stock-out.ncw-button,
.ncw-stock-subbed.ncw-button {
    background-color: #f1f1f1 !important;
    color: #555 !important;
    border: 1px solid #bbb !important;
    font-weight: bold !important;
}
.ncw-stock-out span.default-text,
.ncw-stock-out span.hover-text {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important; 
    margin: 0 auto !important;
    width: 100% !important;
    text-align: center !important;
    line-height: 44px !important;
    transition: opacity 0.2s !important;
}
.ncw-stock-out span.hover-text {
    opacity: 0 !important;
}
.ncw-stock-out:hover span.default-text {
    opacity: 0 !important;
}
.ncw-stock-out:hover span.hover-text {
    opacity: 1 !important;
}

/* ADD-TO-CART */
.btn-atc.ncw-button {
    background-color: #e8d3ca !important;
    color: #333 !important;
    font-weight: 600 !important;
}

/* MOBILE OVERRIDES FOR WISHLIST ITEMS */
@media (max-width: 575.98px) {
  .wishlist-items li.row {
    display: block;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
  }
  [class*="offset-"] {
    margin-left: 0;
  }
  .wishlist-items li.row > * {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* MOBILE 2-COLUMN GRID ADJUSTMENTS FOR ELEMENTOR LOOP */
@media (max-width: 575.98px) {
    .elementor-loop-container.elementor-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-gap: 10px !important;
    }
    .custom-woocommerce-loop-item.loop-item-2col {
        width: 100% !important;
        box-sizing: border-box;
    }
    .button-container {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .ncw-button {
        width: 90% !important;
        max-width: 160px !important;
        margin: 0 auto !important;
    }
}

/* Wishlist Notification styles */
#wishlist-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.wishlist-notification {
    background-color: #444;
    color: #fff;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-size: 14px;
    opacity: 0.9;
}
@media (max-width: 575.98px) {
    #wishlist-notifications {
         top: 0;
         width: 100%;
         right: 0;
         align-items: center;
    }
    .wishlist-notification {
         width: 90%;
         margin: 10px auto;
         text-align: center;
    }
}

/* 
   ==========================================================
   REORDER (X) AND IMAGE FOR DESKTOP VS MOBILE
   - Desktop (≥576px): X on left, image on right
   - Mobile (<576px): image left, X far right
   ==========================================================
*/
@media (min-width: 576px) {
  /* Turn .wishlist-item-img into a row flex container,
     so we can reorder children */
  .wishlist-item-img {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  /* X is first, image second */
  .wishlist-item-img button.wishlist-remove-button {
    order: 1;
    margin-right: 10px !important; /* small space between X and image */
  }
  .wishlist-item-img .wishlist-item-thumb.mt-2 {
    order: 2;
    margin-top: 0 !important; /* remove top margin on desktop */
  }
}

@media (max-width: 575.98px) {
  /* On mobile, make .wishlist-item-img a row flex container again */
  .wishlist-item-img {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  /* Image first, X second (far right) */
  .wishlist-item-img .wishlist-item-thumb.mt-2 {
    order: 1;
  }
  .wishlist-item-img button.wishlist-remove-button {
    order: 2;
    margin-right: 0 !important;
  }
}
