/* UKPTG Mega Menu - Premium Frontend Styles */
/* Multiple layout styles inspired by RHS */

/* ================================
   KB PAGE OVERRIDES
   Ensure mega menu works on all KB pages
   ================================ */

/* Search dropdown must stay above nav on KB pages */
body.single-kb .ukptg-instant-search-wrapper,
body.tax-kb_category .ukptg-instant-search-wrapper,
body.archive-kb .ukptg-instant-search-wrapper,
body.knowledge-base-page .ukptg-instant-search-wrapper {
    position: relative !important;
    z-index: 999999999 !important;
}

body.single-kb #ukptg-header-search-results,
body.tax-kb_category #ukptg-header-search-results,
body.archive-kb #ukptg-header-search-results,
body.knowledge-base-page #ukptg-header-search-results {
    z-index: 999999999 !important;
}

body.single-kb .has-mega-menu .ukptg-mega-dropdown,
body.tax-kb_category .has-mega-menu .ukptg-mega-dropdown,
body.archive-kb .has-mega-menu .ukptg-mega-dropdown,
body.knowledge-base-page .has-mega-menu .ukptg-mega-dropdown {
    display: none;
    position: absolute !important;
    top: 100% !important;
    /* Don't override left - let JS calculate it for full-width positioning */
    z-index: 99999999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.single-kb .has-mega-menu.mega-active .ukptg-mega-dropdown,
body.tax-kb_category .has-mega-menu.mega-active .ukptg-mega-dropdown,
body.archive-kb .has-mega-menu.mega-active .ukptg-mega-dropdown,
body.knowledge-base-page .has-mega-menu.mega-active .ukptg-mega-dropdown {
    display: block !important;
}

body.single-kb .ukptg-primary,
body.tax-kb_category .ukptg-primary,
body.archive-kb .ukptg-primary,
body.knowledge-base-page .ukptg-primary {
    position: relative !important;
    z-index: 99999999 !important;
}

body.single-kb .has-mega-menu,
body.tax-kb_category .has-mega-menu,
body.archive-kb .has-mega-menu,
body.knowledge-base-page .has-mega-menu {
    position: static !important;
}

body.single-kb .has-mega-menu.mega-active,
body.tax-kb_category .has-mega-menu.mega-active,
body.archive-kb .has-mega-menu.mega-active,
body.knowledge-base-page .has-mega-menu.mega-active {
    z-index: 99999999 !important;
}

/* Force breadcrumb behind dropdown on KB pages */
body.single-kb .ukptg-breadcrumb,
body.tax-kb_category .ukptg-breadcrumb,
body.archive-kb .ukptg-breadcrumb,
body.knowledge-base-page .ukptg-breadcrumb,
body.single-kb nav[style*="font-size:13px"],
body.tax-kb_category nav[style*="font-size:13px"] {
    position: relative;
    z-index: 1 !important;
}

/* ================================
   BASE DROPDOWN STYLES
   ================================ */

.has-mega-menu > .sub-menu {
    display: none !important;
}

.has-mega-menu {
    position: relative;
}

.has-mega-menu.mega-active {
    z-index: 999999 !important;
}

.ukptg-mega-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #e8f0ee;
    border-top: 4px solid #0d3b59;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 999999 !important;
    isolation: isolate;
    transform-origin: top center;
}

.has-mega-menu.mega-active .ukptg-mega-dropdown {
    display: block !important;
    animation: smoothReveal 0.25s ease-out;
}

@keyframes smoothReveal {
    from { opacity: 0; transform: scaleY(0.95); }
    to { opacity: 1; transform: scaleY(1); }
}

.ukptg-mega-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 0;
}

/* Menu item active state */
.has-mega-menu.mega-active > a {
    background: #e8f0ee !important;
    color: #0d3b59 !important;
}

.has-mega-menu > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s;
}

.has-mega-menu.mega-active > a::after {
    transform: rotate(180deg);
}

/* ================================
   SECTION HEADER
   ================================ */

.ukptg-section-header {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    color: #0d3b59;
    text-decoration: none;
    margin-bottom: 24px;
}

.ukptg-section-header::after {
    content: ' »';
    color: #0d3b59;
}

.ukptg-section-header:hover {
    color: #c41e4a;
}

/* ================================
   TEXT COLUMNS LAYOUT
   ================================ */

.ukptg-layout-text-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.ukptg-text-column {
    background: #fff;
    padding: 20px 24px;
    border-right: 1px solid #d8e2df;
}

.ukptg-text-column:last-child {
    border-right: none;
}

.ukptg-text-column .column-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #0d3b59;
}

.ukptg-text-column .column-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ukptg-text-column .column-links li {
    border-bottom: 1px solid #eef2f0;
}

.ukptg-text-column .column-links li:last-child {
    border-bottom: none;
}

.ukptg-text-column .column-links a {
    display: block;
    padding: 10px 0;
    color: #0d3b59;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.ukptg-text-column .column-links a:hover {
    color: #c41e4a;
}

/* ================================
   IMAGE CARDS LAYOUT
   ================================ */

.ukptg-layout-image-cards {
    display: grid;
    gap: 20px;
}

.ukptg-layout-image-cards.cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ukptg-layout-image-cards.cards-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ukptg-layout-image-cards.cards-5 {
    grid-template-columns: repeat(5, 1fr);
}

.ukptg-image-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ukptg-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.ukptg-image-card .card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #dce5e2;
}

.ukptg-image-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

.ukptg-image-card .card-content {
    padding: 14px 16px;
    text-align: center;
}

.ukptg-image-card .card-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.ukptg-image-card .card-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* ================================
   PROMO ROW (for image_cards_promo)
   ================================ */

.ukptg-promo-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.ukptg-promo-box {
    padding: 28px 24px 32px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

/* Business name - larger, bold */
.ukptg-promo-box .promo-business-name {
    font-size: 20px;
    font-weight: 700;
    color: #0d3b59;
    margin: 0 0 6px 0;
}

/* Tagline - smaller, below business name */
.ukptg-promo-box .promo-tagline {
    font-size: 14px;
    font-weight: 400;
    color: #444;
    margin: 0 0 8px 0;
}

/* Light promo box */
.ukptg-promo-box.promo-light {
    background: #fff;
    border: 1px solid #d8e2df;
}

.ukptg-promo-box.promo-light h4 {
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.ukptg-promo-box.promo-light h4 strong {
    font-weight: 700;
}

.ukptg-promo-box p {
    margin: 0 0 8px 0;
}

.ukptg-promo-box .promo-button {
    display: inline-block;
    padding: 8px 20px;
    background: #c41e4a;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 16px;
}

.ukptg-promo-box .promo-button:hover {
    background: #a31a3e;
}

/* Dark promo box */
.ukptg-promo-box.promo-dark {
    background: #0d3b59;
    color: #fff;
}

.ukptg-promo-box.promo-dark .promo-business-name {
    color: #fff;
}

.ukptg-promo-box.promo-dark .promo-tagline {
    color: rgba(255,255,255,0.9);
}

.ukptg-promo-box.promo-dark h4 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.ukptg-promo-box.promo-dark p {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.ukptg-promo-box.promo-dark p::after {
    content: ' »';
}

/* Yellow promo box */
.ukptg-promo-box.promo-yellow {
    background: linear-gradient(135deg, #fef3cd 0%, #ffeaa0 100%);
    border: 2px solid #f0c14b;
}

.ukptg-promo-box.promo-yellow .promo-business-name {
    color: #856404;
}

.ukptg-promo-box.promo-yellow .promo-tagline {
    color: #664d03;
}

.ukptg-promo-box.promo-yellow .promo-button {
    background: #f0c14b;
    color: #664d03;
}

.ukptg-promo-box.promo-yellow .promo-button:hover {
    background: #e0a800;
}

/* Green promo box */
.ukptg-promo-box.promo-green {
    background: linear-gradient(135deg, #d4edda 0%, #b8e0c0 100%);
    border: 2px solid #28a745;
}

.ukptg-promo-box.promo-green .promo-business-name {
    color: #155724;
}

.ukptg-promo-box.promo-green .promo-tagline {
    color: #1e7e34;
}

.ukptg-promo-box.promo-green .promo-button {
    background: #28a745;
    color: #fff;
}

.ukptg-promo-box.promo-green .promo-button:hover {
    background: #1e7e34;
}

/* Blue promo box */
.ukptg-promo-box.promo-blue {
    background: linear-gradient(135deg, #cce5ff 0%, #a8d4ff 100%);
    border: 2px solid #007bff;
}

.ukptg-promo-box.promo-blue .promo-business-name {
    color: #004085;
}

.ukptg-promo-box.promo-blue .promo-tagline {
    color: #0056b3;
}

.ukptg-promo-box.promo-blue .promo-button {
    background: #007bff;
    color: #fff;
}

.ukptg-promo-box.promo-blue .promo-button:hover {
    background: #0056b3;
}

/* Orange promo box */
.ukptg-promo-box.promo-orange {
    background: linear-gradient(135deg, #ffe5d0 0%, #ffd4b3 100%);
    border: 2px solid #fd7e14;
}

.ukptg-promo-box.promo-orange .promo-business-name {
    color: #c35a00;
}

.ukptg-promo-box.promo-orange .promo-tagline {
    color: #a04800;
}

.ukptg-promo-box.promo-orange .promo-button {
    background: #fd7e14;
    color: #fff;
}

.ukptg-promo-box.promo-orange .promo-button:hover {
    background: #e06600;
}

/* Gold promo box */
.ukptg-promo-box.promo-gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
}

.ukptg-promo-box.promo-gold .promo-business-name {
    color: #78350f;
}

.ukptg-promo-box.promo-gold .promo-tagline {
    color: #92400e;
}

.ukptg-promo-box.promo-gold .promo-button {
    background: #f59e0b;
    color: #fff;
}

.ukptg-promo-box.promo-gold .promo-button:hover {
    background: #d97706;
}

/* Coral promo box */
.ukptg-promo-box.promo-coral {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #f87171;
}

.ukptg-promo-box.promo-coral .promo-business-name {
    color: #991b1b;
}

.ukptg-promo-box.promo-coral .promo-tagline {
    color: #b91c1c;
}

.ukptg-promo-box.promo-coral .promo-button {
    background: #ef4444;
    color: #fff;
}

.ukptg-promo-box.promo-coral .promo-button:hover {
    background: #dc2626;
}

/* Purple promo box */
.ukptg-promo-box.promo-purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 2px solid #a855f7;
}

.ukptg-promo-box.promo-purple .promo-business-name {
    color: #581c87;
}

.ukptg-promo-box.promo-purple .promo-tagline {
    color: #6b21a8;
}

.ukptg-promo-box.promo-purple .promo-button {
    background: #9333ea;
    color: #fff;
}

.ukptg-promo-box.promo-purple .promo-button:hover {
    background: #7c3aed;
}

/* Teal promo box */
.ukptg-promo-box.promo-teal {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    border: 2px solid #14b8a6;
}

.ukptg-promo-box.promo-teal .promo-business-name {
    color: #134e4a;
}

.ukptg-promo-box.promo-teal .promo-tagline {
    color: #115e59;
}

.ukptg-promo-box.promo-teal .promo-button {
    background: #14b8a6;
    color: #fff;
}

.ukptg-promo-box.promo-teal .promo-button:hover {
    background: #0d9488;
}

/* Slate promo box */
.ukptg-promo-box.promo-slate {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px solid #64748b;
}

.ukptg-promo-box.promo-slate .promo-business-name {
    color: #1e293b;
}

.ukptg-promo-box.promo-slate .promo-tagline {
    color: #334155;
}

.ukptg-promo-box.promo-slate .promo-button {
    background: #64748b;
    color: #fff;
}

.ukptg-promo-box.promo-slate .promo-button:hover {
    background: #475569;
}

/* Pink promo box */
.ukptg-promo-box.promo-pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border: 2px solid #ec4899;
}

.ukptg-promo-box.promo-pink .promo-business-name {
    color: #831843;
}

.ukptg-promo-box.promo-pink .promo-tagline {
    color: #9d174d;
}

.ukptg-promo-box.promo-pink .promo-button {
    background: #ec4899;
    color: #fff;
}

.ukptg-promo-box.promo-pink .promo-button:hover {
    background: #db2777;
}

/* Links promo box */
.ukptg-promo-box.promo-links {
    background: #fff;
    border: 1px solid #d8e2df;
    padding: 0;
    text-align: left;
}

.ukptg-promo-box.promo-links .promo-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    color: #0d3b59;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #eef2f0;
    transition: background 0.2s;
}

.ukptg-promo-box.promo-links .promo-link:last-child {
    border-bottom: none;
}

.ukptg-promo-box.promo-links .promo-link:hover {
    background: #f5f8f7;
}

.ukptg-promo-box.promo-links .promo-link::after {
    content: '»';
    color: #0d3b59;
    font-weight: 700;
}

/* ================================
   MIXED LAYOUT
   ================================ */

.ukptg-layout-mixed {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.mixed-text-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.mixed-text-columns .ukptg-text-column {
    border-right: 1px solid #d8e2df;
}

.mixed-text-columns .ukptg-text-column:last-child {
    border-right: none;
}

.mixed-featured {
    display: flex;
    align-items: stretch;
}

.mixed-featured .featured-card {
    display: block;
    width: 100%;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mixed-featured .featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.mixed-featured .featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 250px;
}

.mixed-featured .featured-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ================================
   CTA BANNER
   ================================ */

.ukptg-cta-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px 32px;
    margin-top: 24px;
    background: #fff;
    border-radius: 6px;
}

.ukptg-cta-banner .cta-text {
    font-size: 16px;
    color: #1a1a1a;
}

.ukptg-cta-banner .cta-text strong {
    font-weight: 700;
}

.ukptg-cta-banner .cta-button {
    display: inline-block;
    padding: 10px 24px;
    background: #c41e4a;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.ukptg-cta-banner .cta-button:hover {
    background: #a31a3e;
}

/* ================================
   CLOSE TEXT
   ================================ */

.ukptg-mega-close-wrapper {
    text-align: center;
    padding: 20px 0;
    margin-top: 16px;
    border-top: 1px solid #d0dbd7;
}

.ukptg-mega-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0d3b59;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.ukptg-mega-close:hover {
    color: #c41e4a;
}

.ukptg-mega-close-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid currentColor;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1200px) {
    .ukptg-mega-container {
        padding: 24px 20px 0;
    }
    
    .ukptg-layout-image-cards.cards-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .ukptg-layout-text-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ukptg-text-column:nth-child(2) {
        border-right: none;
    }
    
    .ukptg-text-column:nth-child(3),
    .ukptg-text-column:nth-child(4) {
        border-top: 1px solid #d8e2df;
    }
    
    .ukptg-layout-image-cards.cards-5,
    .ukptg-layout-image-cards.cards-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ukptg-promo-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .ukptg-promo-row .ukptg-promo-box:last-child {
        grid-column: span 2;
    }
    
    .ukptg-layout-mixed {
        grid-template-columns: 1fr;
    }
    
    .mixed-featured .featured-card img {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .ukptg-mega-dropdown {
        position: static !important;
        width: 100% !important;
        left: 0 !important;
        border-top: 1px solid #d0dbd7;
        box-shadow: none;
    }
    
    .ukptg-layout-text-columns,
    .mixed-text-columns {
        grid-template-columns: 1fr;
    }
    
    .ukptg-text-column {
        border-right: none !important;
        border-bottom: 1px solid #d8e2df;
    }
    
    .ukptg-text-column:last-child {
        border-bottom: none;
    }
    
    .ukptg-layout-image-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ukptg-promo-row {
        grid-template-columns: 1fr;
    }
    
    .ukptg-promo-row .ukptg-promo-box:last-child {
        grid-column: auto;
    }
    
    .ukptg-cta-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .ukptg-layout-image-cards {
        grid-template-columns: 1fr !important;
    }
}
