/* Import Poppins Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */
body { 
    font-family: 'Poppins', sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: #f4f7f6; 
    color: #333333; 
}
h1, h2, h3, h4, h5, h6, label { 
    color: #111111; 
    font-weight: 500; 
}
label { 
    font-size: 14px; 
    display: block; 
    margin-top: 10px; 
    margin-bottom: 5px; 
}
.helper-text { font-size: 12px; color: #666; }

/* Default to hiding mobile sticky elements on desktop */
.mobile-only-action { display: none !important; }

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
header { 
    background: #ffffff; 
    padding: 10px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}
.logo-container { flex: 1; display: flex; justify-content: flex-start; }
.header-logo { max-height: 50px; width: auto; }

.primary-menu { flex: 2; display: flex; justify-content: center; gap: 30px; align-items: center; }
.primary-menu a { text-decoration: none; color: #333; font-weight: 600; font-size: 15px; transition: color 0.2s ease; }
.primary-menu a:hover { color: #6607af; }

.header-actions { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.cart-icon-wrapper { position: relative; color: #333; font-size: 20px; text-decoration: none; transition: color 0.2s; display: flex; align-items: center; }
.cart-icon-wrapper:hover { color: #6607af; }
.cart-badge { position: absolute; top: -8px; right: -12px; background-color: #d93025; color: white; font-size: 10px; font-weight: bold; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.mobile-menu-toggle { display: none; font-size: 24px; cursor: pointer; color: #333; margin-left: 10px; }

.user-menu { position: relative; display: inline-block; }
.user-avatar { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    object-fit: cover; 
    cursor: pointer; 
    border: 2px solid #6607af; 
    background-color: #fff; 
    display: block; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.user-avatar:hover { 
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(102, 7, 175, 0.2);
}

.dropdown-content { display: none; position: absolute; right: 0; top: 55px; background-color: #ffffff; min-width: 220px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); border-radius: 8px; z-index: 1001; overflow: hidden; border: 1px solid #eaeaea; animation: dropFade 0.2s ease; }
@keyframes dropFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-content.show { display: block; }
.dropdown-header { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; background: #fafafa; font-size: 13px; color: #555; }
.dropdown-content a { color: #333; padding: 12px 20px; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 14px; transition: background 0.2s; }
.dropdown-content a:hover { background-color: #f8f9fc; color: #6607af; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn { background-color: #000000; color: #ffffff; border: none; padding: 10px 20px; cursor: pointer; font-weight: 500; border-radius: 4px; transition: background-color 0.2s; font-family: 'Poppins', sans-serif; }
.btn:hover { background-color: #333333; }
.btn-secondary { background-color: #f0f0f0; color: #333; margin-top: 10px; }
.btn-secondary:hover { background-color: #e0e0e0; color: #333; }

.submit-btn { 
    width: 100%; 
    margin-top: 15px; 
    padding: 12px; 
    font-size: 16px; 
    font-weight: 600; 
    border-radius: 6px; 
    background-color: #6607af; 
    color: #ffffff; 
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.submit-btn:hover { 
    background-color: #530591; 
    box-shadow: 0 4px 12px rgba(102, 7, 175, 0.2);
}

.auth-btn-header {
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; 
    border-radius: 6px;
}

.btn-card { width: 100%; padding: 10px; border-radius: 6px; border: none; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s ease; text-align: center; display: flex; justify-content: center; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif; }
.btn-add-cart { background-color: #6607af; color: white; }
.btn-add-cart:hover { background-color: #530591; }
.btn-full-pay { background-color: #333; color: white; flex: 1; font-size: 13px; padding: 10px; }
.btn-full-pay:hover { background-color: #000; }
.btn-deposit { background-color: #e65100; color: white; flex: 1; font-size: 13px; padding: 10px; }
.btn-deposit:hover { background-color: #bf4300; }

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea { 
    padding: 12px 15px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    font-family: 'Poppins', sans-serif; 
    font-size: 14px; 
    transition: border-color 0.2s, box-shadow 0.2s; 
    width: 100%; 
    box-sizing: border-box; 
}
input:focus, select:focus, textarea:focus { border-color: #6607af; outline: none; box-shadow: 0 0 0 3px rgba(102, 7, 175, 0.1); }
.styled-select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 15px center; background-size: 15px; padding-right: 40px; }
.form-row { display: flex; gap: 15px; }
.form-group { flex: 1; }

.forgot-link-container { text-align: right; margin-top: -5px; margin-bottom: 15px; width: 100%; }
.forgot-link-container a { color: #6607af; font-size: 13px; text-decoration: none; font-weight: 500; }
.forgot-link-container a:hover { text-decoration: underline; }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.modal-content { background-color: #ffffff; margin: 10vh auto; padding: 30px; border: 1px solid #ddd; width: 90%; max-width: 450px; box-sizing: border-box; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); position: relative; animation: modalFadeIn 0.3s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.close-btn { color: #999; position: absolute; top: 15px; right: 15px; font-size: 24px; font-weight: bold; cursor: pointer; transition: color 0.2s; z-index: 10; padding: 5px; line-height: 1; }
.close-btn:hover { color: #333; }
.auth-toggle { display: flex; width: 100%; box-sizing: border-box; margin-bottom: 20px; border-bottom: 2px solid #eaeaea; }
.auth-toggle button { flex: 1; background: none; border: none; padding: 12px 5px; font-weight: 600; color: #888; cursor: pointer; transition: color 0.2s; font-size: 14px; white-space: nowrap; }
.auth-toggle button.active { color: #6607af; border-bottom: 2px solid #6607af; margin-bottom: -2px; }
.modal-content form { display: flex; flex-direction: column; width: 100%; }
.modal-content form label { display: block; width: 100%; margin-top: 10px; margin-bottom: 5px; font-weight: 500; color: #333; text-align: left; }
.modal-content form input { display: block; width: 100%; margin-bottom: 15px; box-sizing: border-box; }

/* ==========================================================================
   ALERTS & FEEDBACK
   ========================================================================== */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-success { background-color: #e6f4ea; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background-color: #fce8e6; color: #d93025; border: 1px solid #ffcdd2; }

/* ==========================================================================
   PRODUCT CATALOG & GRIDS
   ========================================================================== */
.store-container { max-width: 1400px; margin: 0 auto; padding: 30px 5%; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #eaeaea; }
.section-header h2 { margin: 0; font-size: 24px; font-weight: 700; }
.view-more-link { font-size: 14px; font-weight: 600; color: #6607af; text-decoration: none; transition: opacity 0.2s; }
.view-more-link:hover { opacity: 0.8; }
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-bottom: 50px; transition: opacity 0.3s ease; }
.desktop-1-row { grid-template-rows: 1fr; }

/* Product Cards */
.product-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; position: relative; border: 1px solid #eaeaea; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.card-badge { position: absolute; top: 10px; left: 10px; background: #d93025; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; z-index: 2; }
.badge-po { background: #e65100; }
.card-img { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; display: flex; justify-content: center; align-items: center; background-color: #fcfcfc; border-bottom: 1px solid #eaeaea; }
.card-img img { width: 80%; height: 80%; object-fit: contain; transition: transform 0.3s ease; }
.product-card:hover .card-img img { transform: scale(1.08); }
.card-body { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 15px; font-weight: 700 !important; color: #111; margin: 0 0 10px 0; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price-wrapper { margin-bottom: 15px; margin-top: auto; }
.card-price { font-size: 16px; font-weight: 600 !important; color: #6607af !important; }
.card-price-old { font-size: 12px; color: #999; text-decoration: line-through; margin-left: 5px; font-weight: 600; }
.po-split-btns { display: flex; gap: 8px; flex-direction: row; margin-top: auto;}

/* Catalog Toolbars */
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 15px 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); margin-bottom: 25px; gap: 15px; flex-wrap: wrap; border: 1px solid #eaeaea; }
.catalog-search { flex: 1; min-width: 200px; position: relative; }
.catalog-search input { margin: 0; padding-left: 35px; width: 100%; }
.catalog-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #888; }
.catalog-sort { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #333; }
.catalog-sort select { margin: 0; padding: 10px; width: 180px; }
.pagination-container { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap;}
.page-link { text-decoration: none; color: #6607af; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 6px; background: #fff; border: 1px solid #eaeaea; transition: all 0.2s; cursor: pointer; }
.page-link:hover { background: #f4f7f6; }

/* ==========================================================================
   PRODUCT DETAIL PAGE SPECIFIC UI
   ========================================================================== */
.product-detail-main { background-color: #f4f7f6; min-height: 100vh; padding: 40px 5%; }
.detail-page-wrapper { max-width: 1200px; padding: 0; margin: 0 auto; }
.detail-container { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; background: #fff; padding: 40px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); margin-bottom: 50px; }
.detail-gallery { display: flex; flex-direction: column; gap: 15px; }
.main-image-box { width: 100%; aspect-ratio: 1/1; background: #fcfcfc; border: 1px solid #eaeaea; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.main-image { width: 85%; height: 85%; object-fit: contain; }
.thumbnail-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none;}
.thumbnail-row::-webkit-scrollbar { display: none; }
.thumbnail { width: 70px; height: 70px; object-fit: contain; border: 2px solid #eaeaea; border-radius: 8px; cursor: pointer; padding: 4px; transition: border-color 0.2s; background: #fff; }
.thumbnail:hover { border-color: #6607af; }

.detail-info { display: flex; flex-direction: column; justify-content: center; }
.detail-status-bar { margin-bottom: 15px; }
.detail-status-badge { color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-status-badge.po { background-color: #e65100; }
.detail-status-badge.ready { background-color: #2e7d32; }
.detail-brand-category { font-size: 14px; color: #6607af; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 0.5px; }
.detail-title { margin: 0 0 10px 0; font-size: 28px; font-weight: 600; color: #111; line-height: 1.2; }
.detail-sku { color: #888; font-size: 14px; font-family: monospace; margin-bottom: 25px; display: block; }
.detail-price-box { background: #f8f9fc; padding: 25px; border-radius: 12px; margin-bottom: 30px; border: 1px solid #e9e0f2; }
.price-main { font-size: 22px; font-weight: 600; color: #6607af; margin-bottom: 5px; line-height: 1; }
.price-old { font-size: 18px; color: #999; text-decoration: line-through; font-weight: 600; margin-left: 10px; }
.po-deposit-box { background: #fff3e0; padding: 12px 15px; border-radius: 8px; border: 1px dashed #e65100; margin-top: 15px; }
.deposit-title { color: #e65100; font-weight: 700; font-size: 14px; }
.deposit-balance { color: #555; font-size: 13px; margin-top: 4px; }
.detail-desc { font-size: 15px; color: #444; line-height: 1.8; white-space: pre-wrap; margin-bottom: 30px; border-bottom: 1px solid #eaeaea; padding-bottom: 30px; }

.po-tnc-container { margin-bottom: 30px; border: 1px solid #ffcc80; border-radius: 8px; overflow: hidden; background: #fffaf0; }
.po-tnc-header { background: #fff3e0; padding: 15px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: #e65100; font-weight: 700; font-size: 15px; user-select: none; }
.po-tnc-content { display: none; padding: 20px; font-size: 13.5px; color: #555; line-height: 1.6; border-top: 1px dashed #ffcc80; }
.po-tnc-content ul { margin: 0; padding-left: 20px; }
.po-tnc-content li { margin-bottom: 10px; }
.po-tnc-content li:last-child { margin-bottom: 0; }

.detail-action-box { background: #fff; padding: 20px; border: 1px solid #eaeaea; border-radius: 12px; }
.qty-wrapper { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.qty-wrapper label { font-weight: 700; color: #111; margin: 0; font-size: 15px; }
.sold-out-tag { color: #d93025; font-weight: 700; font-size: 14px; background: #fce8e6; padding: 6px 12px; border-radius: 6px; }

/* Hide Number Inputs Spinners globally */
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type=number] { -moz-appearance: textfield; }

/* QUANTITY CONTROLS (Perfect Height Match Fix) */
.qty-control { display: flex; align-items: stretch; border: 2px solid #eaeaea; border-radius: 8px; overflow: hidden; width: fit-content; background: #fff; height: 48px; }
.qty-btn { background: #f9f9f9; border: none; padding: 0 18px; font-size: 20px; cursor: pointer; color: #333; transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover:not(:disabled) { background: #eaeaea; }
.qty-btn:disabled { color: #ccc; cursor: not-allowed; }
.qty-input { width: 60px; text-align: center; border: none !important; border-left: 2px solid #eaeaea !important; border-right: 2px solid #eaeaea !important; font-size: 16px; font-weight: 700; padding: 0; border-radius: 0 !important; margin: 0 !important; background: #fff; height: 100%; box-sizing: border-box; }

.action-btn-wrapper { display: flex; gap: 15px; }
.action-btn-wrapper .btn-card { height: 48px; font-size: 16px; border-radius: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 20px; }
.btn-sold-out { background: #999 !important; color: #fff; cursor: not-allowed !important; }
.badge-soldout { background: #555 !important; }

.related-header { margin-top: 60px; }
.related-carousel { display: flex; overflow-x: auto; gap: 20px; padding-bottom: 25px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.related-carousel::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 calc(20% - 16px); scroll-snap-align: start; min-width: 200px; }
.carousel-item .product-card { height: 100%; }

/* ==========================================================================
   CART PAGE & RESPONSIVE TABLE STYLES
   ========================================================================== */
.cart-main-container { background-color: #f4f7f6; min-height: 100vh; padding-bottom: 50px; }
.responsive-cart-table { width: 100%; border-collapse: collapse; background: #fff; }
.responsive-cart-table th { text-align: left; padding: 15px; border-bottom: 2px solid #eaeaea; color: #888; font-size: 14px; font-weight: 600; background: #f9f4fd; text-transform: uppercase; }
.responsive-cart-table td { padding: 20px 15px; border-bottom: 1px solid #eaeaea; vertical-align: middle; }
.cart-product-flex { display: flex; align-items: center; gap: 20px; }

.cart-bottom-wrapper { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 30px; gap: 30px; }
.promo-section, .summary-section { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); flex: 1; border: 1px solid #eaeaea; min-width: 300px;}
.promo-section h3, .summary-section h3 { margin: 0 0 20px 0; font-size: 18px; font-weight: 700; color: #111; border-bottom: 2px solid #eaeaea; padding-bottom: 15px; }

/* Side Cart */
.side-cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1050; display: none; opacity: 0; transition: opacity 0.3s ease; }
.side-cart-overlay.show { display: block; opacity: 1; }
.side-cart { position: fixed; top: 0; right: -450px; width: 400px; max-width: 90%; height: 100%; background: #fff; z-index: 1060; box-shadow: -4px 0 25px rgba(0,0,0,0.15); display: flex; flex-direction: column; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.side-cart.open { right: 0; }
.side-cart-header { padding: 20px; border-bottom: 1px solid #eaeaea; display: flex; justify-content: space-between; align-items: center; }
.side-cart-header h3 { margin: 0; font-size: 20px; font-weight: 800; color: #111; }
.close-cart-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: #888; transition: color 0.2s; }
.close-cart-btn:hover { color: #d93025; }
.side-cart-body { flex: 1; overflow-y: auto; padding: 20px; }
.side-cart-footer { padding: 20px; border-top: 1px solid #eaeaea; background: #fafafa; }
.side-cart-item { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
.side-cart-item img { width: 70px; height: 70px; object-fit: contain; border: 1px solid #eaeaea; border-radius: 8px; padding: 2px; background: #fff;}
.side-cart-item-details { flex: 1; display: flex; flex-direction: column; justify-content: center;}
.side-cart-item-title { font-size: 14px; font-weight: 700; color: #333; margin: 0 0 5px 0; line-height: 1.3; }
.side-cart-item-price { color: #6607af; font-weight: 800; font-size: 15px; }

/* ==========================================================================
   USER PROFILE DASHBOARD & ORDER HISTORY
   ========================================================================== */
.dashboard-layout { display: flex; gap: 30px; width: 100%; align-items: flex-start; }
.dashboard-sidebar { flex: 1; min-width: 260px; background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #eaeaea; overflow: hidden; }
.sidebar-profile { text-align: center; padding: 30px 20px; border-bottom: 1px solid #eaeaea; background: #fcfcfc; }
.sidebar-profile img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid #6607af; margin-bottom: 15px; background: #fff; }
.sidebar-profile h4 { margin: 0; color: #111; font-weight: 700; font-size: 16px; }

.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-nav a { padding: 15px 20px; color: #555; text-decoration: none; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; border-bottom: 1px solid #f9f9f9; transition: all 0.2s ease; display: flex; align-items: center; gap: 12px; }
.sidebar-nav a i { width: 20px; text-align: center; color: #888; font-size: 16px; transition: color 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #f9f4fd; color: #6607af; border-left-color: #6607af; }
.sidebar-nav a:hover i, .sidebar-nav a.active i { color: #6607af; }

.dashboard-content { flex: 3; background: #fff; padding: 35px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #eaeaea; }
.dashboard-title { margin-top: 0; font-size: 24px; font-weight: 800; color: #111; border-bottom: 2px solid #eaeaea; padding-bottom: 15px; margin-bottom: 30px; }
.form-section { margin-bottom: 35px; }
.form-section h3 { font-size: 16px; color: #6607af; margin-top: 0; margin-bottom: 15px; font-weight: 700; }
.image-upload-container { display: flex; align-items: center; gap: 25px; background: #f9f9f9; padding: 20px; border-radius: 8px; border: 1px solid #eaeaea; }
.image-preview-box { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; border: 2px dashed #ccc; background: #fff; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.image-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.readonly-input { background-color: #f5f5f5 !important; color: #777 !important; cursor: not-allowed; border-color: #eee !important; }

/* Order History Specific */
.order-card { border: 1px solid #eaeaea; border-radius: 12px; background: #fff; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); overflow: hidden; }
.order-header { padding: 20px 25px; background: #fcfcfc; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; user-select: none; }
.order-header:hover { background: #f5f5f5; }
.order-header.active { border-bottom: 1px solid #eaeaea; background: #fff; }
.order-header-info { display: flex; flex-direction: column; gap: 6px; }
.order-title { font-size: 16px; font-weight: 800; color: #111; }
.order-meta { display: flex; align-items: center; gap: 15px; font-size: 13px; color: #666; flex-wrap: wrap; }
.order-meta-total { font-weight: 700; color: #6607af; }
.order-header-right { display: flex; align-items: center; gap: 20px; }
.toggle-icon { transition: transform 0.3s ease; color: #888; font-size: 14px; }
.order-header.active .toggle-icon { transform: rotate(180deg); color: #6607af; }
.order-body { display: none; padding: 25px; background: #fff; }
.order-body.show { display: block; animation: fadeIn 0.3s ease-in-out; }
.order-shipping-box { background: #f9f9f9; padding: 15px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #eaeaea; font-size: 13.5px; color: #555; line-height: 1.6; }
.order-item-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px dashed #eaeaea; gap: 15px; }
.order-item-image { width: 60px; height: 60px; object-fit: contain; border: 1px solid #eee; border-radius: 8px; padding: 4px; background: #fff; flex-shrink: 0; }
.order-item-details { flex: 1; }
.order-item-price { font-weight: 700; color: #111; text-align: right; }
.order-summary-box { border-top: 2px solid #eaeaea; padding-top: 15px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   VOUCHERS & ADDRESS BOOK
   ========================================================================== */
.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; }
.voucher-card { display: flex; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #eaeaea; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.2s, box-shadow 0.2s; }
.voucher-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(102, 7, 175, 0.1); border-color: #d1b3ff; }
.voucher-left { background: linear-gradient(135deg, #6607af, #9b2df0); color: #fff; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100px; text-align: center; border-right: 2px dashed rgba(255,255,255,0.5); position: relative; }
.voucher-left::before, .voucher-left::after { content: ''; position: absolute; width: 20px; height: 20px; background: #f4f7f6; border-radius: 50%; right: -11px; }
.voucher-left::before { top: -10px; }
.voucher-left::after { bottom: -10px; }
.voucher-discount { font-size: 24px; font-weight: 900; line-height: 1.1; }
.voucher-type { font-size: 12px; font-weight: 600; text-transform: uppercase; margin-top: 5px; opacity: 0.9; }
.voucher-right { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.voucher-code-box { background: #f9f4fd; border: 1px dashed #6607af; color: #6607af; padding: 8px 15px; border-radius: 6px; font-family: monospace; font-size: 16px; font-weight: 800; text-align: center; letter-spacing: 1px; margin-bottom: 10px; cursor: pointer; transition: background 0.2s; }
.voucher-code-box:hover { background: #f0e6fa; }
.voucher-details { font-size: 13px; color: #666; line-height: 1.5; }
.voucher-details strong { color: #333; }
.voucher-expiry { font-size: 12px; color: #d93025; font-weight: 600; margin-top: 10px; display: flex; align-items: center; gap: 5px; }

.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 15px; }
.address-card { background: #fff; border: 1px solid #eaeaea; border-radius: 12px; padding: 20px; position: relative; transition: all 0.2s; }
.address-card:hover { border-color: #d1b3ff; box-shadow: 0 4px 15px rgba(102, 7, 175, 0.05); }
.address-card.is-default { border-color: #6607af; background: #fdfbfe; }
.address-badge { position: absolute; top: 15px; right: 15px; background: #e3f2fd; color: #1565c0; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.address-card.is-default .address-badge { background: #6607af; color: #fff; }
.address-details { font-size: 13.5px; color: #555; line-height: 1.6; margin-top: 10px; }
.address-actions { margin-top: 15px; display: flex; gap: 10px; border-top: 1px dashed #eaeaea; padding-top: 15px; align-items: center; justify-content: space-between; }
.btn-text { background: none; border: none; color: #6607af; font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; transition: color 0.2s; }
.btn-text:hover { color: #d93025; }
.btn-text.set-default { color: #888; }
.btn-text.set-default:hover { color: #2e7d32; }

/* ==========================================================================
   GACHA SYSTEM
   ========================================================================== */
.gacha-pool-container { max-width: 800px; margin: 40px auto; padding: 30px; background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.gacha-prize-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-top: 20px; }
.gacha-prize-item { background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px solid #eaeaea; text-align: center; }
.gacha-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 2000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.gacha-modal-content { background: #fff; padding: 30px; border-radius: 15px; width: 90%; max-width: 450px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.gacha-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 25px; }
.gacha-box { background: #6607af; border-radius: 12px; padding: 30px 10px; cursor: pointer; color: #fff; font-size: 40px; box-shadow: 0 8px 0 #4a0580, 0 10px 15px rgba(0,0,0,0.2); transition: transform 0.1s, box-shadow 0.1s; position: relative; display: flex; justify-content: center; align-items: center; }
.gacha-box:active { transform: translateY(8px); box-shadow: 0 0 0 #4a0580, 0 4px 6px rgba(0,0,0,0.2); }
.gacha-box.opened { background: #fdfdfd; color: #fbc02d; border: 2px solid #eaeaea; box-shadow: none; cursor: default; pointer-events: none; }
.shake { animation: shake-anim 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake-anim {
    10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-3deg); }
    20%, 80% { transform: translate3d(4px, 0, 0) rotate(3deg); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0) rotate(-5deg); }
    40%, 60% { transform: translate3d(6px, 0, 0) rotate(5deg); }
}
.prize-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.95); z-index: 3000; justify-content: center; align-items: center; flex-direction: column; color: #111; text-align: center; border-radius: 15px; }
.prize-overlay.show { display: flex; animation: zoomIn 0.4s ease-out; }
.prize-title { font-size: 24px; color: #fbc02d; font-weight: 800; margin-bottom: 5px; }
.prize-name { font-size: 20px; font-weight: 600; margin-bottom: 20px; color: #6607af; }
@keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ==========================================================================
   GLOBAL MOBILE RESPONSIVENESS (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Typographic & Layout Scaling */
    h2, h3, .section-title, .dashboard-title { font-size: 18px !important; line-height: 1.3 !important; word-wrap: break-word; }
    main { padding-top: 5px !important; }
    .store-container { padding-left: 10px !important; padding-right: 10px !important; }
    
    /* Header & Navigation */
    .auth-btn-header { padding: 6px 12px; font-size: 12px; gap: 5px; }
    .mobile-menu-toggle { display: block; margin-right: 15px; }
    .primary-menu { display: none; flex-direction: column; width: 100%; position: absolute; top: 100%; left: 0; background: #fff; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 999; gap: 15px; border-top: 1px solid #eaeaea; }
    .primary-menu.active { display: flex; }
    .header-actions { gap: 15px; }

    /* Product Grid */
    .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .card-title { font-size: 13px !important; min-height: 2.6em; }
    .card-price { font-size: 14px !important; }
    .btn-card { font-size: 11px !important; padding: 8px !important; }
    .po-split-btns { flex-direction: column; }

    /* Forms */
    .form-row { flex-direction: column; gap: 0; }
    .form-row .form-group { width: 100%; margin-bottom: 5px; }

    /* User Dashboard */
    .dashboard-layout { flex-direction: column; gap: 10px !important; }
    .dashboard-sidebar, .dashboard-content { width: 100%; box-sizing: border-box; }
    .dashboard-content { padding: 15px 10px !important; }
    .image-upload-container { flex-direction: column; align-items: flex-start; }
    
    /* Order History */
    .order-card { margin-bottom: 12px !important; }
    .order-header { flex-direction: column; align-items: flex-start; gap: 15px; padding: 15px 12px !important; }
    .order-header-right { width: 100%; justify-content: space-between; }
    .order-item-row { flex-direction: column; align-items: flex-start; }
    .order-item-price { text-align: left; margin-top: 5px; }
    .order-summary-box { align-items: flex-start; }

    /* Vouchers */
    .voucher-grid { grid-template-columns: 1fr; }

    /* Pagination */
    .pagination-container { flex-direction: column; align-items: center; gap: 15px; text-align: center; }
    .pagination-limit, .pagination-links { justify-content: center; width: 100%; }

    /* Product Detail Page Mobile Adjustments */
    .product-detail-main { padding: 15px 1% 100px !important; } 
    .detail-container { grid-template-columns: 1fr; gap: 10px; padding: 20px; margin-bottom: 30px; }
    .detail-title { font-size: 22px; }
    .detail-price-box { padding: 15px; }
    .price-main { font-size: 20px; }
    .detail-desc { font-size: 14px; padding-bottom: 15px; margin-bottom: 15px; }
    .desktop-only-action { display: none !important; }
    .mobile-only-action { display: flex !important; }
    .related-header { margin-top: 30px; }
    .carousel-item { flex: 0 0 calc(50% - 10px); min-width: 140px; }
    
/* STICKY BOTTOM BARS FOR MOBILE (Product Detail & Cart Page) */
    .mobile-sticky-action-bar, .cart-sticky-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 12px 20px;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
        z-index: 999;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center; /* Changed to center for perfect vertical alignment */
        gap: 15px;
        min-height: 75px;
        height: auto;
    }
    
    /* Cart Specific Sticky Elements */
    .cart-main-container { padding-bottom: 90px !important; }
    .desktop-checkout-btn { display: none !important; }
    
    .cart-sticky-total { 
        display: flex; 
        flex-direction: column; 
        line-height: 1.2; 
        justify-content: center; 
        white-space: nowrap; /* Stops 'Estimated Total' from breaking into two lines */
    }
    
    .cart-sticky-bottom .btn-card { 
        padding: 0 20px; 
        font-size: 15px; 
        margin: 0; 
        border-radius: 8px; 
        box-shadow: 0 4px 10px rgba(102, 7, 175, 0.2); 
        text-decoration: none !important; /* Removes the ugly link underline */
        flex: 1; /* Allows button to fill remaining space */
        max-width: 220px; /* Prevents the button from becoming too wide */
    }
    
    /* Detail Specific Sticky Elements */
    .sticky-qty { height: 100%; border-color: #ddd; margin: 0; }
    .sticky-qty .qty-btn { padding: 0 12px; font-size: 20px; background: #f0f0f0; }
    .sticky-qty .qty-input { width: 45px; font-size: 15px; border-color: #ddd !important; }
    .sticky-action-btns { flex: 1; display: flex; gap: 10px; }
    .sticky-action-btns .btn-card { height: 100%; padding: 0 10px; font-size: 14px; margin: 0; border-radius: 8px; box-shadow: 0 4px 10px rgba(102, 7, 175, 0.2); }

    /* Cart Table Mobile View (Redesigned Layout) */
    .responsive-cart-table thead { display: none; }
    .responsive-cart-table, .responsive-cart-table tbody { display: block; width: 100%; box-sizing: border-box; }
    .responsive-cart-table tr { 
        display: flex; 
        flex-wrap: wrap; 
        position: relative; 
        margin-bottom: 15px; 
        background: #fff; 
        border: 1px solid #eaeaea; 
        border-radius: 12px; 
        padding: 15px; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.02); 
        box-sizing: border-box; 
        align-items: center;
    }
    .responsive-cart-table td { padding: 0; border: none; display: flex; box-sizing: border-box; background: transparent; }
    
    /* 1. Product Image & Title Row */
    .responsive-cart-table td:nth-child(1) { 
        width: 100%; 
        padding: 0 45px 15px 0 !important; 
        border-bottom: 1px dashed #eaeaea !important; 
        margin-bottom: 15px; 
        align-items: center !important; /* Center aligns title with image */
    }
    .responsive-cart-table td:nth-child(1) .cart-product-flex { width: 100%; gap: 15px; align-items: center; }
    
    /* Add Labels (Price, Qty, Subtotal) */
    .responsive-cart-table td:nth-child(2)::before { content: "PRICE"; font-weight: 700; color: #aaa; font-size: 10px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; display: block; line-height: 1; }
    .responsive-cart-table td:nth-child(3)::before { content: "QTY"; font-weight: 700; color: #aaa; font-size: 10px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; display: block; line-height: 1; }
    .responsive-cart-table td:nth-child(4)::before { content: "SUBTOTAL"; font-weight: 700; color: #aaa; font-size: 10px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; display: block; line-height: 1; }
    
    /* 2. Unit Price (Left Aligned, Top Aligned) */
    .responsive-cart-table td:nth-child(2) { 
        width: 33.33%; 
        flex-direction: column; 
        align-items: flex-start !important; 
        justify-content: flex-start !important; /* Pins label to the top */
    }
    
    /* 3. Quantity (Center Aligned, Top Aligned) */
    .responsive-cart-table td:nth-child(3) { 
        width: 33.33%; 
        flex-direction: column; 
        align-items: center !important; 
        justify-content: flex-start !important; /* Pins label to the top */
    }
    
    /* 4. Subtotal (Right Aligned, Top Aligned) */
    .responsive-cart-table td:nth-child(4) { 
        width: 33.33%; 
        flex-direction: column; 
        align-items: flex-end !important; 
        justify-content: flex-start !important; /* Pins label to the top */
    }
    
    /* 5. Trash Icon (Centered with Top Row) */
    .responsive-cart-table td:nth-child(5) { 
        position: absolute; 
        top: 55px; /* 15px card padding + 40px (half of 80px image) */
        transform: translateY(-50%); /* Perfect vertical centering */
        right: 15px; 
        width: auto; 
        padding: 0 !important; 
        margin: 0 !important;
        border: none !important;
    }
    .cart-bottom-wrapper { flex-direction: column; gap: 20px; }
    .promo-section, .summary-section { width: 100%; box-sizing: border-box; }
    
    .side-cart { width: 100%; max-width: 100%; right: -100%; }
}

/* ==========================================================================
   MEDIUM SCREENS (Tablet / Small Desktop)
   ========================================================================== */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .catalog-toolbar { flex-direction: column; align-items: stretch; }
    .catalog-sort { justify-content: space-between; }
    .catalog-sort select { flex: 1; margin-left: 10px; }
    .admin-header-actions { flex-direction: column; width: 100%; align-items: stretch !important; }
}

/* ==========================================================================
   ADMIN DASHBOARD UI
   ========================================================================== */
.admin-wrapper { display: flex; background: #f4f7f6; }
.admin-sidebar { width: 250px; background: #fff; border-right: 1px solid #eaeaea; position: sticky; top: 70px; height: calc(100vh - 70px); overflow-y: auto; }
.sidebar-brand { padding: 20px; font-size: 16px; font-weight: 700; color: #111; border-bottom: 1px solid #eaeaea; display: flex; align-items: center; gap: 10px; }
.sidebar-nav a { display: block; padding: 15px 25px; color: #555; text-decoration: none; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; transition: all 0.2s; }
.sidebar-nav a i { width: 22px; color: #888; margin-right: 10px; text-align: center; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #f9f4fd; color: #6607af; border-left-color: #6607af; }
.sidebar-nav a:hover i, .sidebar-nav a.active i { color: #6607af; }
.admin-content { flex: 1; padding: 40px; overflow-x: auto; }
.admin-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px;}
.admin-title { margin: 0; font-size: 26px; font-weight: 700; color: #111; }
.mobile-admin-toggle { display: none; background: none; border: none; font-size: 24px; color: #111; cursor: pointer; padding: 0; margin-right: 5px; }

.dashboard-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.metric-card { background: #fff; padding: 20px; border-radius: 12px; border: 1px solid #eaeaea; box-shadow: 0 4px 12px rgba(0,0,0,0.02); display: flex; align-items: center; gap: 15px; }
.metric-icon { width: 50px; height: 50px; border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 22px; }
.metric-info h4 { margin: 0 0 5px 0; font-size: 13px; color: #888; text-transform: uppercase; font-weight: 600; }
.metric-value { font-size: 24px; font-weight: 800; color: #111; }

.admin-table-container { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); overflow-x: auto; border: 1px solid #eaeaea; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #f9f4fd; padding: 15px 20px; text-align: left; font-size: 13px; text-transform: uppercase; color: #6607af; border-bottom: 2px solid #e9e0f2; font-weight: 700; }
.admin-table td { padding: 15px 20px; border-bottom: 1px solid #eaeaea; font-size: 14px; color: #333; vertical-align: middle; }
.admin-table tr:hover td { background: #fafafa; }
.admin-table tr:last-child td { border-bottom: none; }

.status-badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status-badge.active { background-color: #e6f4ea; color: #2e7d32; }
.status-badge.inactive, .status-badge.disabled { background-color: #fce8e6; color: #d93025; }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-badge.active .dot { background-color: #2e7d32; }
.status-badge.inactive .dot, .status-badge.disabled .dot { background-color: #d93025; }

/* Admin Split Layout */
.admin-split-layout { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.admin-split-col { flex: 1; min-width: 45%; }

@media (max-width: 768px) {
    .mobile-admin-toggle { display: block; }
    .admin-wrapper { flex-direction: column; position: relative; }
    
    .admin-sidebar { 
        display: none; position: absolute; top: 80px; left: 20px; right: 20px; width: auto; height: auto; 
        background: #fff; border-right: none; border: 1px solid #eaeaea; border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15); z-index: 1050; padding: 10px 0;
    }
    .admin-sidebar.show { display: block; }
    .sidebar-brand { display: none; }
    .sidebar-nav { display: flex; width: 100%; flex-direction: column; }
    .sidebar-nav a { padding: 12px 20px; border-left: none; border-bottom: 1px solid #f9f9f9; white-space: normal; }
    .sidebar-nav a.active { border-left-color: transparent; border-bottom-color: #f9f9f9; background: #f9f4fd; color: #6607af; }

    .admin-content { padding: 20px; }
    .admin-split-col { min-width: 100%; margin-bottom: 10px; }
    .admin-split-layout { gap: 10px; }

    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; box-sizing: border-box; }
    .admin-table tr { margin-bottom: 15px; border: 1px solid #eaeaea; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
    .admin-table td { display: flex; justify-content: space-between; align-items: center; text-align: right; border-bottom: 1px solid #f9f9f9; padding: 12px 15px; }
    .admin-table td::before { content: attr(data-label); font-weight: 700; color: #555; text-transform: uppercase; font-size: 11px; margin-right: 15px; text-align: left; }
    .admin-table tr:hover td { background: transparent; }
    .admin-table td:last-child { border-bottom: none; justify-content: center; background: #fafafa; border-radius: 0 0 8px 8px; }
    .admin-table td:last-child::before { display: none; }
}

/* ==========================================================================
   CHECKOUT SPECIFIC STYLES
   ========================================================================== */
.checkout-wrapper { display: flex; gap: 20px; align-items: flex-start; }
.checkout-form-col { flex: 3; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.checkout-summary-col { flex: 2; background: #f9f9f9; padding: 30px; border-radius: 12px; border: 1px solid #eaeaea; position: sticky; top: 100px; }
.payment-methods-container { margin-top: 20px; }
.payment-radio-label { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid #eaeaea; border-radius: 8px; margin-bottom: 12px; cursor: pointer; background: #fafafa; transition: all 0.2s ease; }
.payment-radio-label:hover { border-color: #6607af; background: #f9f4fd; }
.payment-radio-label input[type="radio"] { margin: 0; margin-top: 3px; cursor: pointer; }
.payment-radio-label div { display: flex; flex-direction: column; }
.address-card-ui { border: 1px solid #eaeaea; border-radius: 8px; padding: 15px; cursor: pointer; transition: all 0.2s ease; background: #fff; }
.address-card-ui:hover { border-color: #6607af; box-shadow: 0 4px 10px rgba(102, 7, 175, 0.08); }

/* ==========================================================================
   MOBILE RESPONSIVENESS FIXES (Including Checkout & Cart Sticky Bars)
   ========================================================================== */
@media (max-width: 768px) {
    /* Checkout Layout Adjustments */
    .checkout-wrapper { flex-direction: column-reverse; gap: 10px; }
    .checkout-summary-col { position: relative; top: 0; width: 100%; box-sizing: border-box; padding-bottom: 5px; }
    .cart-main-container { padding-bottom: 90px !important; }
    
    /* Hide Desktop Action Buttons */
    .desktop-checkout-btn, .desktop-only-action { display: none !important; }
    .mobile-only-action { display: flex !important; }
    
    /* SHARED: STICKY BOTTOM BARS (Product Detail, Cart & Checkout) */
    .mobile-sticky-action-bar, .cart-sticky-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 12px 20px;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
        z-index: 999;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center; 
        gap: 15px;
        min-height: 75px;
        height: auto;
    }
    
    .cart-sticky-total { 
        display: flex; 
        flex-direction: column; 
        line-height: 1.2; 
        justify-content: center; 
        white-space: nowrap; 
    }
    
    /* Shared Button Style for the Sticky Bar */
    .cart-sticky-bottom .btn-card, .mobile-sticky-action-bar .btn-card { 
        height: 40px !important; /* Force strict 30px height */
        padding: 0 15px !important; 
        font-size: 13px !important; /* Slightly smaller text to fit 30px cleanly */
        margin: 0 !important; 
        border-radius: 6px !important; 
        box-shadow: 0 4px 10px rgba(102, 7, 175, 0.2); 
        text-decoration: none !important;
        flex: 1; 
        max-width: 220px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        box-sizing: border-box !important; /* THIS line forces <a> and <button> to be identical */
        line-height: 1 !important; /* Prevents text from stretching the box */
    }
    
    /* Detail Page Specific Overrides */
    .sticky-qty { height: 30px !important; border-color: #ddd; margin: 0; }
    .sticky-qty .qty-btn { 
        padding: 0 12px; 
        font-size: 18px; /* Adjusted to fit nicely in 30px */
        background: #f0f0f0; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
    }
    .sticky-qty .qty-input { 
        width: 45px; 
        font-size: 14px; 
        border-color: #ddd !important; 
    }
    .sticky-action-btns { flex: 1; display: flex; gap: 10px; }
}

/* =======================================================
   PRODUCT DETAIL PAGE OVERRIDES 
   (Matches Catalog Width & Aligns Content Top)
======================================================= */
.product-detail-main .detail-page-wrapper {
    max-width: 1400px !important; /* Force width to match catalog.php */
}

.product-detail-main .detail-container {
    align-items: flex-start !important; /* Align image and details to the TOP */
    gap: 50px; /* Provide generous spacing between image and info */
    margin-bottom: 60px;
}

/* Ensure the info panel takes up the right amount of space */
.product-detail-main .detail-info {
    flex: 1.2; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Push content to top inside the info box */
}

/* Ensure the gallery doesn't stretch weirdly */
.product-detail-main .detail-gallery {
    flex: 1;
    position: sticky; /* Optional: Makes the image stick when scrolling on desktop */
    top: 100px;
}

/* Make sure related products section matches width */
.product-detail-main .related-header,
.product-detail-main .related-carousel {
    max-width: 1400px !important;
    margin-left: auto;
    margin-right: auto;
}


/* ==========================================================================
   >>> UI REFRESH 2026 (START) <<<
   "PXP Store logo" style: white + black outlines, deep plum 3D shadows,
   golden-yellow accents, comic-style headings (Luckiest Guy).
   Only overrides styles above; no page markup changed; the index.php
   campaign banner is untouched.
   TO REVERT: delete everything from this START line to the END line below
   (the font line at the very top of the file can stay, it is harmless).
   ========================================================================== */
:root {
    --pxp-purple: #6607af;          /* main button purple (existing brand colour) */
    --pxp-purple-dark: #52058f;
    --pxp-plum: #5e2d6c;            /* logo 3D shadow colour */
    --pxp-yellow: #fac800;          /* logo "store" yellow */
    --pxp-yellow-soft: #fff6cc;
    --pxp-ink: #141014;             /* logo outline black */
    --pxp-text: #2f2a33;
    --pxp-muted: #6f6876;
    --pxp-line: #e6e1ea;
    --pxp-bg: #faf8fb;
    --pxp-red: #e0362c;
    --pxp-orange: #ec6a00;
    --pxp-outline: 2px solid var(--pxp-ink);
    --pxp-pop: 4px 4px 0 var(--pxp-plum);           /* logo-style hard 3D shadow */
    --pxp-pop-hover: 7px 7px 0 var(--pxp-plum);
    --pxp-pop-ink: 3px 3px 0 var(--pxp-ink);
    --pxp-radius: 14px;
    --pxp-radius-sm: 10px;
    --pxp-comic: 'Luckiest Guy', 'Poppins', cursive;
    --pxp-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
    background-color: var(--pxp-bg);
    /* faint comic halftone dots */
    background-image: radial-gradient(rgba(94, 45, 108, 0.07) 1px, transparent 1.2px);
    background-size: 18px 18px;
    color: var(--pxp-text);
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--pxp-yellow); color: var(--pxp-ink); }
a:focus-visible, button:focus-visible, .btn-card:focus-visible { outline: 3px solid var(--pxp-yellow); outline-offset: 2px; }

/* ---------- Header ---------- */
header {
    background: #fff;
    border-bottom: 3px solid var(--pxp-ink);
    box-shadow: 0 4px 0 var(--pxp-yellow);
    min-height: 68px;
}
.header-logo { transition: transform 0.25s var(--pxp-ease); }
.header-logo:hover { transform: rotate(-4deg) scale(1.06); }
.primary-menu a { position: relative; color: var(--pxp-ink); font-weight: 700; padding: 6px 4px; }
.primary-menu a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: -1;
    background: var(--pxp-yellow); border-radius: 3px; transform: scaleX(0); transform-origin: left;
    transition: transform 0.25s var(--pxp-ease);
}
.primary-menu a:hover { color: var(--pxp-plum); }
.primary-menu a:hover::after { transform: scaleX(1); }
.cart-icon-wrapper { color: var(--pxp-ink); }
.cart-badge { background: var(--pxp-yellow); color: var(--pxp-ink); border: 2px solid var(--pxp-ink); width: 20px; height: 20px; font-weight: 800; box-shadow: none; }
.user-avatar { border: var(--pxp-outline); box-shadow: 2px 2px 0 var(--pxp-plum); }
.user-avatar:hover { box-shadow: 3px 3px 0 var(--pxp-plum); }
.dropdown-content { border: var(--pxp-outline); border-radius: var(--pxp-radius); box-shadow: var(--pxp-pop); }
.dropdown-content a:hover { background-color: var(--pxp-yellow-soft); color: var(--pxp-plum); }

/* ---------- Buttons (comic "press" buttons) ---------- */
.btn, .submit-btn, .btn-card { border-radius: var(--pxp-radius-sm); }
.btn-card, .submit-btn {
    border: var(--pxp-outline) !important;
    box-shadow: var(--pxp-pop-ink);
    font-weight: 700;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s;
}
.btn-card:hover:not(:disabled), .submit-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--pxp-ink); }
.btn-card:active:not(:disabled), .submit-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--pxp-ink); }
.btn-add-cart, .submit-btn { background-color: var(--pxp-purple); color: #fff; }
.btn-add-cart:hover:not(:disabled), .submit-btn:hover { background-color: var(--pxp-purple-dark); }
.btn-full-pay { background-color: var(--pxp-ink); }
.btn-deposit { background-color: var(--pxp-yellow); color: var(--pxp-ink); }
.btn-deposit:hover:not(:disabled) { background-color: #ffd633; }
.btn-card:disabled, .btn-card[disabled] { box-shadow: none; border-color: #9b9b9b !important; cursor: not-allowed; }
.btn-secondary { border: 2px solid var(--pxp-ink); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
    border: 2px solid #d9d2df; border-radius: var(--pxp-radius-sm); background-color: #fff;
}
input:hover, select:hover, textarea:hover { border-color: #bdb2c6; }
input:focus, select:focus, textarea:focus { border-color: var(--pxp-ink); box-shadow: 3px 3px 0 var(--pxp-yellow); }

/* ---------- Login / register modal ---------- */
.modal { background-color: rgba(20, 16, 20, 0.6); }
.modal-content { border: 3px solid var(--pxp-ink); border-radius: 18px; padding: 32px; box-shadow: 8px 8px 0 var(--pxp-plum); }
.auth-toggle { border-bottom: 2px solid var(--pxp-line); }
.auth-toggle button { font-weight: 700; }
.auth-toggle button.active { color: var(--pxp-plum); border-bottom: 4px solid var(--pxp-yellow); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--pxp-radius-sm); border: 2px solid currentColor; }

/* ---------- Section headers (logo lettering) ---------- */
.store-container { padding-top: 32px; }
.section-header { border-bottom: none; padding-bottom: 0; margin-bottom: 20px; align-items: center; }
.section-header h2 {
    font-family: var(--pxp-comic); font-weight: 400; font-size: 30px; letter-spacing: 1px; line-height: 1.15;
    color: #fff; -webkit-text-stroke: 1.5px var(--pxp-ink); paint-order: stroke fill;
    text-shadow: 3px 3px 0 var(--pxp-plum);
}
.view-more-link {
    white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
    background: var(--pxp-yellow); color: var(--pxp-ink); font-size: 13px; font-weight: 700;
    border: var(--pxp-outline); box-shadow: 2px 2px 0 var(--pxp-ink);
    transition: transform 0.12s, box-shadow 0.12s, gap 0.2s;
}
.view-more-link:hover { opacity: 1; gap: 10px; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pxp-ink); }

/* ---------- Product grid & cards (sticker cards) ---------- */
.product-grid { gap: 24px; padding: 0 6px 8px 0; }
.product-card {
    background: #fff; border: var(--pxp-outline); border-radius: var(--pxp-radius);
    box-shadow: var(--pxp-pop);
    transition: transform 0.2s var(--pxp-ease), box-shadow 0.2s var(--pxp-ease);
}
.product-card:hover { transform: translate(-3px, -3px); box-shadow: var(--pxp-pop-hover); }
.card-img { background: #fff; border-bottom: 2px solid var(--pxp-ink); }
.card-img img { width: 82%; height: 82%; transition: transform 0.3s var(--pxp-ease); }
.product-card:hover .card-img img { transform: scale(1.06) rotate(-2deg); }
/* Badges look like stickers */
.card-badge {
    top: 10px; padding: 3px 10px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
    background: var(--pxp-yellow); color: var(--pxp-ink); border: 2px solid var(--pxp-ink);
    box-shadow: 2px 2px 0 var(--pxp-ink); transform: rotate(-4deg);
}
.badge-po { background: var(--pxp-purple); color: #fff; }
.badge-soldout { background: var(--pxp-ink) !important; color: #fff; }
/* Sold Out / Closed stickers set a grey background inline: use white text so it stays readable */
.card-badge[style*="#555"] { color: #fff; }
.card-body { padding: 14px 14px 16px; }
.card-title { font-size: 14px; font-weight: 700 !important; color: var(--pxp-ink); line-height: 1.45; }
.card-price-wrapper { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-bottom: 14px; }
.card-price { font-size: 19px; font-weight: 800 !important; color: var(--pxp-purple) !important; letter-spacing: -0.2px; }
.card-price-old { margin-left: 0; color: #9c94a3; }
.btn-action-container .btn-card { padding: 10px; }

/* ---------- Catalog toolbar & pagination ---------- */
.catalog-toolbar { border: var(--pxp-outline); border-radius: var(--pxp-radius); box-shadow: var(--pxp-pop); }
.page-link { border: 2px solid var(--pxp-ink); border-radius: var(--pxp-radius-sm); color: var(--pxp-ink); min-width: 40px; text-align: center; box-shadow: 2px 2px 0 var(--pxp-ink); }
.page-link:hover { background: var(--pxp-yellow); }

/* ---------- Product detail ---------- */
.product-detail-main { background-color: transparent; }
.detail-container { border: 3px solid var(--pxp-ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--pxp-plum); }
.main-image-box { border: var(--pxp-outline); border-radius: 16px; background: #fff; }
.thumbnail { border: 2px solid var(--pxp-line); border-radius: var(--pxp-radius-sm); }
.thumbnail:hover { border-color: var(--pxp-ink); box-shadow: 2px 2px 0 var(--pxp-yellow); }
.detail-status-badge { border: 2px solid var(--pxp-ink); border-radius: 8px; padding: 5px 12px; font-size: 12px; box-shadow: 2px 2px 0 var(--pxp-ink); }
.detail-status-badge.po { background-color: var(--pxp-purple); }
.detail-brand-category { color: var(--pxp-plum); font-size: 13px; letter-spacing: 0.8px; }
.detail-title { font-size: 30px; font-weight: 800; color: var(--pxp-ink); letter-spacing: -0.4px; }
.detail-price-box { background: var(--pxp-yellow-soft); border: var(--pxp-outline); border-radius: 16px; box-shadow: var(--pxp-pop-ink); }
.price-main { font-size: 30px; font-weight: 800; color: var(--pxp-purple); }
.po-deposit-box { border-radius: var(--pxp-radius-sm); border: 2px dashed var(--pxp-ink); background: #fff; }
.detail-action-box { border: var(--pxp-outline); border-radius: 16px; }
.qty-control { border: var(--pxp-outline); border-radius: var(--pxp-radius-sm); }
.qty-input { border-left: 2px solid var(--pxp-ink) !important; border-right: 2px solid var(--pxp-ink) !important; }
.qty-btn:hover:not(:disabled) { background: var(--pxp-yellow); color: var(--pxp-ink); }
.action-btn-wrapper .btn-card { border-radius: 12px; }
.po-tnc-container { border: 2px solid var(--pxp-ink); border-radius: var(--pxp-radius-sm); }

/* ---------- Cart, side cart & checkout ---------- */
.responsive-cart-table th { background: var(--pxp-yellow); color: var(--pxp-ink); border-bottom: 2px solid var(--pxp-ink); font-size: 12px; letter-spacing: 0.5px; }
.promo-section, .summary-section { border: var(--pxp-outline); border-radius: 16px; box-shadow: var(--pxp-pop); }
.promo-section h3, .summary-section h3 { border-bottom: 2px dashed var(--pxp-line); }
.side-cart { border-left: 3px solid var(--pxp-ink); }
.side-cart-header { border-bottom: 2px solid var(--pxp-ink); background: var(--pxp-yellow); }
.side-cart-item img { border: 2px solid var(--pxp-line); border-radius: var(--pxp-radius-sm); }
.checkout-form-col { border: var(--pxp-outline); border-radius: 16px; box-shadow: var(--pxp-pop); }
.checkout-summary-col { border: var(--pxp-outline); border-radius: 16px; background: var(--pxp-yellow-soft); box-shadow: var(--pxp-pop-ink); }
.payment-radio-label { border: 2px solid var(--pxp-line); border-radius: 12px; background: #fff; }
.payment-radio-label:hover, .payment-radio-label:has(input:checked) { border-color: var(--pxp-ink); background: #fff; box-shadow: 3px 3px 0 var(--pxp-yellow); }
.payment-radio-label input[type="radio"] { accent-color: var(--pxp-purple); }
.address-card-ui { border: 2px solid var(--pxp-line); border-radius: 12px; }
.address-card-ui:hover { border-color: var(--pxp-ink); box-shadow: 3px 3px 0 var(--pxp-yellow); }

/* ---------- My account (profile, orders, vouchers, addresses) ---------- */
.dashboard-sidebar, .dashboard-content { border: var(--pxp-outline); border-radius: 18px; box-shadow: var(--pxp-pop); }
.sidebar-profile { background: var(--pxp-yellow-soft); border-bottom: 2px solid var(--pxp-ink); }
.sidebar-profile img { border: 3px solid var(--pxp-ink); box-shadow: 3px 3px 0 var(--pxp-plum); }
.sidebar-nav a { margin: 3px 10px; border-left: none; border-bottom: none; border-radius: var(--pxp-radius-sm); font-weight: 600; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--pxp-yellow-soft); color: var(--pxp-plum); }
.sidebar-nav a.active { box-shadow: inset 4px 0 0 var(--pxp-yellow); }
.dashboard-title {
    font-family: var(--pxp-comic); font-weight: 400 !important; letter-spacing: 1px;
    color: #fff; -webkit-text-stroke: 1.2px var(--pxp-ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--pxp-plum);
    border-bottom: 2px dashed var(--pxp-line);
}
.order-card { border: var(--pxp-outline); border-radius: var(--pxp-radius); box-shadow: var(--pxp-pop-ink); }
.order-header { background: #fff; }
.order-header:hover { background: var(--pxp-yellow-soft); }
.order-meta-total { color: var(--pxp-purple); }
.order-shipping-box { border: 2px dashed var(--pxp-line); border-radius: 12px; background: #fff; }
.order-item-image { border-radius: var(--pxp-radius-sm); }
.voucher-card, .address-card { border: var(--pxp-outline); border-radius: var(--pxp-radius); box-shadow: var(--pxp-pop-ink); }
.voucher-left { background: linear-gradient(135deg, var(--pxp-purple), var(--pxp-plum)); }
.voucher-left::before, .voucher-left::after { background: var(--pxp-bg); }
.voucher-code-box { border-color: var(--pxp-ink); background: var(--pxp-yellow-soft); color: var(--pxp-ink); }
.address-card.is-default { border-color: var(--pxp-ink); background: var(--pxp-yellow-soft); }
.gacha-pool-container { border: 3px solid var(--pxp-ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--pxp-plum); }
.gacha-box { border: 3px solid var(--pxp-ink); }

/* ---------- Header Login / Register button (compact pill instead of full width) ---------- */
.header-actions .auth-btn-header {
    width: auto !important; flex: 0 0 auto;
    padding: 8px 18px; font-size: 13px; gap: 7px;
    border-radius: 999px;
}
@media (max-width: 768px) {
    .header-actions .auth-btn-header { padding: 6px 12px !important; font-size: 12px !important; gap: 5px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    header { min-height: 60px; }
    .primary-menu { border-bottom: 3px solid var(--pxp-ink); }
    .section-header { gap: 10px; }
    .section-header h2 { font-size: 20px !important; -webkit-text-stroke-width: 1.2px; text-shadow: 2px 2px 0 var(--pxp-plum); }
    .dashboard-title { font-size: 22px !important; }
    .view-more-link { padding: 6px 11px; font-size: 12px; }
    .product-grid { gap: 14px; }
    .product-card { box-shadow: 3px 3px 0 var(--pxp-plum); }
    .card-body { padding: 10px 10px 12px; }
    .card-price { font-size: 16px !important; }
    .btn-card, .submit-btn { box-shadow: 2px 2px 0 var(--pxp-ink); }
    .detail-container { border-width: 2px; border-radius: 16px; box-shadow: 4px 4px 0 var(--pxp-plum); }
    .detail-title { font-size: 22px; }
    .price-main { font-size: 24px; }
    .mobile-sticky-action-bar, .cart-sticky-bottom { border-top: 3px solid var(--pxp-ink); box-shadow: 0 -4px 0 var(--pxp-yellow); }
    .responsive-cart-table tr { border: var(--pxp-outline); border-radius: var(--pxp-radius); box-shadow: 3px 3px 0 var(--pxp-plum); }
    .dashboard-sidebar, .dashboard-content, .order-card { box-shadow: 3px 3px 0 var(--pxp-plum); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* ==========================================================================
   >>> UI REFRESH 2026 (END) <<<
   ========================================================================== */
