/**
 * Style dla listy życzeń
 */

/* Kontener produktu na liście życzeń */
.wslist-product {
    position: relative;
    margin-bottom: 20px;
}

.wslist-product .thumbnail-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.wslist-product .thumbnail-container:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Wyśrodkowanie obrazów */
.wslist-product .image-block {
    text-align: center;
    margin-bottom: 15px;
}

.wslist-product .image-block img {
    margin: 0 auto;
    display: block;
    max-width: 100%;
    height: auto;
}

/* Wyrównanie wysokości i marginesy opisów */
.wslist-product .product-description {
    flex: 1;
    padding: 10px 5px;
}

.wslist-product .product-title {
    height: 50px;
    overflow: hidden;
    margin-bottom: 10px;
}

.wslist-product .product-price-and-shipping {
    margin-bottom: 15px;
}

/* Przyciski akcji */
.wslist-bottom-actions {
    margin-top: 15px !important;
    text-align: center !important;
    padding: 0 5px 10px !important;
}

/* Zmieniony selektor, aby nie wpływał na przyciski wewnątrz .input-group */
.wslist-bottom-actions > div > .btn {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 8px;
    transition: all 0.3s;
}

/* Przyciski akcji - dodatkowe style */
.wslist-bottom-actions .btn-primary {
    background-color: #2fb5d2;
    border-color: #2fb5d2;
}

/* Efekt hover dla przycisków */
.wslist-bottom-actions .btn-primary:hover:not(:disabled) {
    background-color: #00a8e4;
    border-color: #00a8e4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.wslist-bottom-actions .btn-outline-danger {
    color: #dc3545;
    background-color: transparent;
    background-image: none;
    border-color: #dc3545;
}

.wslist-bottom-actions .btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Responsywność - ustawienia dla różnych rozmiarów ekranu */
@media (max-width: 767px) {
    .wslist-product.col-xs-12 {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .wslist-product.col-sm-6 {
        padding-left: 7px;
        padding-right: 7px;
    }
}

@media (min-width: 992px) {
    .wslist-product.col-md-4,
    .wslist-product.col-lg-3 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Style dla pól ilości i przycisków dodawania do koszyka */
.wslist-product .input-group {
    flex-wrap: nowrap;
}

.wslist-product input[type="number"] {
    text-align: center;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.wslist-product input[type="number"]::-webkit-inner-spin-button,
.wslist-product input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Przyciski +/- przy polach ilości */
.wslist-product .qty-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wslist-product .qty-btn {
    position: relative;
    width: 30px;
    height: 38px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    padding: 0;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    color: #333;
    z-index: 1;
    transition: all 0.2s;
}

.wslist-product .qty-down {
    border-radius: 4px 0 0 4px;
}

.wslist-product .qty-up {
    border-radius: 0 4px 4px 0;
}

.wslist-product .qty-btn:hover {
    background-color: #e0e0e0;
}

.wslist-product .qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status dostępności produktu */
.wslist-product .product-availability {
    margin: 10px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
    border-radius: 4px;
}

.wslist-product .product-availability .material-icons {
    font-size: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.wslist-product .text-success {
    color: #28a745 !important;
}

.wslist-product .text-danger {
    color: #dc3545 !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Style dla tymczasowych komunikatów */
.wslist-product .temp-message {
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 13px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in-out;
}

.wslist-product .temp-message i.material-icons {
    font-size: 16px;
    margin-right: 5px;
}

.wslist-product .temp-message.text-success {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

.wslist-product .temp-message.text-warning {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.wslist-product .temp-message.text-danger {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Style dla przycisków disabled */
.wslist-product button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Poprawka dla układu przycisków i pól */
.wslist-product .pr-0 {
    padding-right: 0;
}

.wslist-product .pl-1 {
    padding-left: 5px;
}

/* Style dla formularza dodawania do koszyka */
.wslist-product .add-to-cart-form {
    margin-bottom: 10px;
}

.wslist-product .add-to-cart-form .row {
    margin-left: -5px;
    margin-right: -5px;
    display: flex;
    align-items: stretch;
}

/* Style dla pustej listy życzeń */
.empty-wishlist {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.empty-wishlist i.material-icons {
    font-size: 64px;
    color: #6c757d;
    margin-bottom: 20px;
    display: block;
}

.empty-wishlist h3 {
    margin-bottom: 15px;
    color: #495057;
}

.empty-wishlist p {
    color: #6c757d;
    margin-bottom: 20px;
}

.wslist-product .add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    white-space: nowrap;
    padding: 10px 15px;
}

.wslist-product .add-to-cart i.material-icons {
    margin-right: 5px;
    font-size: 18px;
}

/* =================================================================== */
/* OSTATECZNA POPRAWKA DLA INPUT GROUP - NADPISANIE WSZYSTKICH STYLI */
/* =================================================================== */

/* Upewnij się, że kontener input-group jest traktowany jako jeden element flex */
.wslist-product .input-group {
  display: inline-flex !important;
  width: 100%;
  flex-wrap: nowrap !important;
}

/* Zresetuj style dla pola input wewnątrz input-group */
.wslist-product .input-group .form-control {
  display: block !important;
  height: auto !important; /* Pozwól na automatyczne dopasowanie wysokości */
  width: 70px; /* Zachowaj stałą szerokość */
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
}

/* Zresetuj style dla przycisku wewnątrz input-group */
.wslist-product .input-group .btn.add-to-cart {
  display: block !important;
  width: auto !important; /* Pozwól na elastyczne rozciąganie */
  height: auto !important;
  flex-grow: 1 !important; /* Pozwól przyciskowi zająć resztę miejsca */
  flex-shrink: 1 !important;
}

/* =================================================================== */
/* STYL DLA PRZYCISKU USUWANIA - WYGLĄD LINKU (STAN DOMYŚLNY)      */
/* =================================================================== */

/* Nadpisanie stylu .btn-outline-danger, aby wyglądał jak link */
.wslist-bottom-actions .btn.wslist-remove-button.btn-outline-danger {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important; /* Usunięcie cienia, jeśli motyw go dodaje */
}

/* Usunięcie efektu transformacji przy najechaniu, gdy jest w stanie "outline" */
.wslist-bottom-actions .btn.wslist-remove-button.btn-outline-danger:hover {
    transform: none !important;
    background-color: transparent !important; /* Upewnij się, że tło pozostaje przezroczyste */
}

/* =================================================================== */
/* ANIMACJA DODAWANIA DO KOSZYKA                                     */
/* =================================================================== */

.wslist-product .thumbnail-container {
  position: relative; /* Konieczne dla pozycjonowania nakładki */
}

.wslist-add-to-cart-confirmation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.wslist-add-to-cart-confirmation.visible {
  opacity: 1;
  visibility: visible;
}

.wslist-add-to-cart-confirmation .material-icons {
  font-size: 48px;
  color: #28a745;
  margin-bottom: 10px;
}

.wslist-add-to-cart-confirmation span {
    margin-top: 10px;
    font-size: 18px;
    color: #333;
}

/* Potwierdzenie usunięcia */
.wslist-remove-confirmation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    z-index: 5;
}

.wslist-remove-confirmation.visible {
    opacity: 1;
}

.wslist-remove-confirmation .material-icons {
    font-size: 60px;
    color: #dc3545; /* Czerwony kolor */
    animation: trash-animation 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes trash-animation {
    0% {
        transform: scale(0.5) rotate(-30deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* =================================================================== */
/* ANIMACJA ŁADOWANIA DLA PRZYCISKU DODAWANIA DO KOSZYKA (v2)        */
/* =================================================================== */

.wslist-add-to-cart-btn.loading {
  background-color: #00a8e4 !important;
  border-color: #00a8e4 !important;
  color: #fff !important;
  pointer-events: none;
}

.wslist-remove-product.loading .material-icons,
.wslist-add-to-cart-btn.loading .material-icons {
    animation: hourglass-spin 1.5s infinite linear;
}

@keyframes hourglass-spin {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
