/* --- CATEGORY.CSS: HERO, NAVIGATION & PRODUCT GRID --- */

/* 1. HERO SECTION */
#hero {
    background: url('https://postboxesukltd.co.uk/images/category/horizontal-cat-image.png') no-repeat center center !important; 
    background-size: cover !important;
    position: relative !important;
    padding: 100px 0 !important;
    overflow: hidden !important; 
}

#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 1;
}

#hero .wrapper, #category-page-intro {
    position: relative !important;
    z-index: 2 !important;
}

#category-page-intro h1 { 
    font-size: 3em !important;
    color: white !important;
    text-align: center !important;
    margin-bottom: 20px !important;
}

.header-description-container {
    text-align: center !important;
}

.header-description-container p {
    font-size: 1em !important; 
    color: white !important; 
    line-height: 1.2 !important; 
    font-weight: 500 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 90% !important; 
}

/* 2. CONTAINMENT & SPACING */
#category-page-wrapper {
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 95% !important;
    display: block !important;
    clear: both !important;
}

#category-section-breakout.vertical-padding {
    padding-top: 5px !important; 
    padding-bottom: 20px !important;
}

/* 3. CATEGORY NAVIGATION (ICONS) */
.subcategory-nav {
    display: flex !important;
    justify-content: space-between !important;
    gap: 15px !important;
    width: 100% !important;
    margin-top: 20px !important;
    margin-bottom: 40px !important;
}

.sub-card {
    flex: 1 !important;
    text-align: center !important;
}

.sub-card img {
    width: 100% !important;
    max-width: 180px !important; 
    height: auto !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
    transition: transform 0.2s ease !important;
}

.sub-card img:hover { transform: translateY(-5px) !important; }

.sub-card h3 { font-size: 14px !important; font-weight: 700 !important; color: #333 !important; }
.sub-card span { display: block !important; color: #79D3F6 !important; font-size: 12px !important; }


/* 4. PRODUCT TILES (BOXES) */
.box {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 20px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    min-height: 300px !important;
    transition: all 0.3s ease-in-out !important;
    cursor: pointer;
    overflow: hidden !important;
}

.box:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    border: 1px solid #79D3F6 !important;
}

.box .grid_4, .box .grid_8 { float: left !important; }

.box .grid_4 img {
    width: 100% !important;
    max-width: 160px !important;
    height: auto !important;
}

.box h3 {
    margin-top: 0 !important;
    font-size: 1.1em !important;
    color: #17538A !important;
    margin-bottom: 8px !important;
}

.box p {
    font-size: 0.9em !important;
    line-height: 1.4 !important;
    color: #555 !important;
}

/* 5. BUTTON STYLING */
.buttonlink4 {
    display: inline-block !important;
    border: 1px solid #79D3F6 !important;
    color: #79D3F6 !important;
    padding: 8px 15px !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8em;
}

.buttonlink4:hover {
    background: #79D3F6 !important;
    color: #ffffff !important;
}

/* Unique container to force spacing between rows */
.category-product-row {
    display: flow-root !important; /* Modern clearfix: clears floats automatically */
    margin-bottom: 30px !important; /* This creates the vertical gap you're looking for */
    width: 100% !important;
}

/* Ensure the grid columns inside this unique row behave */
.category-product-row [class*="grid_"] {
    float: left !important;
}

/* Optional: if you want a divider or more breathing room */
#category-section-breakout .wrapper {
    padding-bottom: 50px !important;
}

/* 6. BOX LITE (Special rule for Keys & Locks) */
.box.boxlite {
    min-height: 180px !important; /* Significantly reduced from 300px */
    padding: 15px !important;    /* Tighter padding */
    display: flex !important;    /* Helps with vertical alignment of small content */
    align-items: center !important; 
}

/* Adjusting the grid internal to boxlite for better alignment */
.boxlite .grid_4 {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.boxlite .grid_4 img {
    max-width: 120px !important; /* Smaller images for keys */
}

.boxlite h3 {
    margin-bottom: 15px !important;
}