/* ==========================================================================
   ROOT VARIABLES & RESETS
   ========================================================================== */
:root {
    --primary-orange: #ff7f00;
    --dark-bg: #000000;
    --text-dark: #333333;
    --text-light: #ffffff;
    --font-main: "Open Sans", Arial, sans-serif;
    --font-heading: "Abolition", Impact, sans-serif;
    --sticky-offset: 0px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #f5f7fa; /* Default light background */
}

a { 
    text-decoration: none; 
    color: inherit; 
}

img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ==========================================================================
   GLOBAL UTILITIES
   ========================================================================== */
.section-pad { padding: 70px 0; }
.bg-white { background-color: #ffffff; }
.bg-light { background-color: #f5f7fa; border-top: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea; }
.bg-orange { background-color: var(--primary-orange); color: #ffffff; }
.bg-dark { background-color: #121212; color: #e0e0e0; }

/* ==========================================================================
   HEADER & TOP BAR (From header.php)
   ========================================================================== */
.top-bar { 
    background-color: var(--primary-orange); 
    color: var(--text-light); 
    padding: 8px 0; 
    font-size: 0.9em; 
}
.top-bar .container { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    gap: 20px; 
}

.top-support-btn {
    background-color: #ffffff; color: var(--primary-orange) !important; padding: 6px 14px;
    border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    display: inline-flex; align-items: center; gap: 6px; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); font-size: 0.95em;
}
.top-support-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); background-color: #f9f9f9; }
.top-support-btn span { font-size: 1.2em; }

header {
    background: #fff; padding: 20px 0; width: 100%; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: var(--text-dark); position: sticky; top: 0; transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
header.shrink { padding: 5px 0; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 110px; width: auto; transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
header.shrink .logo img { height: 60px; }
nav ul { display: flex; list-style: none; gap: 25px; font-weight: 600; text-transform: uppercase; font-family: var(--font-heading); font-size: 1.5rem; letter-spacing: 1px; align-items: center; }
nav a { color: var(--text-dark) !important; transition: color 0.2s; }
nav a:hover { color: var(--primary-orange) !important; }
nav a.active { color: var(--primary-orange) !important; font-weight: bold; }

.page-hero { background: url('images/pcz4u-hero-bg.jpg') center center / cover no-repeat, var(--primary-orange); color: #fff; padding: 80px 20px; text-align: center; overflow: hidden; }
.page-hero h1 { font-family: var(--font-heading); font-size: 4.5rem; text-transform: uppercase; margin: 15px 0; font-weight: 400; letter-spacing: 1px; line-height: 1; }
.page-hero h1 span { color: #000; }
.page-hero img { margin: 0 auto; }

/* ==========================================================================
   FOOTER (From footer.php)
   ========================================================================== */
footer {
    padding-top: 10px !important; 
    padding-bottom: 0 !important; 
    background-color: #000;
    color: #fff;
    font-family: var(--font-main);
}
.footer-content {
    display: grid;
    grid-template-columns: auto auto auto auto; 
    justify-content: center; 
    gap: 60px; 
    align-items: center; 
    padding-bottom: 25px !important; 
}
.footer-logo img {
    max-width: 100%;
    height: auto;
    margin: 0 auto; 
    display: block;
}
.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-menu li { margin-bottom: 8px; }
.footer-menu a {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px; 
    transition: color 0.2s ease;
}
.footer-menu a:hover { color: var(--primary-orange); }
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px; 
}
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px; 
}
.contact-item span.icon {
    font-size: 1.2rem;
    line-height: 1.2;
}
.contact-item p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.95rem;
}
.map-wrapper {
    position: relative; width: 180px; height: 180px; border-radius: 6px; overflow: hidden; 
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: transform 0.3s ease;
}
.map-wrapper:hover { transform: scale(1.05); }
.map-trigger-square { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.3s ease; }
.map-wrapper:hover .map-trigger-square { opacity: 0.85; }
.map-overlay-text {
    position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); 
    color: #fff; text-align: center; padding: 10px 5px; font-size: 0.85rem; font-weight: bold; 
    pointer-events: none; text-transform: uppercase; letter-spacing: 0.5px;
}
.footer-bottom {
    background-color: var(--primary-orange); 
    padding: 15px 20px !important; margin-top: 0 !important; 
    text-align: center; font-size: 0.9rem; color: #000; 
}
.footer-bottom .container { display: flex; justify-content: center; align-items: center; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #000; font-weight: bold; text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   HOMEPAGE SPECIFICS (From original master.css)
   ========================================================================== */
.services-grid { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin: 0 auto; max-width: 1200px; padding: 0 20px; }
.service-card {
    flex: 1; min-width: 250px; max-width: 350px; text-align: center; display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: inherit; background: #ffffff; padding: 30px 20px; border-radius: 12px; border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}
.service-card:hover { transform: translateY(-10px); box-shadow: 0 12px 30px rgba(255, 127, 0, 0.15); border-color: var(--primary-orange); }
.service-card img { max-width: 130px; height: auto; margin-bottom: 20px; transition: transform 0.3s ease; }
.service-card:hover img { transform: scale(1.05); }
.service-card h2 { color: var(--text-dark); font-size: 1.8rem; text-transform: uppercase; font-family: var(--font-heading); letter-spacing: 1px; margin: 0; transition: color 0.3s ease; }
.service-card:hover h2 { color: var(--primary-orange); }

.about-flex { display: flex; align-items: center; gap: 50px; margin: 0 auto; flex-wrap: wrap; padding: 0 20px; }
.about-text { flex: 1.2; min-width: 300px; font-size: 1.1rem; }
.about-text p { margin-bottom: 20px; }
.about-text a { color: var(--primary-orange); font-weight: bold; text-decoration: underline; }
.about-image { flex: 1; min-width: 300px; text-align: center; }
.about-image img { border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.support-grid { display: flex; align-items: center; gap: 50px; flex-wrap: wrap; padding: 0 20px; }
.support-image { flex: 1; text-align: center; min-width: 250px; }
.support-text { flex: 1.5; min-width: 300px; }
.support-text h2 { font-family: var(--font-heading); font-size: 3rem; text-transform: uppercase; line-height: 1.1; margin-bottom: 20px; }
.support-text h2 span { color: var(--primary-orange); }
.support-text p { font-size: 1.1rem; }

.support-form { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; padding: 0 20px; }
.support-form input { padding: 15px; border: 1px solid #ccc; border-radius: 4px; flex: 1; min-width: 220px; font-family: var(--font-main); font-size: 1rem; }
.support-form input:focus { border-color: var(--primary-orange); outline: none; }
.support-form button { background: var(--primary-orange); color: #fff; border: none; padding: 15px 35px; border-radius: 4px; font-weight: bold; font-size: 1.1rem; cursor: pointer; text-transform: uppercase; transition: background 0.3s; white-space: nowrap; }
.support-form button:hover { background: #e67300; }

/* ==========================================================================
   MODALS, TOASTS & POPUPS
   ========================================================================== */
#toast-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7);
    z-index: 9999; display: none; justify-content: center; align-items: center;
}
#toast-box {
    background: #ffffff; padding: 40px; border-radius: 8px; max-width: 450px; width: 90%;
    text-align: center; box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}
#toast-box h3 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 15px; color: var(--primary-orange); letter-spacing: 1px; font-weight: 400; text-transform: uppercase; }
#toast-box p { font-size: 1.1rem; margin-bottom: 25px; color: #333; }
#toast-box button { background-color: var(--primary-orange); color: white; border: none; padding: 12px 30px; font-size: 1.1rem; font-weight: bold; border-radius: 4px; cursor: pointer; text-transform: uppercase; transition: background 0.3s; }
#toast-box button:hover { background-color: #e67300; }

.global-modal-overlay, .modal-overlay, .map-modal-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); 
    z-index: 20000; justify-content: center; align-items: center; backdrop-filter: blur(3px);
}
.global-modal-overlay.active, .modal-overlay.active { display: flex; }
.global-modal-box, .modal-box { 
    background: #1e1e1e; padding: 30px; border-radius: 12px; width: 90%; max-width: 400px; 
    position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.6); border: 1px solid #333; color: #e0e0e0; font-family: var(--font-main);
}
.map-modal-content { position: relative; max-width: 90vw; max-height: 90vh; }
.map-modal-content a { display: block; position: relative; text-decoration: none; }
.map-modal-content img { display: block; max-width: 100%; max-height: 90vh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
.modal-overlay-text { position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); color: #fff; text-align: center; padding: 15px; font-size: 1rem; font-weight: bold; pointer-events: none; text-transform: uppercase; letter-spacing: 0.5px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }

#support-download-popup {
    position: fixed; top: 20px; right: 20px; width: 340px; background: #ffffff; color: #333; z-index: 20000; 
    border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); padding: 20px 25px; border: 1px solid #eee; 
    display: none; opacity: 0; transform: translateY(-20px); transition: opacity 0.3s ease, transform 0.3s ease;
}
#support-download-popup.active { display: block !important; opacity: 1 !important; transform: translateY(0) !important; }
.shortcut-key { background: #eee; border: 1px solid #ccc; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-weight: bold; color: #333; }

@keyframes bounceUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ==========================================================================
   PRODUCT DETAILS & STORE CATALOG (From product-detail.php)
   ========================================================================== */
.view-toggles { display: flex; gap: 5px; background: #2c2c2c; padding: 4px; border-radius: 6px; }
.view-btn { background: transparent; border: none; color: #888; padding: 8px 12px; cursor: pointer; border-radius: 4px; font-weight: bold; font-size: 0.9rem; transition: 0.2s; }
.view-btn.active { background: #444; color: #fff; }

.product-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 80px; }
.product-view-list { display: flex; flex-direction: column; gap: 15px; padding-bottom: 80px; }

.prod-card { background: #ffffff; border: 1px solid #eaeaea; border-radius: 8px; padding: 15px; display: flex; position: relative; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; box-sizing: border-box; color: #333333; overflow: hidden; }
.prod-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.5); transform: translateY(-3px); border-color:#ccc; }
.prod-card.hidden-item { opacity: 0.5; border: 2px dashed #ff4444; }

.prod-img-box { display: flex; justify-content: center; align-items: center; background: #ffffff; border-radius: 4px; flex-shrink: 0; }
.prod-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.3s; }
.prod-img-box img.loaded { opacity: 1; }

.prod-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prod-badge { background: #f0f0f0; color: #555; font-size: 0.75em; padding: 4px 10px; border-radius: 20px; align-self: flex-start; margin-bottom: 10px; font-weight: bold; text-transform: uppercase;}
.prod-title { font-size: 1rem; font-weight: 600; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; color:#111; }

.prod-action { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; justify-content: flex-end; }
.prod-price { font-size: 1.8rem; color: var(--primary-orange); margin-bottom: 2px; font-weight:900; line-height: 1; }
.prod-price-gst { font-size: 0.75rem; color: #888; font-weight: normal; margin-bottom: 15px; text-transform: uppercase;}

.add-cart-btn { background: #000; color: #fff; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; font-size:0.95rem; text-align: center; white-space: nowrap;}
.add-cart-btn:hover { background: var(--primary-orange); }

.product-view-grid .prod-card { flex-direction: column; height: 100%; }
.product-view-grid .prod-img-box { width: 100%; height: 180px; margin-bottom: 15px; }
.product-view-grid .prod-info { margin-bottom: 15px; }
.product-view-grid .prod-action { align-items: flex-start; margin-top: auto; width: 100%; }
.product-view-grid .add-cart-btn { width: 100%; }

.product-view-list .prod-card { flex-direction: row; align-items: center; gap: 25px; padding: 20px; }
.product-view-list .prod-img-box { width: 150px; height: 150px; }
.product-view-list .prod-action { width: 200px; align-items: flex-end; text-align: right; border-left: 1px solid #eee; padding-left: 20px;}
.product-view-list .add-cart-btn { width: 100%; }

/* Admin Store Controls */
.admin-stats-box { font-size:0.75rem; margin-top:15px; background:#f0f0f0; padding:10px; border-radius:6px; border:1px solid #ddd; color:#333; width: 100%; box-sizing: border-box; cursor: default;}
.admin-toggle-btn { margin-top:10px; width:100%; padding:8px; font-size:0.85em; background:#333; color:#fff; border:none; cursor:pointer; font-weight:bold; border-radius:4px;}
.admin-toggle-btn.unhide { background:#27ae60; }

/* Universal Inline Product View */
#universal-product-view { display: none; animation: fadeIn 0.3s ease; width: 100%;}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.upv-back-btn { background: transparent; color: var(--primary-orange); border: 1px solid var(--primary-orange); padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 5px; transition: 0.2s;}
.upv-back-btn:hover { background: var(--primary-orange); color: #fff; }
.upv-container { background: #1e1e1e; border: 1px solid #333; border-radius: 8px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); color: #e0e0e0; }
.upv-top-section { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 30px; }
.upv-image-wrapper { flex: 1 1 300px; max-width: 450px; background: #ffffff; border-radius: 8px; padding: 20px; display: flex; justify-content: center; align-items: flex-start; border: 1px solid #eee;}
.upv-image-wrapper img { max-width: 100%; max-height: 400px; object-fit: contain; }
.upv-core-info { flex: 2 1 300px; display: flex; flex-direction: column; justify-content: flex-start;}
.upv-badge { background: #333; color: #fff; font-size: 0.75rem; padding: 5px 12px; border-radius: 20px; align-self: flex-start; margin-bottom: 15px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px;}
.upv-title { font-size: 2.2rem; font-weight: bold; color: #fff; margin: 0 0 10px 0; line-height: 1.2; font-family: var(--font-heading, sans-serif); letter-spacing: 0.5px;}
.upv-sku-wrapper { color: #888; font-family: monospace; font-size: 0.95rem; margin-bottom: 15px;}
.upv-price { font-size: 3rem; font-weight: bold; color: var(--primary-orange); line-height: 1; margin-bottom: 5px;}
.upv-gst-note { font-size: 0.8rem; color: #888; margin-bottom: 30px; font-weight: bold;}
.upv-action-container { margin-top: auto; padding-top: 20px; border-top: 1px solid #333;}
.upv-divider { height: 1px; background: #333; margin: 0 0 30px 0; width: 100%; }
.upv-rich-desc { font-size: 1.05rem; line-height: 1.7; color: #ccc; overflow-wrap: break-word; }
.upv-rich-desc * { max-width: 100% !important; } 
.upv-rich-desc img { height: auto !important; border-radius: 6px; margin: 20px 0; display: block;}
.upv-rich-desc p { margin-bottom: 15px; }
.upv-rich-desc h1, .upv-rich-desc h2, .upv-rich-desc h3, .upv-rich-desc h4, .upv-rich-desc h5 { color: #fff; margin: 30px 0 15px 0; font-family: sans-serif;}
.upv-rich-desc ul, .upv-rich-desc ol { margin-bottom: 20px; padding-left: 20px; }
.upv-rich-desc li { margin-bottom: 8px; }
.upv-rich-desc table { width: 100% !important; border-collapse: collapse; margin: 20px 0; background: #222;}
.upv-rich-desc th, .upv-rich-desc td { padding: 12px; border: 1px solid #444; text-align: left; vertical-align: top;}
.upv-rich-desc th { background: #333; color: #fff; font-weight: bold;}
.upv-rich-desc a { color: var(--primary-orange); text-decoration: underline; }

/* ==========================================================================
   SYSTEM BUILDER UI (Reconstructed for design-your-rig.php)
   ========================================================================== */
.content-wrapper {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sticky Header */
.sticky-builder-header {
    position: sticky;
    top: var(--sticky-offset, 80px); /* Uses JS offset to stick right below main header */
    background: #111;
    border-bottom: 2px solid var(--primary-orange);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 990;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    color: #fff;
}

.progress-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.step-label {
    background: #333;
    color: #888;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
}

.step-label:hover {
    background: #444;
    color: #fff;
}

.step-label.active {
    background: var(--primary-orange);
    color: #fff;
}

.step-label.completed {
    background: #27ae60;
    color: #fff;
}

.header-metrics {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Main Builder Panels */
.builder-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seamless-view-panel {
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--primary-orange);
    margin: 0;
    letter-spacing: 1px;
    font-weight: normal;
}

/* Catalog Controls */
.catalog-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    background: #111;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.catalog-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-controls-bottom {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.control-input {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 10px 15px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.control-input:focus {
    outline: none;
    border-color: var(--primary-orange);
}

.strict-toggle-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #333;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    user-select: none;
    border: 1px solid #444;
}

.strict-toggle-modern.active {
    background: #2a3d2e;
    border-color: #27ae60;
    color: #2ecc71;
}

/* Ledger (Review Step) */
.review-ledger {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-row {
    display: grid;
    grid-template-columns: 150px 1fr auto 150px 150px 120px;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    gap: 15px;
}

.ledger-step { font-weight: bold; color: var(--primary-orange); text-transform: uppercase; font-size: 0.9rem; }
.ledger-part { font-size: 1.05rem; font-weight: 600; color: #111; }
.ledger-title-text { cursor: pointer; transition: color 0.2s; }
.ledger-title-text:hover { color: var(--primary-orange); text-decoration: underline; }
.ledger-conflict { color: #e74c3c; font-size: 0.85rem; font-weight: bold; }
.ledger-status-wrap { text-align: center; }
.ledger-status { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; background: #27ae60; color: #fff; }
.ledger-status.missing { background: #e74c3c; }
.ledger-status.empty { background: #7f8c8d; }
.ledger-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ledger-price { font-size: 1.2rem; font-weight: bold; color: #111; text-align: right; }

.btn-small { padding: 6px 12px; font-size: 0.85rem; }

/* Responsive adjustments for Media Queries */
@media (max-width: 1100px) {
    .ledger-row {
        grid-template-columns: 100px 1fr auto 120px 140px 100px;
    }
}
@media (max-width: 950px) {
    .footer-content { grid-template-columns: auto auto; gap: 40px; }
}
@media (max-width: 850px) {
    .ledger-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .ledger-actions { width: 100%; justify-content: flex-start; margin-top: 10px; }
    .ledger-price { align-self: flex-start; margin-top: 10px; }
    
    .sticky-builder-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .header-metrics {
        width: 100%;
        justify-content: space-between;
    }
}
@media (max-width: 768px) {
    .top-support-btn { display: none !important; }
    .top-bar .container { flex-direction: column; justify-content: center; text-align: center; gap: 10px; }
    .header-content { flex-direction: column; gap: 20px; }
    nav ul { flex-wrap: wrap; justify-content: center; }
    .page-hero h1 { font-size: 3rem; }
    #support-download-popup { width: 90%; right: 5%; left: 5%; }
    
    .upv-container { padding: 20px; }
    .upv-title { font-size: 1.6rem; }
    .upv-price { font-size: 2.2rem; }
}
@media (max-width: 600px) {
    .footer-content { grid-template-columns: 1fr; text-align: center; gap: 40px; padding: 20px; }
    .footer-logo img { max-width: 160px; }
    .footer-menu ul { display: flex; flex-direction: column; align-items: center; }
    .footer-contact { align-items: center; }
    .contact-item { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 5px; }
    .contact-item p { text-align: center; }
    .map-wrapper { margin: 0 auto; }
    .footer-bottom .container { flex-direction: column; }
}

/* ==========================================================================
   DESIGN YOUR RIG - BUILDER MODULES
   ========================================================================== */

/* --- Toast Notifications --- */
.mini-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 99999;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mini-toast-success { background-color: #27ae60; color: #fff; }
.mini-toast-error { background-color: #c0392b; color: #fff; }

/* --- Admin In-Flow Panels (Formerly Modals) --- */
.admin-inline-panel {
    background: #111;
    border-radius: 8px;
    border: 1px solid #333;
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}
.admin-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    align-items: stretch;
}
.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}
.admin-panel-title {
    margin: 0;
    color: #fff;
    font-family: var(--font-heading, inherit);
    font-weight: normal;
    letter-spacing: 1px;
}

/* --- Rules Editor & Debugger --- */
.smart-rules-editor {
    width: 100%;
    flex: 1;
    min-height: 400px;
    background: #000;
    color: #0f0;
    border: 1px solid #333;
    padding: 15px;
    font-family: monospace;
    border-radius: 4px;
    margin-bottom: 20px;
    resize: vertical;
}
.debug-output-console {
    line-height: 1.6;
    background: #000;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 4px;
    flex: 1;
    max-height: 600px;
    overflow-y: auto;
    font-family: monospace;
    color: #0f0;
    font-size: 0.95rem;
}
.power-analysis-card {
    background: #1a252f;
    border: 2px solid #3498db;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.power-analysis-metrics {
    text-align: right;
    background: #000;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #333;
}

/* --- Profitability Summary Table & Stats --- */
.profit-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}
@media (max-width: 1200px) {
    .profit-stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.profit-stat-card {
    background: #111;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    text-align: center;
}
.profit-stat-card.highlight-ex { background: #0a0a0a; border: 1px dashed #27ae60; }
.profit-stat-card.highlight-inc { background: #0a0a0a; border: 1px solid #2ecc71; }
.profit-stat-label { color: #aaa; font-size: 0.75rem; text-transform: uppercase; }
.profit-stat-value { color: #fff; font-size: 1.2rem; font-weight: bold; }
.profit-stat-value.text-green { color: #2ecc71; }

.profit-table-wrapper {
    background: #111;
    border-radius: 6px;
    border: 1px solid #333;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.profit-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.profit-table th {
    padding: 8px 12px;
    color: var(--primary-orange);
    font-size: 0.85rem;
    background: #222;
    position: sticky;
    top: 0;
    z-index: 5;
}
.profit-table td {
    padding: 6px 12px;
    color: #fff;
    font-size: 0.85rem;
    border-bottom: 1px solid #333;
}

/* --- Modals --- */
.modal-overlay.active { display: flex; }
.modal-box {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid #333;
}
.modal-title { color: var(--primary-orange); margin-top: 0; font-size: 2.2rem; font-family: var(--font-heading, inherit); font-weight: normal; letter-spacing: 1px; }

/* --- Catalog & Product Cards --- */
.product-card {
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card-normal { background: #2c2c2c; border: 2px solid #444; }
.product-card-selected { background: #3a2210; border: 2px solid var(--primary-orange); }
.product-card-incompatible { background: #2c2c2c; border: 2px solid #c0392b; opacity: 0.7; }
.product-tag-pill {
    background: #0a192f;
    color: #5dade2;
    border: 1px solid #2980b9;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* --- Flyer / PDF Rendering Scope --- */
.a4-flyer-canvas {
    width: 210mm;
    height: 296mm;
    margin: 0 auto;
    background-color: #fff;
    padding: 15mm;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    color: #111;
}