/* UI Polish / Utility Layer (loaded last)
   Focus: spacing consistency, card refinement, accessibility focus states, truncation helpers.
*/
:root {
    --yw-focus-ring: 0 0 0 3px rgba(254, 76, 80, .4);
    --yw-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* General improvements */
body {
    -webkit-font-smoothing: antialiased;
}

/* Focus ring for key interactive elements */
.navbar a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-search-toggle:focus-visible {
    outline: none !important;
    box-shadow: var(--yw-focus-ring);
}

/* Hover elevation */
.card-hover-elevate {
    transition: box-shadow var(--yw-transition), transform var(--yw-transition);
}

.card-hover-elevate:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

/* Title clamp utilities (line-height ~1.2) */
.title-clamp-2,
.title-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.title-clamp-2 {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 2.4em;
}

.title-clamp-3 {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: 3.6em;
}

/* Truncate multi-line small text */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Subtle button variant */
.btn-soft-primary {
    color: var(--theme-color);
    background: rgba(254, 76, 80, .12);
    border: 1px solid rgba(254, 76, 80, .4);
}

.btn-soft-primary:hover {
    background: rgba(254, 76, 80, .18);
    color: var(--theme-color);
}

/* Spacing helpers */
.mt-1h {
    margin-top: .375rem !important;
}

.mb-1h {
    margin-bottom: .375rem !important;
}

.gap-1 {
    gap: .25rem;
}

.gap-2 {
    gap: .5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Image helpers */
.img-cover {
    object-fit: cover;
}

.rounded-6 {
    border-radius: 6px;
}

/* Product card refinement */
.product-card .card-body {
    display: flex;
    flex-direction: column;
}

.product-card .card-title a {
    transition: color var(--yw-transition);
}

.product-card .card-title a:focus-visible {
    box-shadow: var(--yw-focus-ring);
    border-radius: 3px;
    outline: none;
}

.discount-badge {
    font-size: .75rem;
    padding: .35rem .5rem;
    letter-spacing: .5px;
}

/* Wishlist / cart mini buttons standard size */
.product-card form button.btn-sm,
.product-card form a.btn-sm {
    min-width: 52px;
}

/* Utilities for inline style replacements */
/* Product/gallery thumbnails */
.thumb-wrap {
    width: 120px;
}

.thumb-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.minh-title-2 {
    min-height: 2.4em;
}

.minh-desc-2 {
    min-height: 2.3em;
}

.fs-095 {
    font-size: .95rem !important;
}

.lh-12 {
    line-height: 1.2 !important;
}

/* Newsletter notification container resilience */
.newsletter-notif {
    transition: opacity var(--yw-transition), transform var(--yw-transition);
}

/* Table column width helpers */
.col-w-35 {
    width: 35%;
}

.col-w-15 {
    width: 15%;
}

.col-w-25 {
    width: 25%;
}

.col-w-30 {
    width: 30%;
}

/* Fixed pixel column widths */
.col-w-40px {
    width: 40px;
}

.col-w-70px {
    width: 70px;
}

.col-w-120px {
    width: 120px;
}

/* Social icon circle */
.social-icon-circle {
    background: #1e1e27;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slider row gaps override using utility class instead of inline style */
.flex-gap-15 {
    gap: 1.5rem;
}

/* Smooth fade-in for dynamically injected product cards */
.product-card-wrapper {
    animation: productCardFade .25s ease;
}

@keyframes productCardFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wishlist thumbnail */
.wishlist-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Horizontal slider card sizing (home new arrivals etc.) */
.slider-item {
    min-width: 260px;
    max-width: 300px;
    margin-bottom: 1rem;
}

@media (max-width:576px) {
    .slider-item {
        min-width: 170px !important;
        max-width: 200px !important;
    }
}

/* Responsive adjustments */
@media (max-width:575.98px) {
    .product-card .card-title a {
        font-size: .92rem;
    }

    .discount-badge {
        top: 6px;
        left: 6px;
    }
}

/* Width utilities & tiny badge */
.w-180 {
    max-width: 180px !important;
}

.w-160 {
    max-width: 160px !important;
}

.w-200 {
    max-width: 200px !important;
}

.badge-tiny {
    font-size: .75rem;
}

.nowrap {
    white-space: nowrap !important;
}

img.logo-preview {
    max-height: 70px;
    height: auto;
    width: auto;
}

/* Admin/product form & media utilities */
.w-140 {
    max-width: 140px !important;
    width: 140px !important;
}

.img-prev-160x120 {
    max-width: 160px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.img-thumb-120x90 {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
}

.img-square-42 {
    width: 42px;
    height: 42px;
    object-fit: cover;
}

.img-square-48 {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

/* Badge size variants */
.badge-sm {
    font-size: .85rem;
}

/* Pre / text whitespace helpers */
.pre-wrap {
    white-space: pre-wrap !important;
}

.pre-wrap-sm {
    white-space: pre-wrap !important;
    font-family: inherit;
    font-size: .9rem;
}

/* Scroll container utilities */
.scroll-y-480 {
    max-height: 480px;
    overflow: auto;
}