html {
    font-size: 16px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bs-focus-ring-color);
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 80px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Floating Cart Button */
.btn-cart-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cart-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-cart-float i {
    line-height: 1;
    margin: 0;
    padding: 0;
}

.btn-cart-float .cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    line-height: 20px;
    border-radius: 11px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    white-space: nowrap;
    z-index: 1001;
    border: 2px solid white;
    background-color: #dc3545 !important;
    color: white !important;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Quantity Adjuster (Cart + Product pages) */
.quantity-adjuster {
    max-width: 150px;
}

.quantity-adjuster input[type="number"] {
    -moz-appearance: textfield;
}

.quantity-adjuster input[type="number"]::-webkit-outer-spin-button,
.quantity-adjuster input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* HTMX Loading Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* HTMX Smooth Transitions */
.htmx-swapping {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.htmx-settling {
    opacity: 0;
}

.htmx-added {
    opacity: 0;
}

.htmx-added.htmx-settling {
    opacity: 1;
    transition: opacity 1s ease-out;
}

/* Mobile UI Fixes */
/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Mobile footer fix - prevent overflow from long links */
@media (max-width: 575.98px) {
    footer .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 0.75rem;
        text-align: center;
    }

    footer .container a {
        font-size: 0.75rem;
        display: inline-block;
        word-break: break-word;
    }

    /* Ensure footer links wrap properly */
    footer {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}

/* Navbar padding alignment with page content */
@media (max-width: 991.98px) {
    .navbar > .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
