/**
 * A.M TRADERS - Key Product Categories Grid Styles
 * Section: Section 1.3 (Page 1: Home)
 * Canvas: Pure Crisp White (#FFFFFF)
 * Accent & Brand: Royal Blue (#3858E9) & Deep Charcoal (#151516)
 * Typography: Headings in Megante, Details in Raleway
 * Layout: 100% Full Width, Perfectly Centered on all Zoom Levels & Screens
 */

/* 
 * 1. Elementor Full-Bleed & Container Resets (Flexbox & Classic)
 * Forces all parent wrappers to full 100% width and centers them
 */
.elementor-widget-am_categories_grid,
.elementor-widget-am_categories_grid .elementor-widget-container,
.elementor-widget-shortcode:has(.am-categories-section),
.elementor-widget-shortcode:has(.am-categories-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;
}

.e-con:has(.am-categories-section),
.e-con-inner:has(.am-categories-section),
.e-con-boxed:has(.am-categories-section),
.e-con-boxed:has(.am-categories-section) > .e-con-inner,
.elementor-section:has(.am-categories-section),
.elementor-section:has(.am-categories-section) > .elementor-container,
.elementor-column:has(.am-categories-section),
.elementor-widget-wrap:has(.am-categories-section),
.elementor-element:has(> .elementor-widget-container > .am-categories-section) {
    --padding-top: 0px !important;
    --padding-bottom: 0px !important;
    --padding-left: 0px !important;
    --padding-right: 0px !important;
    padding: 0 !important;
    gap: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 
 * 2. Full Width Viewport Breakout Section Wrapper
 * Mathematically expands across 100% of viewport width and centers automatically
 */
.am-categories-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-white, #ffffff);
    padding: clamp(60px, 6vw, 110px) clamp(24px, 4vw, 80px);
    font-family: var(--am-font-body, 'Raleway', sans-serif);
    color: var(--am-dark, #151516);
    box-sizing: border-box !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Safe reset inside Elementor editor canvas */
body.elementor-editor-active .am-categories-section {
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* 
 * 3. Section Container: 100% Full Width & Dead-Centered at Any Zoom Level
 */
.am-categories-container {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 clamp(20px, 3.5vw, 60px);
    margin: 0 auto !important;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* 
 * 4. Section Header (Centered, Clean, No Tags)
 */
.am-categories-header {
    text-align: center;
    max-width: 900px;
    width: 100%;
    margin: 0 auto clamp(40px, 4.5vw, 65px) auto;
}

.am-categories-title {
    font-family: var(--am-font-heading, 'Megante', serif);
    font-size: clamp(34px, 3.8vw, 54px);
    font-weight: 400;
    line-height: 1.15;
    color: var(--am-dark, #151516);
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

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

.am-categories-subtitle {
    font-size: clamp(15px, 1.1vw, 18px);
    color: #475569;
    line-height: 1.65;
    margin: 0 auto;
    max-width: 680px;
}

/* 
 * 5. 5-Category Responsive Grid Layout
 * Row 1: 3 Cards (Equal Width)
 * Row 2: 2 Cards (Equal Width, Centered below Row 1)
 * All 5 cards maintain 100% identical dimensions
 */
.am-categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: clamp(20px, 2vw, 36px);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Category Card: Uniform Dimensions Across All 5 Cards */
.am-cat-card {
    flex: 0 1 calc(33.333% - clamp(14px, 1.5vw, 26px));
    width: calc(33.333% - clamp(14px, 1.5vw, 26px));
    max-width: calc(33.333% - clamp(14px, 1.5vw, 26px));
    min-width: 300px;
    background-color: var(--am-white, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 10px 30px -12px rgba(21, 21, 22, 0.06);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.am-cat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px -12px rgba(56, 88, 233, 0.16);
    border-color: rgba(56, 88, 233, 0.45);
}

/* Card Visual Media Layer (Exact Uniform Height, Clean, No Floating Badges) */
.am-cat-media {
    position: relative;
    width: 100%;
    height: clamp(240px, 16vw, 300px);
    overflow: hidden;
    background-color: #f1f5f9;
}

.am-cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.am-cat-card:hover .am-cat-img {
    transform: scale(1.06);
}

/* Card Body Content (Consistent Sizing & Spacing) */
.am-cat-body {
    padding: clamp(22px, 2vw, 30px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.am-cat-title {
    font-family: var(--am-font-heading, 'Megante', serif);
    font-size: clamp(20px, 1.35vw, 24px);
    font-weight: 400;
    line-height: 1.25;
    color: var(--am-dark, #151516);
    margin: 0 0 8px 0;
    min-height: 56px;
    display: flex;
    align-items: center;
    transition: color 0.4s ease;
}

.am-cat-card:hover .am-cat-title {
    color: var(--am-blue, #3858e9);
}

.am-cat-spec-line {
    font-size: 13px;
    font-weight: 700;
    color: var(--am-blue, #3858e9);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 20px;
}

/* Key Features Micro-List */
.am-cat-features {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 85px;
}

.am-cat-feature-item {
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 9px;
    line-height: 1.4;
}

.am-cat-feature-icon {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(56, 88, 233, 0.1);
    color: var(--am-blue, #3858e9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Card Bottom Action Strip */
.am-cat-action {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.am-cat-action .am-btn {
    width: 100%;
    justify-content: space-between;
}

/* 
 * 6. Section Bottom Wholesale Guarantee Strip
 */
.am-categories-footer-strip {
    margin-top: clamp(40px, 4vw, 65px);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: clamp(18px, 1.8vw, 24px) clamp(24px, 2.5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}

.am-strip-text {
    display: flex;
    align-items: center;
    gap: 16px;
}

.am-strip-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--am-dark, #151516);
    color: var(--am-white, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.am-strip-heading {
    font-family: var(--am-font-heading, 'Megante', serif);
    font-size: 19px;
    font-weight: 400;
    color: var(--am-dark, #151516);
    margin: 0 0 4px 0;
}

.am-strip-sub {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* 
 * 7. Responsive Breakpoints
 */
@media (max-width: 1180px) {
    .am-cat-card {
        flex: 0 1 calc(50% - 14px);
        width: calc(50% - 14px);
        max-width: calc(50% - 14px);
    }
}

@media (max-width: 720px) {
    .am-categories-section {
        padding: 50px 16px;
    }
    .am-cat-card {
        flex: 0 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .am-categories-footer-strip {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 24px 20px;
    }
    .am-strip-text {
        flex-direction: column;
    }
}
