/* This layer is scoped to the storefront; AdminLTE and admin forms remain unchanged. */
:is(.storefront-public, .storefront-preview) {
    font-family: var(--sf-font, "Source Sans Pro", Arial, sans-serif);
    color: var(--sf-text, #343a40);
    background-color: var(--sf-background, #fff);
    letter-spacing: 0;
}
.storefront-public .content-wrapper { background-color: var(--sf-background, #fff); }
:is(.storefront-public, .storefront-preview) .main-header.navbar {
    background-color: var(--sf-header, #fff) !important;
    color: var(--sf-header-text, #212529);
}
.storefront-public .main-header .nav-link,
.storefront-public .main-header .nav-link .text-muted,
.storefront-public .main-header .nav-link.text-dark { color: var(--sf-header-text, #212529) !important; }
.storefront-public .main-header .nav-link i,
.storefront-public .main-header .nav-link .text-dark { color: var(--sf-icons, #000) !important; }
:is(.storefront-public, .storefront-preview) .custom-brand {
    height: max(70px, calc(var(--sf-logo-height, 45px) + 24px));
}
:is(.storefront-public, .storefront-preview) .custom-brand .brand-image {
    float: none;
    height: var(--sf-logo-height, 45px);
    max-height: var(--sf-logo-height, 45px);
    max-width: calc(100% - 24px);
    width: auto;
    margin: 0;
    object-fit: contain;
}
:is(.storefront-public, .storefront-preview) .aly-footer {
    background-color: var(--sf-footer, #f8f9fa);
    color: var(--sf-footer-text, #212529);
    font-family: inherit;
}
.storefront-public .aly-footer h5,
.storefront-public .aly-footer-info,
.storefront-public .aly-copyright { color: var(--sf-footer-text, #212529); }
.storefront-public .aly-footer a,
.storefront-public .aly-footer ul li a,
.storefront-public .aly-footer-info i { color: var(--sf-footer-link, #666); }
.storefront-public .aly-footer a:hover,
.storefront-public .aly-footer ul li a:hover { color: var(--sf-footer-hover, #ff4747); }
:is(.storefront-public, .storefront-preview) .btn-add-cart,
:is(.storefront-public, .storefront-preview) .btn-primary {
    background: var(--sf-button, #e74c3c);
    border-color: var(--sf-button, #e74c3c);
    color: var(--sf-button-text, #fff);
}
:is(.storefront-public, .storefront-preview) .btn-add-cart:hover,
:is(.storefront-public, .storefront-preview) .btn-primary:hover { filter: brightness(.93); }
:is(.storefront-public, .storefront-preview) .product-title {
    color: var(--sf-text, #343a40);
    overflow-wrap: anywhere;
}
:is(.storefront-public, .storefront-preview) .product-card:hover .product-title { color: var(--sf-brand, #e74c3c); }
:is(.storefront-public, .storefront-preview) .product-price,
:is(.storefront-public, .storefront-preview) .product-card:hover .product-price,
.storefront-public #product-price {
    color: var(--sf-price, #2c3e50) !important;
    background: none;
    -webkit-text-fill-color: currentColor;
}
:is(.storefront-public, .storefront-preview) .sf-product-col {
    flex: 0 0 calc(100% / var(--sf-columns-mobile, 2));
    max-width: calc(100% / var(--sf-columns-mobile, 2));
    min-width: 0;
}
@media (min-width: 768px) {
    .storefront-public .sf-product-col { flex-basis: calc(100% / var(--sf-columns-tablet, 4)); max-width: calc(100% / var(--sf-columns-tablet, 4)); }
}
@media (min-width: 1200px) {
    .storefront-public .sf-product-col { flex-basis: calc(100% / var(--sf-columns-desktop, 4)); max-width: calc(100% / var(--sf-columns-desktop, 4)); }
}
:is(.storefront-public, .storefront-preview) .product-img-top { object-fit: var(--sf-image-fit, contain); }
:is(.storefront-public, .storefront-preview)[data-sf-fit="cover"] .product-img-top:not(.error) { padding: 0; }
:is(.storefront-public, .storefront-preview)[data-sf-ratio]:not([data-sf-ratio="current"]) .sf-product-col .product-image-container {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: var(--sf-image-ratio);
    display: block;
}
:is(.storefront-public, .storefront-preview)[data-sf-ratio]:not([data-sf-ratio="current"]) .sf-product-col .product-img-top {
    position: absolute;
    inset: 0;
}
:is(.storefront-public, .storefront-preview) .sf-product-code,
:is(.storefront-public, .storefront-preview) .sf-product-availability {
    display: block;
    overflow-wrap: anywhere;
    font-size: .75rem;
    color: var(--sf-text, #343a40);
}
[data-sf-show-code="0"] .sf-product-code,
[data-sf-show-availability="0"] .sf-product-availability,
[data-sf-show-badges="0"] .offer-badge,
[data-sf-show-badges="0"] .discount-percentage-badge,
[data-sf-show-notice="0"] .ecommerce-product-notice { display: none !important; }
:is(.storefront-public, .storefront-preview)[data-sf-style="minimal"] .product-card {
    border: 1px solid #e3e6e8 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    animation: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-style="commercial"] .product-card {
    border: 1px solid #dedfe2 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.07) !important;
    animation: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-style]:not([data-sf-style="current"]) .product-card:hover { transform: translateY(-2px); }
:is(.storefront-public, .storefront-preview)[data-sf-style]:not([data-sf-style="current"]) .product-image-container { border-radius: inherit; }
:is(.storefront-public, .storefront-preview)[data-sf-style="commercial"] .product-title { font-weight: 700; }
:is(.storefront-public, .storefront-preview)[data-sf-style="minimal"] .offer-badge { animation: none; border-radius: 4px; }
.sf-settings-section { padding-top: 20px; margin-top: 20px; border-top: 1px solid #dee2e6; }
.sf-settings-section h5 { font-size: 1.1rem; }
.sf-settings-section .form-control { min-width: 0; }
.sf-preview-frame { max-width: 580px; border: 1px solid #dee2e6; border-radius: 4px; overflow: hidden; }
.sf-preview-frame .sf-preview-header { background: var(--sf-header); color: var(--sf-header-text); padding: 12px; display: flex; align-items: center; gap: 16px; }
.sf-preview-frame .sf-preview-header img { height: var(--sf-logo-height); max-width: 160px; object-fit: contain; }
.sf-preview-frame .row { margin: 0; padding-top: 12px; }
.sf-preview-frame .aly-footer { padding: 12px; }
@media (prefers-reduced-motion: reduce) {
    .storefront-public .product-card, .storefront-public .offer-badge, .storefront-public .brand-image { animation: none !important; transition: none !important; }
}
.sf-detail-note { white-space: pre-line; overflow-wrap: anywhere; }
#sf-detail-shipping, #sf-detail-warranty, #sf-detail-stock { max-width: 60%; white-space: pre-line; overflow-wrap: anywhere; text-align: right; margin-left: 12px; }
.aly-footer .sf-footer-logo { display: block; max-width: 100%; width: auto; height: var(--sf-logo-height, 45px); object-fit: contain; margin-bottom: 16px; }
.aly-footer p, .aly-footer a, .aly-footer h5 { overflow-wrap: anywhere; }
.sf-home-section { min-width: 0; scroll-margin-top: 100px; }

/* Category styles are shared with the appearance preview, without per-card scripts. */
:is(.storefront-public, .storefront-preview) .custom-carousel { background: transparent; padding: 10px 0; }
:is(.storefront-public, .storefront-preview) .category-card { display: block; text-decoration: none !important; border-radius: 12px; }
:is(.storefront-public, .storefront-preview) .category-img-wrapper {
    position: relative; border-radius: 12px; overflow: hidden; height: 180px; background: #f4f4f4;
    transition: transform .4s cubic-bezier(.165, .84, .44, 1), box-shadow .4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .05);
}
:is(.storefront-public, .storefront-preview) .category-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease;
}
:is(.storefront-public, .storefront-preview) .category-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, var(--sf-category-overlay-opacity, .7)));
    color: var(--sf-category-text, #fff); text-align: center; transition: color .18s ease;
}
:is(.storefront-public, .storefront-preview) .category-overlay span {
    color: inherit; font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: 1px;
    overflow-wrap: anywhere; text-shadow: var(--sf-category-text-shadow, none);
}
:is(.storefront-public, .storefront-preview) .category-card:focus-visible { outline: 3px solid #212529; outline-offset: 2px; }
:is(.storefront-public, .storefront-preview) .category-card:focus-visible .category-img-wrapper { outline: 3px solid #fff; outline-offset: -5px; }
:is(.storefront-public, .storefront-preview) .category-card:focus-visible .category-overlay { color: var(--sf-category-hover, #fff); }
.storefront-public #categories-carousel .custom-ctrl {
    width: 40px; height: 40px; padding: 0; border: 0; background: #fff; border-radius: 50%;
    top: 50%; transform: translateY(-50%); color: #333; opacity: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1); transition: opacity .18s ease;
}
.storefront-public #categories-carousel .custom-ctrl[hidden] { display: none; }
.storefront-public #categories-carousel:hover .custom-ctrl,
.storefront-public #categories-carousel:focus-within .custom-ctrl { opacity: 1; }
.storefront-public #categories-carousel .custom-ctrl:focus-visible { outline: 3px solid #212529; outline-offset: 2px; }
.storefront-public #categories-carousel .carousel-control-prev { left: -20px; }
.storefront-public #categories-carousel .carousel-control-next { right: -20px; }
.storefront-public #categories-carousel .custom-ctrl i { color: #333; font-size: 1.2rem; }
@media (hover: hover) and (pointer: fine) {
    :is(.storefront-public, .storefront-preview) .category-card:hover .category-img-wrapper {
        transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0, 0, 0, .15);
    }
    :is(.storefront-public, .storefront-preview) .category-card:hover img { transform: scale(1.1); }
    :is(.storefront-public, .storefront-preview) .category-card:hover .category-overlay { color: var(--sf-category-hover, #fff); }
}
@media (hover: none), (pointer: coarse) {
    .storefront-public #categories-carousel .custom-ctrl { opacity: 1; width: 44px; height: 44px; }
    .storefront-public #categories-carousel .carousel-control-prev { left: 0; }
    .storefront-public #categories-carousel .carousel-control-next { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.storefront-public, .storefront-preview) .category-img-wrapper,
    :is(.storefront-public, .storefront-preview) .category-img-wrapper img,
    :is(.storefront-public, .storefront-preview) .category-overlay,
    .storefront-public #categories-carousel .carousel-item { transition: none !important; }
    :is(.storefront-public, .storefront-preview) .category-card:hover .category-img-wrapper,
    :is(.storefront-public, .storefront-preview) .category-card:hover img { transform: none; }
}
.sf-preview-category { padding: 12px; max-width: 300px; }
.storefront-public .sf-detail-actions { gap: 10px 0; }
@media (max-width: 575px) {
    .storefront-public .sf-detail-actions > .btn { width: 100%; margin-right: 0 !important; }
}

.presentation-choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.presentation-choice {
    position: relative;
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 76px;
    padding: 11px 13px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.presentation-choice:hover:not(:disabled) {
    border-color: #6b7280;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
}

.presentation-choice.is-selected {
    border-color: #198754;
    background: #f0fdf4;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .14);
}

.presentation-choice.is-selected::after {
    content: "\2713";
    position: absolute;
    top: 8px;
    right: 10px;
    color: #198754;
    font-weight: 700;
}

.presentation-choice:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.presentation-choice__name,
.presentation-choice__price,
.presentation-choice__stock {
    display: block;
    padding-right: 18px;
}

.presentation-choice__name { font-weight: 700; }
.presentation-choice__price { color: #111827; font-weight: 600; }
.presentation-choice__stock { color: #6b7280; font-size: .78rem; }
.cart-presentation-options { grid-template-columns: 1fr; max-height: 230px; overflow-y: auto; padding: 2px; }

/* Optional storefront themes. Current stores keep the preceding styles unchanged. */
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-card {
    border: 1px solid var(--sf-theme-border) !important;
    border-radius: var(--sf-theme-radius) !important;
    box-shadow: none !important;
    background: #fff;
    animation: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-card:hover {
    transform: none !important;
    border-color: var(--sf-brand) !important;
    box-shadow: var(--sf-theme-hover-shadow) !important;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-info {
    padding: var(--sf-theme-padding) !important;
    display: flex; flex-direction: column; flex: 1;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-info > .d-flex:last-child {
    margin-top: auto !important; padding-top: 12px; gap: 8px; flex-wrap: wrap;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-title {
    display: block; -webkit-line-clamp: unset; overflow: visible; min-height: 2.6em;
    font-size: var(--sf-theme-title-size); font-weight: var(--sf-theme-title-weight); line-height: 1.45; letter-spacing: var(--sf-theme-title-spacing, 0);
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .sf-product-col .product-image-container {
    height: auto; min-height: 0; max-height: none; display: block;
    aspect-ratio: var(--sf-image-ratio); border-radius: 0; background: var(--sf-theme-surface, #f8f9fb);
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .sf-product-col .product-img-top {
    position: absolute; inset: 0;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"])[data-sf-fit="contain"] .product-img-top {
    padding: var(--sf-theme-image-padding);
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .btn-add-cart {
    border-radius: var(--sf-theme-radius); box-shadow: none; transform: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .offer-badge,
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .discount-percentage-badge {
    animation: none; border-radius: 4px;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .category-img-wrapper {
    height: var(--sf-theme-category-height); border-radius: var(--sf-theme-radius); box-shadow: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .category-card:hover .category-img-wrapper,
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .category-card:hover img {
    transform: none;
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .main-header.navbar {
    box-shadow: none !important; border-bottom: 1px solid var(--sf-theme-border) !important;
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .custom-brand .brand-image { animation: none; }
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .sf-product-detail > .card {
    border: 1px solid var(--sf-theme-border); border-radius: var(--sf-theme-radius) !important; box-shadow: none !important;
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .sf-product-detail > .card > .card-body {
    padding: var(--sf-theme-padding);
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .product-gallery-stage,
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .product-gallery-thumb {
    border-radius: var(--sf-theme-radius); background: var(--sf-theme-surface, #f8f9fb);
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .sf-product-detail .price-container {
    background: var(--sf-theme-surface, #f8f9fb) !important; border: 1px solid var(--sf-theme-border); border-radius: var(--sf-theme-radius) !important;
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) #product-name {
    font-size: 1.6rem; font-weight: 600 !important; overflow-wrap: anywhere;
}
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) #product-description { line-height: 1.7 !important; }
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .sf-detail-actions .btn {
    border-radius: var(--sf-theme-radius) !important; box-shadow: none !important; white-space: normal;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice-list {
    grid-template-columns: var(--sf-theme-choice-columns); gap: var(--sf-theme-gap);
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice {
    border-radius: var(--sf-theme-radius); border-color: var(--sf-theme-border); min-height: 76px; min-width: 0; overflow-wrap: anywhere;
    padding-top: var(--sf-theme-choice-padding); padding-bottom: var(--sf-theme-choice-padding); box-shadow: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice:hover:not(:disabled) {
    border-color: var(--sf-brand); box-shadow: none;
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice.is-selected {
    background: var(--sf-theme-surface, #f8f9fb); border-color: var(--sf-brand); box-shadow: inset 3px 0 0 var(--sf-brand);
}
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice.is-selected::after { color: var(--sf-brand); }
:is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice__price { color: var(--sf-price); }
.storefront-public[data-sf-theme]:not([data-sf-theme="current"]) .cart-presentation-options { grid-template-columns: 1fr; }
.sf-preview-presentations { padding: 16px; }
@media (max-width: 575px) {
    :is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-info { padding: 12px !important; }
    :is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .product-title { font-size: .85rem; }
    :is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .presentation-choice-list { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
    :is(.storefront-public, .storefront-preview)[data-sf-theme]:not([data-sf-theme="current"]) .btn-add-cart { min-width: 44px; min-height: 44px; }
}
