/* === ELEGANT GLASS NAVIGATION BAR === */
#main-header-new {
    /* Glassmorphism Effect */
    background: rgba(var(--bs-body-bg-rgb), 0.75);
    /* Semi-transparent background using Bootstrap's theme color */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* Subtle border to define the edge */
    border-bottom: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.1);

    /* Remove default navbar shadow and let the glass effect provide depth */
    box-shadow: none;
}

/* Ensure dropdowns match the glass style */
.navbar .dropdown-menu {
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(var(--bs-body-bg-rgb), 0.85);
}

/* --- Fix for Long Dropdown Menus on Mobile --- */
@media (max-width: 991.98px) {

    /* Target devices smaller than large (where navbar collapses) */
    .navbar-nav .dropdown-menu {
        max-height: 60vh;
        /* Set a maximum height (e.g., 60% of the viewport height) */
        overflow-y: auto;
        /* Add a vertical scrollbar when content overflows */
        /* Add a subtle fade at the bottom to indicate scrollability */
        -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    }

    /* Fix for the main navbar container not being scrollable on mobile when a dropdown is open */
    .navbar-collapse {
        max-height: calc(100vh - 80px);
        /* Adjust 80px based on your navbar's approximate height */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS devices */
    }
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Smoother Header Transitions */
#main-header {
    padding: .1rem 0;
    /* This enables smooth animation for the transform and opacity properties */
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    transform: translateY(0);
    opacity: 1;
}

#main-header.header-hidden {
    /* This slides the header up and out of view and fades it out */
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    /* Important: prevents interaction with the hidden header */
}

/* Sale Announcement Bar Styling */
#sale-announcement-bar {
    /* Fallback background color. The actual color is set by JavaScript. */
     /* Christmas-themed gradient: from a festive red to a deep green */
    /* background: linear-gradient(135deg, #d92525, #1e6b34); */
    /* --- Christmas Color Options --- */
    /* Option 1: Festive Red to Gold */
    background: linear-gradient(135deg, #c81d25, #f5a623);
    /* Option 2 (Original): Festive Red to Deep Green */
    /* background: linear-gradient(135deg, #d92525, #1e6b34); */
    color: white;
    text-shadow: var(--text-menu-color-shadow);
    padding: 5px 10px;
    position: relative;
    top: 57px;
    overflow: hidden;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* On screens smaller than 768px */
@media (max-width: 767.98px) {
    #sale-announcement-bar { 
        margin-top: 5px;
        padding: 8px 10px;
    }
}

/* Shimmer effect for the announcement bar */
#sale-announcement-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 300%;
    height: 100%;
    /* A slightly more visible shimmer for the blue background */
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
    /* The animation name is now controlled by a CSS variable set in JavaScript */
    animation: var(--shimmer-animation, shimmer) 5s infinite linear;
    pointer-events: none;
    z-index: 1; /* Position it above the background but below the text content */
}

/* This class will be added via JavaScript on scroll */
.announcement-bar-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1031;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* --- New Flipper/Fade Animation for Announcement Bar --- */
.announcement-flipper {
    flex-grow: 1;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure the text is on top of the snowflakes */
    position: relative;
    z-index: 3;
}

.announcement-message {
    font-family: 'DM Serif Text', serif;
    font-weight: 700; /* Bolder text for better readability */
    font-size: 1rem;
    width: 100%;
    text-align: center;
    /* Add a subtle shadow to make the text pop */
    /* A stronger shadow for more contrast against the dynamic background */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* --- Responsive Layout for Mobile --- */
@media (max-width: 991.98px) {
    #sale-announcement-bar {
        /* Position it below the header on mobile */
        top: 52px; /* Adjust this value to match your header's height */
    }
}

/* --- Snowflake Animation for Announcement Bar --- */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Position above the shimmer but below the close button */
}

.snowflake {
    position: absolute;
    top: -10%;
    color: #fff; /* Fallback color */
    font-size: 1em;
    font-family: Arial, sans-serif;
    /* Apply two separate animations: one for falling, one for twinkling */
    /* animation: var(--fall-animation, fall) linear infinite, twinkle linear infinite; */
    animation: var(--fall-animation, fall) linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0; /* Start invisible */
    }
    10% {
        opacity: 1; /* Fade in */
    }
    100% {
        /* Move it past the bottom of the container to ensure it disappears completely */
        transform: translateY(120%) translateX(0) rotate(360deg);
        opacity: 0; /* Fade out at the end */
    }
}

/* New animation for falling with a left drift */
@keyframes fall-left {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(120%) translateX(-30px) rotate(270deg);
        opacity: 0;
    }
}

/* New animation for falling with a right drift */
@keyframes fall-right {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(120%) translateX(30px) rotate(450deg);
        opacity: 0;
    }
}

/* New animation for the twinkle effect */
@keyframes twinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}


#close-announcement-btn {
    position: relative;
    /* Changed from absolute */
    flex-shrink: 0;
    /* Prevent the button from shrinking */
    margin-left: 8px;
    /* Add some space between the text and the button */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 5px;
    z-index: 2;
}

#close-announcement-btn:hover {
    opacity: 1;
}

/* --- Skeleton Loader Styles --- */
.skeleton-loader {
    /* Use a subtle animation to indicate loading */
    animation: skeleton-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    /* Use theme-aware background color */
    background-color: var(--background-color);
    border-radius: 50%;
}

.skeleton-line {
    height: 1rem;
    background-color: var(--background-color);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

#sale-announcement-modal .modal-content {
    background: linear-gradient(135deg, #ff00cc, #ff8800, #00cfff, #8e2de2);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    color: white;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.sale-modal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.sale-modal .modal-body ol {
    padding-left: 1.25rem;
}

.sale-modal .modal-body ol li {
    margin-bottom: 0.75rem;
}

.sale-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sale-modal .btn {
    min-width: 120px;
}

/* --- Floating Store Reaction Styles --- */
.store-reactions-container {
    /* position: fixed;
     top: 40%;
     left: 0; */
    z-index: 999;
    /* Above most content */
    display: flex;
    flex-direction: row;
    gap: 0.1rem;
    /* Space between buttons */
    transition: transform 0.4s ease-in-out;
}

/* Slide it completely off-screen to the left */
.store-reactions-container--hidden {
    transform: translateX(-150%);
}

.reaction-btn {
    /* background: var(--bs-tertiary-bg); */
    background: transparent;
    /* border: 1px solid var(--bs-border-color-translucent); */
    /* border-radius: 50%; */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    max-width: 50px;
    max-height: 50px;
    padding: 0rem .2rem;
    margin: .1rem 0rem .3rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reaction-btn .emoji {
    font-size: 1rem;
    transition: transform 0.2s ease-in-out;
}

.reaction-btn:hover .emoji {
    transform: scale(1.2);
}

.reaction-btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--bs-primary-bg-subtle);
}

.reaction-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.reaction-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.reaction-btn.reacted {
    /* border-color: var(--bs-success-border-subtle); */
    /* background-color: var(--bs-success-bg-subtle); */
    transform: scale(1.1);
}

.reaction-count {
    color: var(--text-color);
    vertical-align: middle;
    border: 1 solid var(--bs-primary-text);
    font-size: .8rem;
    margin-top: -0.25rem;
}

.store-reviews-container {
    z-index: 999;
    display: flex;
    flex-direction: row;
    margin-left: .1rem;
    padding: 0;
    transition: transform 0.4s ease-in-out;
}

.star-rating-count {
    color: var(--text-color);
    vertical-align: middle;
    border: 1 solid var(--bs-primary-text);
    font-size: .8rem;
    margin-top: -0.5rem;
    padding: 0;
}

/* Custom Popover for Rating Summary */
.rating-summary-popover-container {
    --bs-popover-max-width: 300px;
    --bs-popover-border-color: var(--bs-primary);
    --bs-popover-header-bg: var(--bs-primary);
    --bs-popover-header-color: var(--bs-white);
    --bs-popover-body-padding-x: 1rem;
    --bs-popover-body-padding-y: 0.75rem;
}

.sale-streamer-banner {
    --bg-light: linear-gradient(90deg, #f8f9fa, #e9ecef);
    --bg-dark: linear-gradient(90deg, #1a1a1a, #2c2c2c);
    --text-light: #212529;
    --text-dark: #f1f1f1;

    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.6rem 0;
    position: relative;
    z-index: 1030;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

/* Shimmer effect */
.sale-streamer-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 300%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 6s infinite linear;
    pointer-events: none;
    z-index: 0;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 100%;
    }
}

.sale-streamer-track {
    display: flex;
    align-items: center;
    animation: scroll-left 20s linear infinite;
    position: relative;
    z-index: 1;
}

.sale-streamer-content {
    padding-left: 100%;
    display: inline-block;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@media (prefers-color-scheme: dark) {
    .sale-streamer-banner {
        background: var(--bg-dark);
        color: var(--text-dark);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    }

    .sale-streamer-banner::before {
        background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    }
}

.zoom-animate {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.show .zoom-animate {
    opacity: 1;
    transform: scale(1);
}

/* --- Global Image Gallery Modal Styles --- */
/* --- Global Image Gallery Modal Styles (Smaller Version) --- */
#imageGalleryModal .modal-dialog {
    max-width: 600px;
    /* A more standard modal width */
    margin: 1.75rem auto;
    /* Default Bootstrap margin */
}

#imageGalleryModal .modal-content {
    background-color: #212529;
    /* A dark background for the content */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

#imageGalleryModal .modal-body {
    padding: 0;
}

/* Ensure the carousel and its items fill the modal body */
/* #imageGalleryModal .carousel,
#imageGalleryModal .carousel-inner,
#imageGalleryModal .carousel-item {
} */

/* Ensure images fit within the carousel without being distorted and have a max height */
#imageGalleryModal .carousel-item img {
    object-fit: contain;
    width: 100%;
    height: auto;
    /* Let height be determined by aspect ratio */
    max-height: 75vh;
    /* Limit the max height to 75% of viewport height */
    border-radius: 0.5rem 0.5rem 0 0;
    /* Round top corners to match modal */
}

/* Remove the unnecessary header style */
#imageGalleryModal .modal-header {
    display: none;
    /* We don't need a header for this simple gallery */
}

#imageGalleryModal .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    filter: invert(1) grayscale(100%) brightness(200%);
    /* Makes it white */
    opacity: 0.75;
}

#imageGalleryModal .btn-close:hover {
    opacity: 1;
}

/* Style carousel controls for better visibility */
#imageGalleryModal .carousel-control-prev-icon,
#imageGalleryModal .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 1.5rem;
}

/* Define the custom property for the angle to enable smooth animation */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateGradient {
    to {
        --angle: 360deg;
    }
}

/* Style for highlighting a shared review */
.highlight-shared-review {
    position: relative;
    /* Required for the pseudo-element positioning */
    border: 2px solid transparent !important;
    /* This transparent border will be the "window" to the gradient */
    border-radius: 0.5rem;
    /* A slightly larger radius for a softer look */
    background-color: var(--bs-body-bg);
    /* Ensure the card background is solid, matching the page */
    background-clip: padding-box;
    /* This is crucial: it keeps the background from extending under the border */
    transition: box-shadow 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.highlight-shared-review::before {
    content: '';
    position: absolute;
    inset: -2px;
    /* This must be the negative of the border-width above */
    z-index: -1;
    border-radius: inherit;
    /* Match the parent's border-radius */
    background: conic-gradient(from var(--angle), #FF5733, #FFD700, #62c462, #5bc0de, #6f42c1, #FF5733);
    animation: rotateGradient 4s linear infinite;
}

/* You can replace the old quantity selector styles in public/assets/css/_custom_styles.css with this */

/* --- Modern Quantity Selector (Pill Style) --- */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the whole component if its container allows */
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 2rem;
    /* Fully rounded "pill" shape */
    overflow: hidden;
    /* Ensures children conform to the rounded corners */
    background-color: var(--bs-body-bg);
    width: fit-content;
    /* Make the container only as wide as its content */
}

.quantity-input {
    width: 45px !important;
    height: 32px;
    /* Match button height */
    text-align: center;
    border: none;
    /* Remove individual borders */
    background-color: transparent;
    /* Inherit background */
    color: var(--bs-body-color);
    box-shadow: none !important;
    padding: 0.25rem;
    -moz-appearance: textfield;
    /* Vendor prefix for older Firefox */
    /* Hides spinners in Firefox */
    appearance: textfield;
    /* Standard property */
}

/* Hide spinners on number inputs for a cleaner look in Chrome, Safari, etc. */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-selector .quantity-btn {
    background-color: transparent;
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--bs-secondary-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.quantity-selector .quantity-btn:hover {
    background-color: var(--bs-secondary-bg-subtle);
    color: var(--bs-emphasis-color);
}

.quantity-selector .quantity-btn:focus {
    box-shadow: none;
    outline: none;
}

/* Add subtle separators */
.quantity-selector .quantity-btn:first-child {
    border-right: 1px solid var(--bs-border-color-translucent);
}

.quantity-selector .quantity-btn:last-child {
    border-left: 1px solid var(--bs-border-color-translucent);
}

/* --- Quantity Selector Animation --- */
@keyframes selector-pop {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }

    50% {
        transform: scale(1.05);
        /* A subtle pop */
        box-shadow: 0 0 8px rgba(var(--bs-primary-rgb), 0.5);
        /* A temporary glow */
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

.quantity-selector.value-changed {
    animation: selector-pop 0.4s ease-out;
}

/* --- Add to Bag Button Animation --- */
.add-to-cart-button {
    /* Ensure smooth transitions for color and size changes */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-to-cart-button.item-added {
    /* Use Bootstrap's success color for a clear visual cue */
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
    transform: scale(1.03);
    /* A subtle "pop" effect */
}

.add-to-cart-button.item-added .bi-check-lg {
    /* Animate the checkmark icon for extra flair */
    animation: fade-in-pop 0.4s ease-out;
}

@keyframes fade-in-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Flying Image Animation --- */
.flying-image {
    position: fixed;
    /* Use fixed positioning for viewport-relative movement */
    z-index: 1090;
    /* High z-index to fly over everything */
    border-radius: 10%;
    /* Slightly rounded corners during flight */
    object-fit: cover;
    opacity: 1;
    /* Define the transition properties for a smooth, curved flight */
    transition: top 0.7s cubic-bezier(0.29, 0.52, 0.76, 0.06),
        left 0.7s cubic-bezier(0.1, 0.5, 0.1, 1),
        width 0.7s ease-in,
        height 0.7s ease-in,
        opacity 0.5s 0.2s ease-out;
    /* Fade out in the last part of the animation */
}

/* --- Floating Cart Animation --- */
.floating-cart.animate-cart {
    /* A more noticeable "shake" or "jiggle" animation */
    animation: cart-shake 0.6s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes cart-shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0) scale(1.1);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0) scale(1.1);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-3px, 0, 0) scale(1.1);
    }

    40%,
    60% {
        transform: translate3d(3px, 0, 0) scale(1.1);
    }
}

/* --- Cart Receiving Item Indicator --- */
.floating-cart.receiving-item {
    /* Make it slightly bigger and add a pulsing glow */
    transform: scale(1.15);
    animation: cart-pulse 1.2s infinite;
    /* Ensure the transition is smooth */
    transition: transform 0.3s ease-in-out;
}

@keyframes cart-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(var(--bs-primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

/* --- Cart Count Pop Animation --- */
.cart-count.updated {
    /* Use a relative position to ensure it pops above the icon */
    position: relative;
    z-index: 1;
    animation: count-pop 0.4s ease-in-out;
}

@keyframes count-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.6);
        color: var(--bs-warning);
        /* A bright, attention-grabbing color */
    }

    100% {
        transform: scale(1);
        color: rgb(255, 0, 0);
        /* Revert to its original red color */
    }
}

/* --- Product Image Zoom-on-Hover --- */
.image-zoom-container {
    overflow: hidden;
    /* This is crucial to clip the zoomed image */
    position: relative;
    /* Needed for positioning if we add overlays */
    border-radius: .5rem;
    /* Match the image's rounded corners */
}

.image-zoom-container img {
    transition: transform 0.2s ease-out;
    /* Smooth transition for the zoom effect */
    will-change: transform;
    /* Hint to the browser for optimization */
    border-radius: .5rem;
    /* Apply radius directly to the image */
}

/* Apply zoom effect and cursor change only on larger screens where hover is the primary interaction method */
@media (min-width: 992px) {
    .image-zoom-container:hover img {
        transform: scale(1.75);
        /* The zoom level. Adjust as needed. */
    }

    .image-zoom-container img {
        cursor: zoom-in;
    }
}

/* --- Product Image Gallery Thumbnail Styles --- */
.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    /* Rounded corners for all thumbnails */
    padding: 0.2rem;
    background-color: var(--bs-body-bg);
    /* Background for the padded area */
    border: 2px solid transparent;
    /* Placeholder for the active border */
    transition: all 0.3s ease-in-out;
    /* Smooth transition for all properties */
    cursor: pointer;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
    border-color: var(--bs-secondary-bg-subtle);
    /* Subtle hover border */
}

.gallery-thumbnail.active {
    border-color: var(--bs-primary);
    /* Use theme's primary color for the active border */
    transform: scale(1.1);
    /* Make the active thumbnail slightly larger */
    box-shadow: 0 0 10px rgba(var(--bs-primary-rgb), 0.5);
    /* Add a glow effect */
}

/* --- Stacking Context Fix for Sticky Elements in Tabs --- */
/* This ensures that sticky elements within tab content do not
   overlap high z-index components like modals and toasts. */
.tab-content {
    position: relative;
    /* Establishes a stacking context */
    z-index: 1;
    /* A low z-index to keep it below other overlays */
}

/* --- Accessible Star Rating Component --- */
.star-rating-display .rating-stars {
    /* A consistent color for all star icons (filled, half, empty) */
    color: #ffc107;
    /* Bootstrap's default "warning" yellow, a good gold color */
}

.star-rating-display .review-count {
    /* Vertically align the count with the stars */
    transform: translateY(1px);
}

/* --- Toast-Like Modal Styles --- */

/* 1. Backdrop Style - Make it invisible but still functional for clicks */
#customConfirmModal+.modal-backdrop {
    background-color: transparent;
}

/* 2. Modal Dialog Positioning & Sizing */
/* We override Bootstrap's default centering to position this like a toast. */
#customConfirmModal .modal-dialog {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: auto;
    max-width: 380px;
    margin: 0;
}

/* 3. Modal Animation (Slide in from bottom) */
#customConfirmModal.fade .modal-dialog {
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#customConfirmModal.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

/* 4. Modal Content Styling */
#customConfirmModal .modal-content {
    border-radius: 0.75rem;
    /* Softer corners */
    border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.1);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    /* === Glassmorphism Effect === */
    background: rgba(var(--bs-body-bg-rgb), 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 5. Modal Header */
#customConfirmModal .modal-header {
    border-bottom: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.1);
    padding: 0.75rem 1rem;
}

#customConfirmModal .modal-header .modal-title {
    font-weight: 500;
    font-size: 1rem;
    /* Smaller title for toast-like appearance */
}

/* 6. Modal Body */
#customConfirmModal .modal-body {
    padding: 1rem;
    line-height: 1.5;
}

#customConfirmModal .modal-body .form-check {
    padding: 0.5rem 0.75rem;
    margin-top: 1rem !important;
}

/* 7. Modal Footer */
#customConfirmModal .modal-footer {
    border-top: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.1);
    padding: 0.75rem 1rem;
}

#customConfirmModal .modal-footer .btn {
    padding: 0.375rem 1rem;
    /* Smaller buttons */
    font-size: 0.875rem;
}

/* === BRAND COLOR PALETTE (CSS VARIABLES) === */
/* Define your brand colors here. Changing these will update the entire site. */
:root {
    --brand-gradient-start: #8E44AD;
    /* Vibrant Wisteria Purple */
    --brand-gradient-end: #3498DB;
    /* Bright Peter River Blue */
    --brand-gradient-start-rgb: 142, 68, 173;
    --brand-gradient-end-rgb: 52, 152, 219;
    --brand-text-inverse: #ffffff;
    /* Text color for dark backgrounds */
    --brand-social-google: #DB4437;
    /* Google's brand red */
    --brand-social-google-rgb: 219, 68, 55;
    --brand-social-facebook: #1877F2;
    /* Facebook's brand blue */
    --background-image-color-background: url(../img/bg-lines.png);
}

/* --- Dark Mode Brand Palette --- */
/* These variables override the :root values when the dark theme is active. */
[data-bs-theme="dark"] {
    --brand-gradient-start: #9B59B6;
    /* Lighter Amethyst Purple for dark mode */
    --brand-gradient-end: #5DADE2;
    /* Lighter, elegant blue for dark mode */
    --brand-gradient-start-rgb: 155, 89, 182;
    --brand-gradient-end-rgb: 93, 173, 226;
    --brand-social-google: #e74c3c;
    /* A slightly brighter red for dark mode */
    --brand-social-google-rgb: 231, 76, 60;
    --brand-social-facebook: #1B95E0;
    /* A lighter, more vibrant blue for dark mode */
    --brand-text-inverse: #141d26;
    /* A very dark color for text on light buttons */
    --background-image-color-background: url(../img/bg-lines.png);
}

.background-image-color-lines {
    background-image: var(--background-image-color-background);
    /* background-repeat: no-repeat; */
    /* background-position: center center; */
    /* background-size: fit;  */
    /* padding: 30px 0px; */
    /* position: relative; */
    /* background-blend-mode: difference; */

}

.background-image {
    background-image: url(../img/bg-lines.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: fit;
    padding: 30px 0px;
    position: relative;

}

/* === GLOBAL ELEGANT BUTTON STYLES === */

/* Base styles for brand buttons */
.btn-brand-primary,
.btn-brand-secondary {
    padding: 0.75rem 1.5rem;
    /* Default padding for larger buttons (e.g., product detail page) */
    border-radius: 50px;
    /* Pill shape for a modern look */
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.875rem;
    /* Default font size */
    border: 1px solid transparent;
    /* Border will be colored by specific styles */
    transition: all 0.3s ease-in-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    /* Prevent text wrapping */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Primary "Buy Now" Button */
.btn-brand-primary {
    background: linear-gradient(135deg, rgba(var(--brand-gradient-start-rgb), 0.85), rgba(var(--brand-gradient-end-rgb), 0.85));
    color: var(--brand-text-inverse);
    border-color: rgba(255, 255, 255, 0.2);
    background-size: 200% 200%;
    animation: gradient-animation 4s ease infinite;
}

.btn-brand-primary:hover,
.btn-brand-primary:focus {
    background: linear-gradient(135deg, var(--brand-gradient-start), var(--brand-gradient-end));
    color: var(--brand-text-inverse);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(var(--brand-gradient-start-rgb), 0.3);
    /* Colored glow */
}

/* Secondary "Add to Bag" Button */
.btn-brand-secondary {
    background: rgba(128, 128, 128, 0.15);
    /* More subtle glass effect */
    color: var(--brand-gradient-start);
    border-color: rgba(var(--brand-gradient-start-rgb), 0.4);
}

.btn-brand-secondary:hover,
.btn-brand-secondary:focus {
    background: linear-gradient(135deg, rgba(var(--brand-gradient-start-rgb), 0.85), rgba(var(--brand-gradient-end-rgb), 0.85));
    color: var(--brand-text-inverse);
    border-color: rgba(var(--brand-gradient-start-rgb), 0.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(var(--brand-gradient-start-rgb), 0.25);
}

/* Modifier for smaller buttons (e.g., store list view) */
.btn-sm-brand {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
}

/* === ELEGANT SOCIAL BUTTONS === */
/* These override the btn-brand-secondary colors */

/* Google Button */
.btn-social-google {
    color: var(--brand-social-google);
    border-color: var(--brand-social-google);
}

.btn-social-google:hover,
.btn-social-google:focus {
    background-color: var(--brand-social-google);
    border-color: var(--brand-social-google);
    color: var(--brand-text-inverse);
    /* Uses the correct inverse color for the theme */
    box-shadow: 0 12px 28px rgba(var(--brand-social-google-rgb), 0.25);
}

/* Facebook Button */
.btn-social-facebook {
    color: var(--brand-social-facebook);
    border-color: var(--brand-social-facebook);
}

.btn-social-facebook:hover,
.btn-social-facebook:focus {
    background-color: var(--brand-social-facebook);
    border-color: var(--brand-social-facebook);
    color: var(--brand-text-inverse);
    box-shadow: 0 12px 28px rgba(24, 119, 242, 0.25);
    /* Using FB's RGB for the shadow */
}

/* --- Gradient Animation --- */
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* === ELEGANT FORM STYLES === */

/* Apply to a form with the .form-elegant class */
.form-elegant .form-control,
.form-elegant .form-select,
.form-elegant .list-group-radio .list-group-item,
.form-elegant .input-group-text {
    border-radius: 10px;
    /* Softer, modern corners */
    border-width: 1px;
    border-style: solid;
    border-color: rgba(var(--brand-gradient-start-rgb), 0.3);
    /* background-color: rgba(128, 128, 128, 0.1); */
    /* Neutral glass background */
    color: var(--bs-body-color);
    backdrop-filter: blur(5px);
    /* A more subtle blur for inputs */
    -webkit-backdrop-filter: blur(5px);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-elegant .input-group .has-validation  {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.form-elegant .input-group.has-validation > :not(:first-child):not(.dropdown-toggle):not(.dropdown-menu),
.form-elegant .input-group.has-validation > .dropdown-toggle:nth-child(n+3),
.form-elegant .input-group.has-validation > .dropdown-menu:nth-child(n+3) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.form-elegant .form-floating>.form-control {
    padding-top: 1.625rem;
    padding-bottom: .625rem;
}

/* Style for the input on focus */
.form-elegant .form-control:focus {
    border-color: var(--brand-gradient-start);
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-gradient-start-rgb), 0.25);
    background-color: var(--bs-body-bg);
    /* Ensure background doesn't change on focus */
    z-index: 2;
    /* Ensure the focused input is on top */
    position: relative;
}

/* Style for the floating label */
.form-elegant .form-floating>label {
    color: var(--bs-secondary-color);
    padding: 1rem 0.75rem;
    backdrop-filter: none;
    /* Prevent label from being blurred */
    -webkit-backdrop-filter: none;
}

/* Style for the input group text (e.g., password toggle icon) */
.form-elegant .form-control:focus~.input-group-text,
.form-elegant .form-floating:focus-within .input-group-text {
    border-color: var(--brand-gradient-start);
    z-index: 2;
}

/* === ELEGANT PAGINATION STYLES === */

.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.375rem;
    --bs-pagination-font-size: 0.9rem;
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-radius: 50rem;
    /* Pill shape */
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(var(--brand-gradient-start-rgb), 0.25);
    --bs-pagination-active-color: var(--brand-text-inverse);
    --bs-pagination-disabled-color: rgba(var(--bs-body-color-rgb), 0.3);
    --bs-pagination-disabled-bg: rgba(128, 128, 128, 0.1);
    --bs-pagination-disabled-border-color: transparent;

    display: flex;
    gap: 0.5rem;
    /* Space between pagination items */
    justify-content: center;
    /* Center the pagination block */
    padding-left: 0;
    list-style: none;
}

.page-link {
    position: relative;
    display: block;
    border-radius: var(--bs-pagination-border-radius);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Default state for page links */
.page-item:not(.active) .page-link {
    background: rgba(128, 128, 128, 0.15);
    color: var(--brand-gradient-start);
    border: 1px solid rgba(var(--brand-gradient-start-rgb), 0.3);
}

/* Hover state for non-active links */
.page-item:not(.active) .page-link:hover {
    background: rgba(var(--brand-gradient-start-rgb), 0.2);
    border-color: rgba(var(--brand-gradient-start-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--brand-gradient-start-rgb), 0.15);
}

/* Active page link style */
.page-item.active .page-link {
    background: linear-gradient(135deg, var(--brand-gradient-start), var(--brand-gradient-end));
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(var(--brand-gradient-start-rgb), 0.3);
    transform: translateY(-1px);
    z-index: 3;
}

/* === ELEGANT COOKIE CONSENT BANNER === */

#consent-form {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 95%;
    margin: 0 auto;
    z-index: 1050;
    /* Above most content, below modals */
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

    /* Glassmorphism Effect */
    background: rgba(var(--bs-body-bg-rgb), 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* Animation */
    transform: translateY(200%);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#consent-form.show {
    transform: translateY(0);
}

#consent-form .btn-primary {
    /* Style the main "Accept All" button to match your brand */
    background: linear-gradient(135deg, var(--brand-gradient-start), var(--brand-gradient-end));
    border-color: transparent;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#consent-form .btn-link {
    color: var(--bs-secondary-color);
    text-decoration-color: var(--bs-secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#consent-form .btn-link:hover {
    color: var(--bs-emphasis-color);
    text-decoration-color: var(--bs-emphasis-color);
}

/* --- Cookie Manager Modal Styles --- */
#cookieManagerModal .modal-content {
    background: rgba(var(--bs-body-bg-rgb), 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.1);
    border-radius: 15px;
}

#cookieManagerModal .form-check-input:checked {
    background-color: var(--brand-gradient-start);
    border-color: var(--brand-gradient-start);
}


#consent-form .btn-secondary {
    /* Style the secondary "Decline" button */
    background: transparent;
    border-color: var(--bs-secondary-color);
    color: var(--bs-secondary-color);
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-purple {
    background-color: #6f42c1;
    /* Example purple */
}

.bg-bluish {
    background-color: rgb(54, 162, 235);
    /* Example bluish */
}

.bg-orange {
    background-color: #fd7e14;
    /* Example orange */
}

.glow-text {
    font-family: 'Segoe UI', sans-serif;
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff00cc, 0 0 20px #ff00cc, 0 0 30px #00ffff;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        text-shadow: 0 0 10px #ff00cc, 0 0 20px #ff00cc, 0 0 30px #00ffff;
    }

    50% {
        text-shadow: 0 0 20px #00ffff, 0 0 30px #ff00cc, 0 0 40px #ff00cc;
    }
}

/* --- Utility Classes (from refactoring inline styles) --- */

/**
 * Visually hides an element, but keeps it accessible to screen readers.
 * Used for the honeypot anti-spam fields.
 */
.visually-hidden-off-screen {
    position: absolute !important;
    left: -5000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/**
 * Sets a standard medium height for textareas.
 */
.textarea-md {
    height: 100px;
}

/**
 * Positions the "Best Seller" badge on product cards.
 */
.badge-best-seller {
    position: absolute;
    top: -8px;
    right: 8px;
}

/* --- Component Styles (from refactoring <style> blocks) --- */

/* From contact.php */
.card-container {
    display: flex;
    align-items: stretch;
    /* Key for equal height */
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 20px;
    /* Space between cards */
}

/* From special_promo_bundle.php */
.product-card {
    /* transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; */
    border: 2px solid transparent;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.product-card-with-quantity {
    transform: scale(1.03);
    box-shadow: 0 0.5rem 1rem rgba(157, 219, 12, 0.25);
    border-color: var(--bs-success);
}

.product-card-no-quantity {
    transform: none;
    border-color: var(--bs-secondary);
}

.quantity-selector {
    display: flex;
    align-items: center;
}

.quantity-btn {
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border-left: none;
    border-right: none;
}

.subtotal-container {
    max-width: 350px;
    margin: 0 auto 1rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--bs-tertiary-bg);
}

.fs-sm {
    font-size: 0.875rem;
}

/* From layouts/main.php */
.spinner-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent background */
    z-index: 9999;
    /* Ensure it's on top of everything */
    justify-content: center;
    align-items: center;
}

.element-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--bs-body-bg-rgb), 0.75);
    /* Use theme-aware background color */
    /* Set z-index to 0 so it appears behind the Turnstile iframe (which has a default z-index) */
    /* This prevents the overlay from blocking clicks on the challenge. */
    z-index: 0;
    /* High enough for local context */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
    /* Inherit border-radius from parent for a clean look */
    backdrop-filter: blur(2px);
    /* Optional: Adds a nice blur effect */
    -webkit-backdrop-filter: blur(2px);
}

/* --- Theme-Aware Skeleton Loader Styles --- */
.skeleton-loader {
    --skeleton-bg: var(--bs-tertiary-bg);
    /* A slightly darker/lighter background for the shimmer effect to be visible */
    --shimmer-color: rgba(var(--bs-emphasis-color-rgb), 0.1);
    /* A subtle shimmer color that works on both themes */
    position: relative;
    overflow: hidden;
}

.skeleton-loader .skeleton-line,
.skeleton-loader .skeleton-avatar {
    background-color: var(--skeleton-bg);
    border-radius: var(--bs-border-radius);
    /* Use Bootstrap's border radius */
    margin-bottom: 0.75rem;
    /* Consistent spacing */
}

.skeleton-loader .skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Circular avatar */
}

/* Shimmer Animation */
.skeleton-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            transparent 0,
            var(--shimmer-color) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* --- Content Fade-In Animation --- */
.content-fade-in {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.content-fade-in.is-visible {
    opacity: 1;
}

/* --- Custom Dual Ring Spinner --- */
.custom-spinner-dual-ring {
    display: inline-block;
    width: 64px;
    height: 64px;
}

.custom-spinner-dual-ring:after {
    content: " ";
    display: block;
    width: 46px;
    height: 46px;
    margin: 1px;
    border-radius: 50%;
    border: 5px solid var(--bs-primary);
    border-color: var(--bs-primary) transparent var(--bs-primary) transparent;
    animation: custom-spinner-dual-ring-anim 1.2s linear infinite;
}

@keyframes custom-spinner-dual-ring-anim {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}