/**
 * A.M TRADERS - Warehouse Gallery & Showcase
 * Section: Section 1.5
 * Layout: 100% Full Width, Infinite Scroll Marquee
 */

/* Elementor / Container Resets */
.elementor-widget-am_warehouse_gallery,
.elementor-widget-am_warehouse_gallery .elementor-widget-container,
.elementor-widget-shortcode:has(.am-warehouse-section),
.elementor-widget-shortcode:has(.am-warehouse-section) .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
}

.am-warehouse-section {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    background-color: var(--am-dark, #151516);
    padding: clamp(60px, 6vw, 110px) 0;
    box-sizing: border-box !important;
    overflow: hidden;
    font-family: var(--am-font-body, 'Raleway', sans-serif);
}

body.elementor-editor-active .am-warehouse-section {
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Header Text */
.am-warehouse-header {
    text-align: center;
    padding: 0 clamp(20px, 4vw, 80px);
    margin-bottom: clamp(40px, 5vw, 60px);
}

.am-warehouse-title {
    font-family: var(--am-font-heading, 'Megante', serif);
    font-size: clamp(32px, 4vw, 56px);
    color: var(--am-white, #ffffff);
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.am-warehouse-title span {
    color: var(--am-blue, #3858e9);
}

.am-warehouse-subtitle {
    font-size: clamp(16px, 1.2vw, 20px);
    color: #94a3b8;
    max-width: 800px;
    margin: 0 auto;
}

/* Marquee Rows */
.am-warehouse-rows {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.am-marquee-row {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    /* Optional mask for fading edges */
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.am-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
    /* Hardware acceleration */
    transform: translateZ(0);
}

.am-marquee-content {
    display: flex;
    flex-shrink: 0;
    gap: 24px;
    padding-right: 24px; /* Space between the original and the clone */
}

/* Gallery Images / Cards */
.am-marquee-item {
    position: relative;
    display: block;
    height: clamp(250px, 25vw, 400px);
    aspect-ratio: 1 / 1; /* PERFECT SQUARE */
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
    cursor: zoom-in;
    transition: transform 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease;
}

/* Base image styling */
.am-marquee-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.5s ease;
}

/* Gradient Overlay */
.am-marquee-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Card Text */
.am-marquee-text {
    position: absolute;
    bottom: clamp(16px, 2vw, 30px);
    left: clamp(16px, 2vw, 30px);
    right: clamp(16px, 2vw, 30px);
    color: var(--am-white, #ffffff);
    font-family: var(--am-font-heading, 'Megante', serif);
    font-size: clamp(20px, 2vw, 32px);
    line-height: 1.2;
    z-index: 2;
    margin: 0;
    text-align: left;
}

/* Hover effects for individual images */
.am-marquee-row:hover .am-marquee-item {
    filter: brightness(0.6) grayscale(50%); /* Dim unhovered items slightly */
}

.am-marquee-row:hover .am-marquee-item:hover {
    filter: brightness(1.1) grayscale(0%);
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.am-marquee-row:hover .am-marquee-item:hover img {
    transform: scale(1.05);
}
