/*
|--------------------------------------------------------------------------
| AllDigitalCart
| Custom CSS
|--------------------------------------------------------------------------
|
| Project-specific styles.
|
| Tailwind utilities remain the primary styling system.
| Use this file for reusable components, transitions, states,
| and browser-specific behavior that would otherwise be duplicated
| throughout the application.
|
*/


/*
|--------------------------------------------------------------------------
| CSS Variables
|--------------------------------------------------------------------------
*/

:root {

    --adc-primary: #111827;
    --adc-primary-hover: #1f2937;

    --adc-text: #111827;
    --adc-text-muted: #6b7280;

    --adc-border: #e5e7eb;
    --adc-border-dark: #d1d5db;

    --adc-surface: #ffffff;
    --adc-surface-muted: #f9fafb;

    --adc-success: #166534;
    --adc-success-bg: #f0fdf4;

    --adc-error: #991b1b;
    --adc-error-bg: #fef2f2;

    --adc-warning: #92400e;
    --adc-warning-bg: #fffbeb;

    --adc-info: #1e40af;
    --adc-info-bg: #eff6ff;

    --adc-radius-sm: 0.375rem;
    --adc-radius-md: 0.5rem;
    --adc-radius-lg: 0.75rem;
    --adc-radius-xl: 1rem;

    --adc-transition-fast: 150ms ease;
    --adc-transition-normal: 200ms ease;

    --adc-brand-red: #d8232f;
    --adc-brand-blue: #1b4f9c;
    --adc-brand-navy: #0e2a5c;

    /*
     * Scrollbar and back-to-top share one red / blue / white gradient
     * so the two read as the same brand accent.
     */
    --adc-brand-gradient:
        linear-gradient(
            180deg,
            #d8232f 0%,
            #b3121f 22%,
            #1b4f9c 60%,
            #0e2a5c 82%,
            #ffffff 100%
        );

}


/*
|--------------------------------------------------------------------------
| Global
|--------------------------------------------------------------------------
*/

html {
    min-width: 320px;
}

/*
 * Firefox has no ::-webkit-scrollbar, so it needs the flat standard
 * properties. They are scoped away from Chromium/WebKit on purpose:
 * Chrome 121+ honours scrollbar-color and then ignores every
 * ::-webkit-scrollbar rule, which would flatten the brand gradient
 * back to a single solid colour.
 */
@supports not selector(::-webkit-scrollbar) {

    html {
        scrollbar-color: #1b4f9c #f4f7fd;
        scrollbar-width: thin;
    }

}

body {
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

button,
a,
input,
textarea,
select {
    transition:
        background-color var(--adc-transition-fast),
        border-color var(--adc-transition-fast),
        color var(--adc-transition-fast),
        opacity var(--adc-transition-fast),
        box-shadow var(--adc-transition-fast),
        transform var(--adc-transition-fast);
}


/*
|--------------------------------------------------------------------------
| Accessibility
|--------------------------------------------------------------------------
*/

:focus-visible {
    outline: 2px solid var(--adc-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}


/*
|--------------------------------------------------------------------------
| Selection
|--------------------------------------------------------------------------
*/

::selection {
    background: var(--adc-primary);
    color: #ffffff;
}


/*
|--------------------------------------------------------------------------
| Site Header
|--------------------------------------------------------------------------
*/

#site-header {
    transition:
        box-shadow var(--adc-transition-normal),
        background-color var(--adc-transition-normal);
}

#site-header.header-scrolled {
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.06);
}


/*
|--------------------------------------------------------------------------
| Mobile Menu
|--------------------------------------------------------------------------
*/

#mobile-menu {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

#mobile-menu.is-open {
    display: block;
}

#mobile-menu-toggle[aria-expanded="true"] {
    background-color: #f3f4f6;
    color: #111827;
}


/*
|--------------------------------------------------------------------------
| Search
|--------------------------------------------------------------------------
*/

[data-search-results] {
    max-height: 28rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

[data-search-results]:empty {
    display: none;
}

.search-result-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.search-result-item:hover {
    background-color: #f9fafb;
}

.search-result-item-image {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--adc-radius-md);
    background-color: #f3f4f6;
}

.search-result-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/*
|--------------------------------------------------------------------------
| Product Cards
|--------------------------------------------------------------------------
*/

.product-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--adc-border);
    border-radius: var(--adc-radius-lg);
    background: var(--adc-surface);
}

.product-card:hover {
    border-color: var(--adc-border-dark);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 300ms ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.03);
}

.product-card-title {
    display: -webkit-box;
    overflow: hidden;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card-description {
    display: -webkit-box;
    overflow: hidden;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/*
|--------------------------------------------------------------------------
| Product Price
|--------------------------------------------------------------------------
*/

.product-price {
    font-weight: 700;
    color: var(--adc-text);
}

.product-old-price {
    color: #9ca3af;
    text-decoration: line-through;
}

.product-sale-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background-color: #111827;
    padding: 0.25rem 0.625rem;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1rem;
}


/*
|--------------------------------------------------------------------------
| Rating Stars
|--------------------------------------------------------------------------
*/

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}

.rating-star {
    width: 1rem;
    height: 1rem;
}

.rating-star.is-filled {
    color: #111827;
}

.rating-star.is-empty {
    color: #d1d5db;
}


/*
|--------------------------------------------------------------------------
| Wishlist
|--------------------------------------------------------------------------
*/

.wishlist-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

.wishlist-button.is-active {
    color: #111827;
}

.wishlist-button.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.wishlist-button .wishlist-icon {
    transition:
        transform 180ms ease,
        fill 180ms ease;
}

.wishlist-button.is-active .wishlist-icon {
    fill: currentColor;
}

.wishlist-button.is-active .wishlist-icon {
    transform: scale(1.08);
}


/*
|--------------------------------------------------------------------------
| Cart
|--------------------------------------------------------------------------
*/

[data-cart-item] {
    transition:
        opacity var(--adc-transition-fast),
        background-color var(--adc-transition-fast);
}

[data-cart-item].is-removing {
    opacity: 0.45;
}

[data-cart-item].is-updating {
    opacity: 0.65;
    pointer-events: none;
}

.cart-quantity-control {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--adc-border-dark);
    border-radius: var(--adc-radius-md);
    background-color: #ffffff;
}

.cart-quantity-control button {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
}

.cart-quantity-control button:hover {
    background-color: #f3f4f6;
}

.cart-quantity-control input {
    width: 3rem;
    height: 2.25rem;
    border: 0;
    text-align: center;
    outline: none;
}


/*
|--------------------------------------------------------------------------
| Discount / Coupon
|--------------------------------------------------------------------------
*/

.discount-message,
.coupon-message {
    min-height: 1.25rem;
}

.discount-message.is-success,
.coupon-message.is-success {
    color: var(--adc-success);
}

.discount-message.is-error,
.coupon-message.is-error {
    color: var(--adc-error);
}

.discount-message.is-info,
.coupon-message.is-info {
    color: var(--adc-info);
}


/*
|--------------------------------------------------------------------------
| Forms
|--------------------------------------------------------------------------
*/

.form-error {
    margin-top: 0.375rem;
    color: var(--adc-error);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.form-success {
    margin-top: 0.375rem;
    color: var(--adc-success);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.form-control.is-invalid {
    border-color: #dc2626;
}

.form-control.is-invalid:focus {
    border-color: #dc2626;
    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.12);
}


/*
|--------------------------------------------------------------------------
| Loading State
|--------------------------------------------------------------------------
*/

.is-loading {
    pointer-events: none;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #d1d5db;
    border-top-color: #111827;
    border-radius: 50%;
    animation: adc-spin 700ms linear infinite;
}

@keyframes adc-spin {

    to {
        transform: rotate(360deg);
    }

}


/*
|--------------------------------------------------------------------------
| Flash Messages
|--------------------------------------------------------------------------
*/

[data-flash-message] {
    transform: translateY(0);
    opacity: 1;
    transition:
        opacity 200ms ease,
        transform 200ms ease;
}

[data-flash-message].is-hiding {
    transform: translateY(-0.5rem);
    opacity: 0;
}


/*
|--------------------------------------------------------------------------
| Promotional Popup
|--------------------------------------------------------------------------
*/

[data-popup] {
    opacity: 0;
    transition:
        opacity 200ms ease;
}

[data-popup].is-visible {
    opacity: 1;
}

[data-popup-dialog] {
    transform: translateY(1rem) scale(0.98);
    opacity: 0;
    transition:
        transform 200ms ease,
        opacity 200ms ease;
}

[data-popup].is-visible [data-popup-dialog] {
    transform: translateY(0) scale(1);
    opacity: 1;
}


/*
|--------------------------------------------------------------------------
| Newsletter
|--------------------------------------------------------------------------
*/

[data-newsletter-message].is-success {
    color: var(--adc-success);
}

[data-newsletter-message].is-error {
    color: var(--adc-error);
}

[data-newsletter-message].is-info {
    color: var(--adc-info);
}


/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
*/

[data-pagination] a {
    text-decoration: none;
}


/*
|--------------------------------------------------------------------------
| Breadcrumbs
|--------------------------------------------------------------------------
*/

[aria-label="Breadcrumb"] a {
    text-decoration: none;
}


/*
|--------------------------------------------------------------------------
| Rich Text / Blog Content
|--------------------------------------------------------------------------
*/

.prose-content {
    color: #374151;
    font-size: 1rem;
    line-height: 1.75;
}

.prose-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.prose-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.625rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}

.prose-content p {
    margin-top: 1rem;
}

.prose-content ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
    list-style: disc;
}

.prose-content ol {
    margin-top: 1rem;
    padding-left: 1.5rem;
    list-style: decimal;
}

.prose-content li + li {
    margin-top: 0.375rem;
}

.prose-content a {
    color: #111827;
    text-decoration: underline;
}

.prose-content img {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--adc-radius-lg);
}

.prose-content blockquote {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid #d1d5db;
    padding-left: 1rem;
    color: #4b5563;
}


/*
|--------------------------------------------------------------------------
| Empty States
|--------------------------------------------------------------------------
*/

.empty-state {
    display: flex;
    min-height: 16rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.empty-state-icon {
    display: flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: #f3f4f6;
    color: #6b7280;
}


/*
|--------------------------------------------------------------------------
| Sticky Elements
|--------------------------------------------------------------------------
*/

.sticky-sidebar {
    position: sticky;
    top: 5.5rem;
}


/*
|--------------------------------------------------------------------------
| Prevent Layout Shift
|--------------------------------------------------------------------------
*/

.aspect-product {
    aspect-ratio: 1 / 1;
}

.aspect-banner {
    aspect-ratio: 16 / 6;
}


/*
|--------------------------------------------------------------------------
| Scrollbar
|--------------------------------------------------------------------------
|
| The page scrollbar is the storefront's most persistent piece of
| chrome, so it carries the brand gradient instead of the browser
| default grey.
|
| scrollbar-color is deliberately absent here. Chrome 121+ honours it
| and then ignores every ::-webkit-scrollbar rule, which would flatten
| the gradient back to one solid colour. The flat colours Firefox
| needs live in a scoped @supports block further up, where they cannot
| reach Chromium.
|
*/

html::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

html::-webkit-scrollbar-track {
    background:
        linear-gradient(
            180deg,
            #eef3fb 0%,
            #e2eaf7 45%,
            #d5e1f4 100%
        );
    border-left: 1px solid #c9d6ea;
}

html::-webkit-scrollbar-thumb {
    background: var(--adc-brand-gradient);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        #ef3b45 0%,
        #d8232f 20%,
        #2563eb 60%,
        #143a7d 84%,
        #ffffff 100%
    );
    background-clip: padding-box;
}

html::-webkit-scrollbar-corner {
    background: #f4f7fd;
}


/*
|--------------------------------------------------------------------------
| Back To Top
|--------------------------------------------------------------------------
|
| Fixed to the bottom-right corner, above the footer content, and
| revealed only once the visitor has scrolled past one viewport.
|--------------------------------------------------------------------------
*/

.adc-to-top {
    position: fixed;
    z-index: 900;
    right: 22px;
    bottom: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;
    padding: 0;

    border: 1.5px solid #dbe3f0;
    border-radius: 50%;

    background: var(--adc-brand-gradient);
    color: #ffffff;

    box-shadow: 0 10px 26px rgba(10, 31, 68, .28);

    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.9);

    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 220ms ease,
        box-shadow 220ms ease;
}

.adc-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.adc-to-top:hover {
    box-shadow: 0 14px 32px rgba(10, 31, 68, .38);
    transform: translateY(-3px) scale(1);
}

.adc-to-top:focus-visible {
    outline: 3px solid #d8232f;
    outline-offset: 3px;
}

.adc-to-top svg {
    width: 21px;
    height: 21px;
    stroke-width: 2.4;
}

@media (max-width: 640px) {

    .adc-to-top {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
    }

    html::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

}


/*
|--------------------------------------------------------------------------
| Print
|--------------------------------------------------------------------------
*/

@media print {

    #site-header,
    #mobile-menu,
    [data-popup],
    #flash-messages,
    footer {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    a {
        color: #000000 !important;
        text-decoration: none !important;
    }

}


/*
|--------------------------------------------------------------------------
| Reduced Motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

}