/* Mozzo Scroll Menu - frontend styles */

/* ── Sticky header ──────────────────────────────────────────── */
.mozzo-sm-sticky {
    background: #fff;
    padding: 0.75rem 0;
    z-index: 100;
    /* position: sticky and top come from Bootstrap's sticky-top class.
       The theme's .logged-in.admin-bar .sticky-top rule handles admin-bar offset. */
}

.mozzo-sm-jump-select,
.mozzo-sm-search-wrap {
    max-width: 600px;
    margin: 0 auto;
}

/* ── Search wrap & clear button ─────────────────────────────── */
.mozzo-sm-search-wrap {
    position: relative;
}

.mozzo-sm-search-wrap .mozzo-sm-search-input {
    padding-right: 2.5rem;
}

.mozzo-sm-search-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
}

.mozzo-sm-search-clear:hover {
    color: #333;
}

/* ── Category sections ──────────────────────────────────────── */
.mozzo-sm-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
    /* scroll-margin-top is set dynamically by JS to match sticky header height */
}

.mozzo-sm-section-title {
    position: sticky;
    top: 0; /* overridden by JS to match sticky header height */
    z-index: 10;
    background: #fff;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* ── Product item — horizontal layout ───────────────────────── */
.mozzo-sm-product-item {
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    height: 100%; /* fills column so items in the same row share equal height */
    cursor: pointer;
}

.mozzo-sm-product-thumb {
    flex-shrink: 0;
    display: block;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 0.375rem;
    /* reset <button> defaults */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.mozzo-sm-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mozzo-sm-product-info {
    flex: 1 1 0;
    min-width: 0; /* prevent text overflow breaking layout */
}

.mozzo-sm-product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.mozzo-sm-product-name a {
    color: inherit;
    text-decoration: none;
}

.mozzo-sm-product-name a:hover {
    color: var(--bs-primary);
}

.mozzo-sm-product-desc {
    margin: 0 0 0.2rem;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mozzo-sm-product-price {
    font-size: 0.9rem;
}

/* ── Add-to-cart "+" circle button ──────────────────────────── */
.mozzo-sm-add-to-cart {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--bs-primary, #0d6efd);
    color: #fff !important;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.mozzo-sm-add-to-cart:hover,
.mozzo-sm-add-to-cart:focus {
    opacity: 0.85;
    color: #fff !important;
}

/* ── Product modal ──────────────────────────────────────────── */
.mozzo-sm-product-modal .modal-content {
    overflow: hidden; /* keeps inner content inside rounded corners */
}

.mozzo-sm-modal-close {
    z-index: 2;
}

.mozzo-sm-modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.mozzo-sm-modal-inner {
    /* inner wrapper returned by AJAX */
}

.mozzo-sm-modal-images {
    padding: 1.5rem 1rem 1rem 1.5rem;
}

.mozzo-sm-modal-main-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
}

.mozzo-sm-modal-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s ease;
}

.mozzo-sm-modal-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mozzo-sm-thumb-btn {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.mozzo-sm-thumb-btn:hover,
.mozzo-sm-thumb-btn.is-active {
    border-color: var(--bs-primary, #0d6efd);
}

.mozzo-sm-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mozzo-sm-modal-details {
    padding: 1.5rem 1.5rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.mozzo-sm-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-right: 2rem; /* clear close button */
}

.mozzo-sm-modal-price {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.mozzo-sm-modal-short-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.mozzo-sm-modal-cart {
    margin-top: auto;
}

/* Keep WC quantity input and button in a tidy row */
.mozzo-sm-modal-cart .quantity {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.mozzo-sm-modal-cart .single_add_to_cart_button {
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .mozzo-sm-modal-images {
        padding: 1.5rem 1.5rem 0.5rem;
    }

    .mozzo-sm-modal-main-img {
        aspect-ratio: 4 / 3;
    }

    .mozzo-sm-modal-details {
        padding: 1rem 1.5rem 1.5rem;
    }
}

/* ── Customizer sortable list ───────────────────────────────── */
.mozzo-sm-sortable {
    margin: 0;
}

.mozzo-sm-sortable .mozzo-sm-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
}

.mozzo-sm-sortable .mozzo-sm-handle {
    cursor: move;
    margin-right: 8px;
    color: #999;
}

.mozzo-sm-sortable .mozzo-sm-item label {
    margin: 0;
    cursor: pointer;
}
