/**
 * ICONIC GEAR VAULT: MASTER LUXURY STYLES
 * Version: 3.2 (Final Complete)
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,400&family=Raleway:wght@400;700;800&display=swap');

/* =========================================================
   1. GLOBAL LAYOUT & GRID ENFORCEMENT
   ========================================================= */
.iconic-shop-wrapper, .dugout-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    font-family: 'Raleway', sans-serif; 
}

/* Update minmax to 320px to make the boxes wider */
.iconic-card-grid, 
html body .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; /* Wider Cards */
    gap: 30px !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset standard list styles to prevent theme conflict */
html body .woocommerce ul.products li {
    list-style: none !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

/* =========================================================
   2. MEMBER VAULT (The "Crowns" Design)
   ========================================================= */
.iconic-card {
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    overflow: visible; 
    transition: transform 0.2s;
}
.iconic-card:hover { 
    transform: translateY(-5px); 
    border-color: #555; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.iconic-card img {
    height: 180px; width: 100%; object-fit: contain; margin-top: 20px;
}
.iconic-card h3 {
    color: #fff; font-size: 1.1rem; margin: 10px 0 5px; font-family: 'Raleway', sans-serif; letter-spacing: 1px;
}
.big-gold-num {
    font-size: 3rem; color: #FAD961; font-weight: 900; font-family: 'Playfair Display', serif; line-height: 1; margin: 5px 0; text-shadow: 0 0 10px rgba(173, 140, 62, 0.3);
}
.crown-label {
    color: #888; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px;
}

/* Badges */
.card-badge {
    position: absolute; top: 15px; right: -10px; padding: 5px 15px; color: #fff; font-family: 'Raleway', sans-serif; font-weight: 800; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 10;
}
.card-badge::after {
    content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 0; border-style: solid; border-width: 5px 10px 0 0;
}
.badge-popular { background: #e74c3c; } .badge-popular::after { border-color: #c0392b transparent transparent transparent; }
.badge-value { background: #9b59b6; } .badge-value::after { border-color: #8e44ad transparent transparent transparent; }
.badge-gift { background: #2980b9; } .badge-gift::after { border-color: #2c3e50 transparent transparent transparent; }

/* Inputs & Modal */
.vault-inputs { padding: 0 20px 15px; margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.vault-select, .vault-input { background: #111; border: 1px solid #444; color: #fff; padding: 10px; font-size: 0.85rem; border-radius: 4px; width: 100%; }
.card-footer { border-top: 1px solid #333; padding: 15px; background: rgba(0,0,0,0.2); border-radius: 0 0 8px 8px; }

.iconic-green-btn {
    background-color: #27ae60 !important; border: 1px solid #27ae60 !important; color: #000 !important; font-weight: 900 !important; text-transform: uppercase; letter-spacing: 1px; padding: 12px; width: 100%; border-radius: 4px; cursor: pointer; transition: all 0.3s;
}
.iconic-green-btn:hover:not(:disabled) {
    background-color: #2ecc71 !important; box-shadow: 0 0 15px rgba(46, 204, 113, 0.6); transform: translateY(-2px);
}
.iconic-green-btn:disabled {
    background-color: #333 !important; border-color: #444 !important; color: #666 !important; cursor: not-allowed;
}

.vault-bar { background: #111; border: 1px solid #333; padding: 15px 25px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.vault-balance-label { color: #888; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
.vault-balance-val { color: #FAD961; font-weight: bold; font-size: 1.4rem; }
.vault-bag-trigger { cursor: pointer; text-align: right; color: #fff; font-weight: bold; }

/* =========================================================
   MODAL FIX (Scrollable & Sticky)
   ========================================================= */
.vault-modal { 
    display: none; 
    position: fixed; 
    z-index: 99999; /* Super high z-index */
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(5px); /* Nice blur effect behind */
}

.vault-modal-content { 
    background: #0a0a0a; 
    border: 1px solid #333; 
    width: 90%; 
    max-width: 500px; 
    padding: 30px; 
    position: relative; 
    color: #fff; 
    border-radius: 8px; 
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    
    /* FIX: Constrain height and allow scrolling */
    max-height: 85vh; 
    overflow-y: auto; 
    
    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #FAD961 #111;
}

/* Custom Scrollbar for Chrome/Safari */
.vault-modal-content::-webkit-scrollbar { width: 8px; }
.vault-modal-content::-webkit-scrollbar-track { background: #111; }
.vault-modal-content::-webkit-scrollbar-thumb { background: #FAD961; border-radius: 4px; }

/* FIX: Sticky Close Button so it never scrolls away */
.vault-close { 
    position: sticky; 
    top: 0; 
    float: right;
    margin-top: -10px;
    margin-right: -10px;
    font-size: 28px; 
    cursor: pointer; 
    color: #888; 
    z-index: 100;
    background: #0a0a0a; /* Covers content behind it */
    padding: 0 5px;
    border-radius: 50%;
    line-height: 1;
}
.vault-close:hover { color: #fff; }

.vault-item-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95rem; border-bottom: 1px solid #222; padding-bottom: 8px; }
.vault-totals-box { background: #111; padding: 15px; border-radius: 4px; margin: 20px 0; border: 1px solid #222; }
.vault-total-line { border-top: 1px solid #333; padding-top: 10px; font-size: 1.2rem; margin-top: 10px; color: #FAD961; font-weight: bold; }

/* =========================================================
   MODAL BUTTONS (Continue + Redeem)
   ========================================================= */

/* The Container */
.vault-actions {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-top: 20px;
}

/* Secondary Button (Continue Shopping) */
.vault-close-btn {
    background: transparent !important;
    border: 1px solid #444 !important;
    color: #ccc !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Raleway', sans-serif;
}
.vault-close-btn:hover {
    border-color: #888 !important;
    color: #fff !important;
    background: rgba(255,255,255,0.05) !important;
}

/* Primary Button (Redeem) - Ensuring it matches height */
.iconic-green-btn {
    width: 100%; /* Fill the grid column */
    height: 100%; /* Match height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Stack: On small screens, stack them vertically */
@media (max-width: 480px) {
    .vault-actions {
        grid-template-columns: 1fr; /* Stack */
    }
}

/* =========================================================
   3. PUBLIC WOOCOMMERCE OVERRIDES (Premium Flex Grid)
   ========================================================= */

/* 1. THE CARD (The Container) */
html body .woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    background: #0e1116 !important; /* Deep Dark Slate */
    border: 1px solid #333 !important;
    border-radius: 8px !important;
    overflow: hidden !important; /* Keeps corners rounded */
    transition: all 0.3s ease !important;
    padding: 0 !important;
    min-height: 480px !important; /* Consistent Height */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
}

/* Hover Effect: Lift & Gold Glow */
html body .woocommerce ul.products li.product:hover {
    transform: translateY(-8px) !important;
    border-color: #FAD961 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6) !important;
    z-index: 2 !important;
}

/* 2. THE IMAGE STAGE (Spotlight Background) */
html body .woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    flex-grow: 1 !important; /* Pushes footer down */
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
}

html body .woocommerce ul.products li.product a img {
    height: 240px !important;       /* Generous height */
    width: 100% !important;
    object-fit: contain !important; /* Shows 100% of image */
    object-position: center !important;
    margin: 0 !important;
    
    /* Internal Padding to save the sleeves */
    padding: 25px !important;       
    box-sizing: border-box !important;

    /* Subtle Spotlight Gradient behind the gear */
    background: radial-gradient(circle, #1a1f29 0%, #0e1116 70%) !important;
    border-bottom: 1px solid #222 !important;
}

/* 3. TITLE (Clean & White) */
html body .woocommerce ul.products li.product .woocommerce-loop-product__title {
    color: #fff !important;
    font-family: 'Raleway', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 15px 15px 5px !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    
    /* Force 2 lines of height so cards align even if titles are short */
    min-height: 3.5em !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 4. PRICE (Gold & Bold) */
html body .woocommerce ul.products li.product .price {
    display: block !important;
    color: #FAD961 !important;
    font-family: 'Playfair Display', serif !important;
    font-weight: 900 !important;
    font-size: 1.4rem !important;
    text-align: center !important;
    margin-bottom: 10px !important;
    text-shadow: 0 0 10px rgba(250, 217, 97, 0.2) !important;
}
html body .woocommerce ul.products li.product .price del { display: none !important; }

/* 5. FOOTER AREA (Inputs + Button) */
/* This pushes the whole footer to the bottom of the card */
.iconic-card-footer {
    margin-top: auto !important; 
    background: #080a0d !important; /* Slightly darker footer bg */
    border-top: 1px solid #222 !important;
    padding-top: 15px !important;
}

/* Dropdown Wrapper */
.iconic-select-wrap {
    padding: 0 15px 10px !important;
    text-align: center !important;
}

/* The Dropdown Itself */
.iconic-public-select {
    width: 100% !important;
    background: #1a1f29 !important;
    border: 1px solid #444 !important;
    color: #ccc !important;
    padding: 8px !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    outline: none !important;
}
.iconic-public-select:focus {
    border-color: #FAD961 !important;
    color: #fff !important;
}

/* 6. ADD TO CART BUTTON (Full Width) */
html body .woocommerce ul.products li.product .button,
html body .woocommerce ul.products li.product a.button {
    display: block !important;
    width: 100% !important;
    background-color: #27ae60 !important; /* Iconic Green */
    color: #000 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 15px 0 !important;
    border-radius: 0 !important; /* Square corners to fit bottom */
    margin: 0 !important;
    text-align: center !important;
    transition: background 0.3s !important;
}

html body .woocommerce ul.products li.product .button:hover,
html body .woocommerce ul.products li.product a.button:hover {
    background-color: #2ecc71 !important;
    color: #000 !important;
}

/* =========================================================
   4. CLEANUP (REMOVE CLUTTER)
   ========================================================= */
html body .woocommerce .woocommerce-result-count, 
html body .woocommerce .woocommerce-ordering,
html body .woocommerce ul.products li.product .star-rating,
html body .woocommerce ul.products li.product .onsale {
    display: none !important;
}