.cart-count {
    position: absolute;
    top: -5px;
    left: -10px;
    background-color: #fff;
    border: 1px solid #3F37C9;
    color: #3F37C9;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mini cart offcanvas */
.mini-cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mini-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mini-cart-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.mini-cart-offcanvas.is-open {
    transform: translateX(0);
}

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #efefef;
    flex-shrink: 0;
}

.mini-cart-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #131d59;
    margin: 0;
}

.mini-cart-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #f4f4f4;
    color: #565656;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mini-cart-close:hover {
    background-color: #efefef;
    color: #202020;
}

.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.mini-cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-cart-item {
    display: flex;
    gap: 0.875rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #e5e5e5;
}

.mini-cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mini-cart-item-image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #efefef;
}

.mini-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart-item-details {
    flex: 1;
    min-width: 0;
}

.mini-cart-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 0.25rem;
}

.mini-cart-item-title a {
    color: #202020;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-cart-item-title a:hover {
    color: #3f37c9;
}

.mini-cart-item-meta {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 0.5rem;
}

.mini-cart-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mini-cart-item-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #202020;
}

.mini-cart-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mini-cart-item-remove:hover {
    background-color: #fef2f2;
}

.mini-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    text-align: center;
    color: #888;
}

.mini-cart-empty.hidden {
    display: none;
}

.mini-cart-items.is-empty {
    display: none;
}

.mini-cart-footer {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #efefef;
    background-color: #fff;
}

.mini-cart-footer.hidden {
    display: none;
}

.mini-cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #565656;
}

.mini-cart-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3f37c9;
}

.mini-cart-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: #3f37c9;
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.mini-cart-checkout:hover {
    background-color: #2d28a0;
    color: #fff;
}

body.offcanvas-open {
    overflow: hidden;
}

body.mini-cart-open {
    overflow: hidden;
}

/* Menu offcanvas (slides from right) */
.menu-offcanvas-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-offcanvas-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.menu-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.menu-offcanvas.is-open {
    transform: translateX(0);
}

.menu-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #efefef;
    flex-shrink: 0;
}

.menu-offcanvas-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #131d59;
    margin: 0;
}

.menu-offcanvas-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #f4f4f4;
    color: #565656;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-offcanvas-close:hover {
    background-color: #efefef;
    color: #202020;
}

.menu-offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.menu-offcanvas-search {
    margin-bottom: 1.5rem;
}

.menu-search-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #f4f4f4;
    border-radius: 0.5rem;
    border: 1px solid #efefef;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-search-label:hover,
.menu-search-label:focus-within {
    border-color: #3f37c9;
    box-shadow: 0 0 0 3px rgba(63, 55, 201, 0.12);
}

.menu-search-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: #888;
}

.menu-search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    color: #202020;
    min-width: 0;
    cursor: pointer;
}

.menu-search-input::placeholder {
    color: #aaa;
}

.menu-offcanvas-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-offcanvas-item {
    border-bottom: 1px solid #f0f0f0;
}

.menu-offcanvas-item:last-child {
    border-bottom: none;
}

.menu-offcanvas-item a {
    display: block;
    padding: 0.875rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2d2d2d;
    text-decoration: none;
    transition: color 0.2s ease, padding-inline-start 0.2s ease;
}

.menu-offcanvas-item a:hover {
    color: #3f37c9;
    padding-inline-start: 0.5rem;
}

@media (max-width: 480px) {
    .menu-offcanvas {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .mini-cart-offcanvas {
        max-width: 100%;
    }
}

/* Add address modal */
.address-modal {
    max-width: 42rem;
    padding: 0;
    overflow: hidden;
}

.address-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #efefef;
}

.address-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #131d59;
    margin: 0;
}

.address-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #f4f4f4;
    color: #565656;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.address-modal-close:hover {
    background-color: #efefef;
    color: #202020;
}

.address-form {
    padding: 1.5rem;
    max-height: calc(100dvh - 8rem);
    overflow-y: auto;
}

.address-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}

.address-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.address-form-field--full {
    grid-column: 1 / -1;
}

.address-form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d2d2d;
}

.address-form-required {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ef4444;
    margin-inline-start: 0.25rem;
}

.address-form-field input,
.address-form-field select,
.address-form-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #202020;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.address-form-field input:focus,
.address-form-field select:focus,
.address-form-field textarea:focus {
    border-color: #3f37c9;
    box-shadow: 0 0 0 3px rgba(63, 55, 201, 0.12);
}

.address-form-field textarea {
    resize: vertical;
    min-height: 5rem;
}

.address-form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
}

.shipping-methods {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #efefef;
}

.shipping-methods-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #131d59;
    margin: 0 0 1rem;
}

.shipping-methods-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shipping-method-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.shipping-method-item:hover {
    border-color: #d1d5db;
}

.shipping-method-item:has(input:checked) {
    border-color: #3f37c9;
    background-color: #f5f3ff;
}

.shipping-method-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shipping-method-radio {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s ease;
}

.shipping-method-item:has(input:checked) .shipping-method-radio {
    border-color: #3f37c9;
}

.shipping-method-item:has(input:checked) .shipping-method-radio::after {
    content: "";
    position: absolute;
    inset: 2px;
    background-color: #3f37c9;
    border-radius: 50%;
}

.shipping-method-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shipping-method-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #202020;
}

.shipping-method-desc {
    font-size: 0.75rem;
    color: #888;
}

.shipping-method-price {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #3f37c9;
}

.shipping-method-badge {
    flex-shrink: 0;
    width: 3rem;
    height: 2rem;
    background-color: #f4f4f4;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #565656;
}

.shipping-method-item:has(input:checked) .shipping-method-badge {
    background-color: #fff;
}

.address-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #efefef;
    margin-bottom: 10px;
}

.address-modal-cancel,
.address-modal-submit {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.address-modal-cancel {
    background-color: #f4f4f4;
    color: #565656;
    border: none;
}

.address-modal-cancel:hover {
    background-color: #efefef;
    color: #202020;
}

.address-modal-submit {
    background-color: #3f37c9;
    color: #fff;
    border: none;
}

.address-modal-submit:hover {
    background-color: #2d28a0;
}

@media (max-width: 640px) {
    .address-form-grid {
        grid-template-columns: 1fr;
    }

    .address-modal-actions {
        flex-direction: column-reverse;
    }

    .address-modal-cancel,
    .address-modal-submit {
        width: 100%;
        text-align: center;
    }
}
@media (max-width: 1024px) {
    .offcanvas-btn {
        display: flex;
    }
    .search-btn {
        display: none;
    }
}
@media (min-width: 1025px) {
    .offcanvas-btn {
        display: none;
    }
    .search-btn {
        display: flex;
    }
}
