/* Backend CSS for public site components */

/* Success message styling */
.feedback-success-message {
    background-color: #10b981;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
    border-left: 4px solid #059669;
}

/* Compact success message for modal contexts */
.modal-block .feedback-success-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
}

.feedback-success-message.alert {
    display: block;
    width: 100%;
}

/* Remove any conflicting Tailwind classes that might be present */
.feedback-success-message.alert-success {
    background-color: #10b981 !important;
    color: white !important;
    border-color: #059669 !important;
}

.feedback-success-message.bg-green-100 {
    background-color: #10b981 !important;
}

.feedback-success-message.text-green-700 {
    color: white !important;
}

.feedback-success-message.border-green-400 {
    border-color: #059669 !important;
}

/* Search block message styling */
.search-block__message {
    margin-bottom: 20px;
}

/* Catalog block results styling */
.catalog-block__results {
    margin-bottom: 20px;
}

/* Header login dropdown arrow fix - only show for authenticated users */
@media (min-width: 768px) {
    .header-lk--authenticated .header-lk__head {
        padding-right: 14px;
    }
    .header-lk--authenticated .header-lk__head:before {
        position: absolute;
        right: 0;
        top: 50%;
        border: 0px solid transparent;
        border-width: 3px 3px 0 3px;
        border-top-color: var(--color-gray-800);
        transform: translateY(-50%);
    }
}
@media (hover: hover) and (min-width: 768px) {
    .header-lk--authenticated .header-lk__head:before {
        content: '';
    }
    .header-lk--authenticated:hover .header-lk__dropdown {
        display: block;
        z-index: 800;
    }
}

/* Favorite button styling */
.button-favorite.is-in-favorites {
    color: #ef4444;
}

.button-favorite.is-in-favorites svg {
    fill: #ef4444;
}

/* Favorites table styling - reuse basket styles but with favorites- prefix */
.favorites-block {
    /* Inherit styling from basket-block */
}

.favorites-table {
    width: 100%;
    border-collapse: collapse;
}

.favorites-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.favorites-table-head__title {
    font-weight: 600;
    font-size: 18px;
}

.favorites-table-head__clear {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
}

.favorites-table-head__clear:hover {
    color: #ef4444;
}

.favorites-table-item__cell {
    padding: 12px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.favorites-table-item__title a {
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
}

.favorites-table-item__title a:hover {
    color: #2563eb;
}

.favorites-table-item__brand,
.favorites-table-item__article {
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

.favorites-table-item__price {
    font-weight: 500;
    color: #1f2937;
}

.favorites-table-item__remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
}

.favorites-table-item__remove:hover {
    color: #ef4444;
}

.favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.favorites-block__info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
}

/* Favorites page styling */
.favorites-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.favorites-page__title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1f2937;
}

.favorites-page__content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Catalog block head for favorites */
.catalog-block__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.catalog-block__head-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.catalog-block__head-control {
    /* Button styling handled by existing pvs-button classes */
}

/* Catalog item favorite remove button */
.catalog-item__favorite {
    position: absolute;
    top: 12px;
    right: 12px;
}

.catalog-item__favorite-remove {
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.catalog-item__favorite-remove:hover {
    background: #fff;
    color: #ef4444;
    border-color: #ef4444;
}

/* Ensure catalog-item has relative positioning for absolute favorite button */
.catalog-item {
    position: relative;
}

/* Quantity counter - replacement for counter-box custom element */
.quantity-counter {
    display: inline-grid;
    grid-template-columns: 29px 50px 29px;
    grid-template-areas: 'down input up';
    justify-content: center;
    align-items: center;
    padding: 0;
}

.quantity-counter__button {
    position: relative;
    width: 29px;
    height: 100%;
    padding: 8px;
    margin: 0;
    border: none;
    border-radius: inherit;
    background: none;
    display: grid;
    align-content: center;
    justify-items: center;
    cursor: pointer;
    color: var(--color-gray-500);
}

.quantity-counter__button:before {
    content: '';
    width: 11px;
    height: 2px;
    background: currentColor;
    flex: 0 0 auto;
    grid-area: 1 / 1 / 2 / 2;
}

.quantity-counter__button--down {
    grid-area: down;
}

.quantity-counter__button--up {
    grid-area: up;
}

.quantity-counter__button--up:after {
    content: '';
    width: 11px;
    height: 2px;
    background: currentColor;
    flex: 0 0 auto;
    grid-area: 1 / 1 / 2 / 2;
    transform: rotate(-90deg);
}

.quantity-counter input {
    grid-area: input;
    text-align: center;
    border: none;
    outline: none;
    appearance: textfield;
    min-width: 1px;
    width: 50px;
    max-width: 50px;
}