/* =====================================================================
 *   Additional Updates / UX Improvements
 * =================================================================== */

/* -----------------------------------------------------------------------
 * 1. Smooth scroll — enables native smooth scrolling for anchor links
 * --------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

/* -----------------------------------------------------------------------
 * 2. Accessibility focus ring — visible only for keyboard navigation
 * --------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--theme-color-1, #f5a623);
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------
 * 3. Product card hover transition — applied globally to box-preview cards
 * --------------------------------------------------------------------- */
.box-preview,
.box-product-2 {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.box-preview:hover,
.box-product-2:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* -----------------------------------------------------------------------
 * 4. Image loading skeleton placeholder
 *    Applied automatically while <img> src is loading via background
 * --------------------------------------------------------------------- */
.box-img img,
.box-preview .box-img img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    min-height: 10px;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* -----------------------------------------------------------------------
 * 5. Back-to-top button — ensures it is visible and properly styled
 * --------------------------------------------------------------------- */
#back-to-top,
.scroll-top-icon.scroll-top {
    position: fixed;
    bottom: 30px;
    left: 30px;   /* RTL: left side */
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    background: var(--theme-color-1, #2487ed);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    font-size: 18px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    z-index: 9999;
}

#back-to-top.visible,
.scroll-top-icon.scroll-top.show,
.scroll-top-icon.scroll-top[style*="display: block"],
.scroll-top-icon.scroll-top[style*="display:block"] {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover,
.scroll-top-icon.scroll-top:hover {
    transform: translateY(-3px);
    background: var(--theme-color-1-1, #1273d7);
}

/* -----------------------------------------------------------------------
 * 6. Newsletter input — ensure the email input type is visually clear
 * --------------------------------------------------------------------- */
#form-email-subscribe input[type="email"],
#form-email-subscribe input[type="text"] {
    border-radius: 4px 0 0 4px;
    border: 1px solid #ddd;
}

#form-email-subscribe button[type="submit"] {
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 600;
}

/* -----------------------------------------------------------------------
 * 7. Social icon links — ensure min tap target size for mobile (44px)
 * --------------------------------------------------------------------- */
.social-icons li a {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* -----------------------------------------------------------------------
 * 8. Hamburger / categories button — keyboard visible
 * --------------------------------------------------------------------- */
.btn-dropdown-categories:focus-visible {
    outline: 2px solid var(--theme-color-1, #2487ed);
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------
 * 9. Product item hover (generic class used in some templates)
 * --------------------------------------------------------------------- */
.product-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* -----------------------------------------------------------------------
 * 10. Minimum tap target for all interactive elements
 * --------------------------------------------------------------------- */
.btn, button, [role="button"] { min-height: 44px; }

/* -----------------------------------------------------------------------
 * 11. Responsive images — prevent overflow in any container
 * --------------------------------------------------------------------- */
img { max-width: 100%; height: auto; }

/* -----------------------------------------------------------------------
 * 12. Skeleton loading utility class
 * --------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* -----------------------------------------------------------------------
 * 13. Mobile improvements
 * --------------------------------------------------------------------- */
@media (max-width: 767px) {
    .header-bar-wrap { flex-wrap: wrap; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
