/* =========================================
   1. VARIABLES & BASE SETUP
   ========================================= */
:root {
    --primary: #ed2b34; 
    --primary-hover: #c81e25;
    --primary-btn: #dc2626;
    --primary-btn-hover: #b91c1c;
    --surface: rgba(35, 39, 50, 0.75);
    --surface-alt: rgba(25, 28, 37, 0.85);
    --text: #F8FAFC;
    --text-muted: #9BA3AF;
    --border: rgba(255, 255, 255, 0.1);
}

html {
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; padding: 0; background-color: #161922;
    background-image: radial-gradient(ellipse at top, #363C4F 0%, #161922 80%);
    background-attachment: fixed; color: var(--text); min-height: 100vh;
}

/* =========================================
   2. LAYOUT CONTAINERS
   ========================================= */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 2rem; }

.checkout-container { margin: 3rem auto; display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }

.terms-container { max-width: 900px; margin: 3rem auto; flex: 1; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; }

/* =========================================
   3. TYPOGRAPHY, BUTTONS & FORMS
   ========================================= */
.btn {
    background: var(--primary-btn); color: white; border: 1px solid transparent; padding: 0.65rem 1rem;
    border-radius: 6px; cursor: pointer; font-size: 0.95rem; width: 100%; box-sizing: border-box;
    transition: all 0.2s; font-weight: 600; text-align: center; text-decoration: none; display: inline-block;
}
.btn:hover:not(:disabled) { background: var(--primary-btn-hover); }
.btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; border-color: transparent; }

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); font-size: 0.95rem; font-weight: 600; }
.btn-outline:hover:not(:disabled) { background: rgba(237, 43, 52, 0.1); }
.btn-outline:disabled { border-color: var(--border); color: var(--text-muted); }

/* Accessibility & Keyboard Navigation Focus Indicator */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.75rem; border-radius: 4px; border: 1px solid var(--border);
    background: rgba(0,0,0,0.2); color: var(--text); font-family: inherit; box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group select option { background: #1E212B; color: var(--text); }
select { color-scheme: dark; cursor: pointer; outline: none; }
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--primary); width: 1.25rem; height: 1.25rem; cursor: pointer; margin: 0; }

.form-row { display: flex; gap: 1rem; }
.form-row > .form-group { flex: 1; }

.nobr { white-space: nowrap; }

/* Fix for browser autofill on dark background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text); /* Enforce white font color */
    -webkit-box-shadow: 0 0 0px 1000px rgba(0,0,0,0.2) inset; /* Maintain dark background appearance */
    transition: background-color 5000s ease-in-out 0s; /* Prevent browser from reverting background color */
    caret-color: var(--text); /* Ensure cursor remains visible */
    color-scheme: dark;
}

/* =========================================
   4. HEADER, FOOTER & MODALS
   ========================================= */
header {
    background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.header-content {
    max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem;
    min-height: 92px;
    display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box;
}
.logo-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-container img {
    height: 40px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.logo-container span {
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--text-muted);
    border-left: 1px solid var(--border);
    padding-left: 12px;
    line-height: 1;
}
header h1 { margin: 0; font-size: 1.5rem; color: var(--text); }
header h1 span { color: var(--primary); }

.site-footer {
    margin-top: 4rem; padding: 2rem 2rem 1.5rem 2rem; border-top: 1px solid var(--border);
    background: var(--surface-alt); color: var(--text-muted); font-size: 0.9rem; width: 100%; box-sizing: border-box;
}
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; align-items: center; }
.footer-col p { margin: 0 0 0.5rem 0; line-height: 1.6; }
.footer-col h4 { margin: 0 0 1rem 0; color: var(--text); font-size: 1rem; }
.footer-col a { color: inherit; text-decoration: none; transition: color 0.2s; display: inline-block; padding: 0.25rem 0; min-height: 24px; box-sizing: border-box; }
.footer-col a:hover { color: var(--primary); }
.footer-middle { display: flex; justify-content: center; opacity: 0.6; transition: opacity 0.2s; }
.footer-middle:hover { opacity: 1; }
.footer-container > .footer-col:last-of-type { text-align: justify; }
.footer-bottom {
    max-width: 1200px; margin: 2rem auto 0 auto; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: inherit; text-decoration: none; transition: color 0.2s; display: inline-block; padding: 0.25rem 0; min-height: 24px; box-sizing: border-box; }
.footer-links a:hover { color: var(--primary); }

.cookie-banner {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(20, 22, 28, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); padding: 1.5rem 2rem; box-sizing: border-box;
    display: flex; justify-content: space-between; align-items: center; gap: 2rem;
    z-index: 9999; transform: translateY(100%); transition: transform 0.4s ease-in-out; box-shadow: 0 -4px 25px rgba(0,0,0,0.5);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.cookie-banner a { color: var(--text); text-decoration: underline; }
.cookie-banner a:hover { color: var(--primary); }
.cookie-banner .btn { width: auto; padding: 0.6rem 2rem; margin: 0; white-space: nowrap; font-size: 1rem; }

.modal { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); z-index: 1001; justify-content: center; align-items: center; 
    backdrop-filter: blur(5px); padding: 1rem; box-sizing: border-box; 
    overscroll-behavior: contain;
}
.modal.open { display: flex; }
.modal-content, .modal-content-lg { 
    background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; 
    padding: 2rem; width: 100%; box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    max-height: 90vh; overflow-y: auto; position: relative;
    overscroll-behavior: contain;
}
.modal-content-lg { max-width: 800px; padding: 2.5rem; }
.modal-close { 
    position: absolute; top: 1.25rem; right: 1.25rem; background: none; 
    border: none; color: var(--text-muted); cursor: pointer; display: flex; 
    align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1;
    padding: 0.25rem; transition: color 0.2s; z-index: 10;
}
.modal-close:hover { color: var(--text); }

/* =========================================
   5. PAGE: STORE (INDEX)
   ========================================= */
.header-controls { display: flex; align-items: center; gap: 1.5rem; }
.cart-icon-btn {
    position: relative;
    background: transparent;
    color: var(--text);
    border: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.cart-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.cart-icon-btn svg {
    width: 22px;
    height: 22px;
}
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--surface);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
}
.cart-badge.is-zero {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}


.header-back-link {
    color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    transition: color 0.2s, background-color 0.2s; display: inline-flex; align-items: center; gap: 0.4rem;
}
.header-back-link:hover { color: var(--text); }

.categories { display: flex; gap: 1rem; justify-content: center; padding: 2rem 2rem 0 2rem; flex-wrap: wrap; }
.cat-btn {
    background: var(--surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border); padding: 0.5rem 1.25rem; border-radius: 20px;
    cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: all 0.2s; color: var(--text);
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary-btn); color: white; border-color: var(--primary-btn); font-weight: 600; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; min-height: 450px; }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.product-wrapper { display: flex; flex-direction: column; opacity: 0; animation: fade-in-up 0.5s ease-out forwards; }

.product-card {
    background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex; flex-direction: column; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; height: 100%;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }

@keyframes skeleton-pulse {
    0% { background-color: rgba(255, 255, 255, 0.02); }
    50% { background-color: rgba(255, 255, 255, 0.08); }
    100% { background-color: rgba(255, 255, 255, 0.02); }
}
.skeleton-bg { animation: skeleton-pulse 1.5s infinite ease-in-out; }
.img-placeholder {
    width: 100%; height: 200px; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--border); overflow: hidden;
}
.product-image { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease-in-out; }
.product-image.loaded { opacity: 1; }
.product-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.product-content h3 { margin: 0 0 0.5rem 0; font-size: 1.1rem; }
.product-category { font-size: 0.8rem; color: var(--primary); text-transform: uppercase; font-weight: bold; margin-bottom: 0.5rem; }
.product-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.4; flex: 1; }
.price { font-size: 1.25rem; font-weight: bold; margin-bottom: 1rem; color: var(--text); }
.price-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: normal; margin-left: 0.25rem; }

/* Loading Spinner */
.loader-container { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; padding: 4rem; flex-direction: column; gap: 1rem; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1); border-radius: 50%; border-top-color: var(--primary); animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

body.no-scroll {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: none !important;
}

.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    touch-action: none;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
    position: fixed; top: 0; right: -450px; width: 400px; max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--surface); box-shadow: -4px 0 15px rgba(0,0,0,0.5); backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px); transition: right 0.3s ease-in-out; z-index: 1000;
    display: flex; flex-direction: column;
    overscroll-behavior: contain;
}
.cart-drawer.open { right: 0; }
.cart-header { flex-shrink: 0; padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { margin: 0; }
.close-cart { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.close-cart:hover { color: var(--text); }
.cart-body {
    padding: 1.5rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.cart-item {
    display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.22s ease,
                margin 0.22s ease;
    max-height: 120px;
    overflow: hidden;
}
.cart-item.removing {
    opacity: 0;
    transform: translateX(-24px);
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-bottom-color: transparent !important;
}

/* Micro-Interaction: Cart Bounce */
@keyframes cart-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.cart-bounce {
    animation: cart-bounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cart-item-info { flex: 1; padding-right: 1rem; }
.cart-item-title { font-weight: bold; font-size: 0.95rem; margin-bottom: 0.25rem; }
.cart-item-price { font-size: 0.85rem; color: var(--text-muted); }
.cart-item-controls { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn { background: var(--surface-alt); border: 1px solid var(--border); width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-weight: bold; color: var(--text); display: flex; justify-content: center; align-items: center;}
.qty-btn:hover { background: var(--border); }
.qty-input { width: 40px; height: 28px; text-align: center; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); border-radius: 4px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; }

/* Number input reset: hide browser native spinners globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.cart-footer {
    flex-shrink: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    margin-top: auto;
}
.cart-total { font-size: 1.25rem; font-weight: bold; margin-bottom: 1.5rem; display: flex; justify-content: space-between; }
.empty-cart { color: var(--text-muted); font-style: italic; text-align: center; margin-top: 2rem; }

.product-modal-content { max-width: 1040px; display: flex; gap: 0; padding: 0; overflow: hidden; position: relative; overscroll-behavior: contain; border-radius: 12px; }
.product-modal-gallery { 
    flex: 0 0 420px; background: rgba(13, 15, 20, 0.4); display: flex; flex-direction: column; 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-right: 1px solid var(--border); 
}
.pm-main-image-container { 
    height: 350px; width: 100%; padding: 2rem; box-sizing: border-box; display: flex; 
    justify-content: center; align-items: center; overflow: hidden; cursor: zoom-in; 
}
.pm-main-image-container.zoomed { cursor: crosshair; }
.pm-main-image { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: transform 0.25s ease-out, opacity 0.4s ease-in-out; pointer-events: none; }
.pm-main-image.loaded { opacity: 1; }
.pm-thumbnails { display: flex; gap: 0.6rem; padding: 1rem 1.25rem; overflow-x: auto; background: rgba(0,0,0,0.25); border-top: 1px solid var(--border); }
.pm-thumb { 
    width: 58px; height: 58px; object-fit: contain; border: 2px solid var(--border); 
    cursor: pointer; border-radius: 6px; background: rgba(255,255,255,0.05); transition: border-color 0.2s, opacity 0.3s ease-in-out; padding: 3px;
    opacity: 0;
}
.pm-thumb.loaded { opacity: 1; }
.pm-thumb:hover { border-color: rgba(255,255,255,0.3); }
.pm-thumb.active { border-color: var(--primary); background: rgba(255,255,255,0.1); }
.product-modal-details { 
    flex: 1; min-width: 0; padding: 2rem 2.25rem; display: flex; flex-direction: column; 
    background: var(--surface-alt); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.product-modal-details h2 { margin-top: 0; font-size: 1.55rem; font-weight: 700; margin-bottom: 0.5rem; border: none; padding: 0; line-height: 1.25; }
.pm-category { color: var(--primary); font-size: 0.85rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.pm-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.55; margin-bottom: 0.6rem; }

/* 2-Column Specs Grid: Deliverables left, Volume Pricing right */
.pm-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.25rem;
    align-items: start;
}
.pm-specs-grid:has(.pm-features:empty),
.pm-specs-grid:has(.pm-volume-prices:empty) {
    grid-template-columns: 1fr;
}
.pm-features:empty, .pm-volume-prices:empty { display: none; }
.pm-features { margin-bottom: 0; }
.pm-features h4 { margin: 0 0 0.6rem 0; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.pm-features ul { padding-left: 1.15rem; margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.pm-features li { margin-bottom: 0.35rem; }
.pm-volume-prices { margin-top: 0; }
.pm-volume-prices h4 { margin: 0 0 0.6rem 0; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.volume-price-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }
.volume-price-table th, .volume-price-table td { padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--border); transition: background 0.15s ease, color 0.15s ease; }
.volume-price-table th { color: var(--text-muted); font-weight: normal; font-size: 0.8rem; }
.volume-price-table td { color: var(--text); }
.volume-price-table td.tier-price { font-weight: bold; text-align: right; }
.volume-price-table th:last-child { text-align: right; }

.volume-price-table tr[data-tier] {
    cursor: pointer;
    transition: background 0.15s ease;
}
.volume-price-table tr[data-tier]:hover {
    background: rgba(255, 255, 255, 0.06);
}
.volume-price-table tr[data-tier]:hover td.tier-qty {
    color: var(--primary);
}

.volume-price-table tr[data-tier].is-active {
    background: rgba(237, 43, 52, 0.12);
}
.volume-price-table tr[data-tier].is-active td.tier-qty {
    color: var(--primary);
    font-weight: bold;
}
.volume-price-table tr[data-tier].is-active td.tier-price {
    color: #ffffff;
}
.price-display .original-price { text-decoration: line-through; color: var(--text-muted); font-weight: normal; font-size: 0.85em; margin-right: 0.5rem; }

/* Bottom Section: Dedicated Price Row + Action Row */
.pm-bottom-section {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.pm-price-container {
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pm-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}
.pm-price .original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: normal;
    margin-right: 0.25rem;
}
.pm-price .current-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}
.pm-price .unit-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: normal;
    white-space: nowrap;
}
.pm-tax-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Product Modal Quantity Selector & Button */
.pm-actions-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0;
}
.pm-qty-selector {
    flex: 0 0 124px;
    width: 124px;
    height: 46px;
    display: flex;
    align-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}
.pm-qty-btn {
    width: 38px;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    padding: 0;
    margin: 0;
}
.pm-qty-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.pm-qty-input {
    flex: 1;
    min-width: 0;
    width: 48px;
    height: 100%;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.pm-qty-input::-webkit-outer-spin-button,
.pm-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pm-add-btn {
    flex: 1;
    height: 46px;
    margin: 0 !important;
    padding: 0 1.5rem !important;
    font-size: 1.05rem !important;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================
   6. PAGE: CHECKOUT
   ========================================= */
.form-section, .summary-section {
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 8px; padding: 2rem; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.form-section h2, .summary-section h2 { margin-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.section-title { font-size: 1.1rem; color: var(--primary); margin-top: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.shipping-section { display: none; }
.shipping-section.active { display: block; }
.summary-item {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.22s ease,
                margin 0.22s ease;
    max-height: 160px;
    overflow: hidden;
}
.summary-item.removing {
    opacity: 0;
    transform: translateX(-24px);
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-bottom-color: transparent !important;
}
.summary-item-info { flex: 1; }
.summary-item-title { font-weight: bold; font-size: 0.95rem; }
.qty-controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.calc-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-muted); transition: color 0.2s; }
.calc-row-details {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 0.25rem;
}
.calc-row.total { font-size: 1.25rem; font-weight: bold; color: var(--text); border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 0.5rem; }
.actions-group { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.legal-text { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.legal-text h3 { color: var(--text); margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.payment-options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.payment-option {
    display: flex; align-items: center; gap: 1rem;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    padding: 1rem; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.payment-option:hover { border-color: rgba(255,255,255,0.3); }
.payment-option input[type="radio"] { display: none; }
.payment-option-content { display: flex; flex-direction: column; }
.payment-option-title { font-weight: bold; color: var(--text); }
.payment-option-desc { font-size: 0.85rem; color: var(--text-muted); }
.payment-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(237, 43, 52, 0.1);
}
.payment-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0,0,0,0.1);
}
.payment-warning {
    font-size: 0.85rem; color: var(--text-muted); background: rgba(0,0,0,0.2);
    padding: 0.75rem; border-radius: 4px; margin-bottom: 1.5rem;
    border: 1px solid var(--border); line-height: 1.4; display: none;
    transition: all 0.25s ease;
}
.payment-methods-card {
    background: rgba(237, 43, 52, 0.1);
    border: 1px solid var(--primary);
    padding: 1rem 1.15rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    user-select: none;
    cursor: default;
}
.payment-badges-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(4px, 1.2vw, 8px);
    overflow-x: auto;
    scrollbar-width: none;
}
.payment-badges-row::-webkit-scrollbar {
    display: none;
}
.payment-badge {
    height: clamp(21px, 6vw, 30px);
    width: auto;
    flex-shrink: 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    display: block;
    cursor: default;
}
.payment-secure-hint {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* --- Shipping Method Card, Carrier Logo & Badges --- */
.shipping-method-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 1rem 1.15rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}
.shipping-method-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}
.shipping-carrier-logo {
    height: 25px;
    width: auto;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.shipping-method-title {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Checkout Dynamic Transitions & Animations --- */
@keyframes fcHighlightPulse {
    0% {
        color: var(--primary);
        transform: scale(1.08);
        text-shadow: 0 0 8px rgba(237, 43, 52, 0.4);
    }
    60% {
        color: #ff6b72;
        transform: scale(1.02);
    }
    100% {
        color: inherit;
        transform: scale(1);
        text-shadow: none;
    }
}

@keyframes fcBoxPulse {
    0% {
        transform: scale(0.985);
        box-shadow: 0 0 0 0 rgba(237, 43, 52, 0.4);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 12px 2px rgba(237, 43, 52, 0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

@keyframes fcFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-pulse-value {
    display: inline-block;
    animation: fcHighlightPulse 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.animate-pulse-box {
    animation: fcBoxPulse 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.animate-fade-in {
    animation: fcFadeSlideIn 0.3s ease-out;
}

/* =========================================
   7. PAGE: TERMS & CONDITIONS
   ========================================= */
.content-section {
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 8px; padding: 3rem; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.content-section h1 { margin-top: 0; font-size: 2.2rem; text-align: center; margin-bottom: 0.5rem; }
.content-section .last-updated { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; font-size: 0.9rem; }
.content-section .warning-box { background: rgba(237, 43, 52, 0.1); border: 1px solid var(--primary); color: #ffcccc; padding: 1rem; border-radius: 6px; text-align: center; font-weight: bold; margin-bottom: 2.5rem; }
.content-section h2 { margin-top: 2.5rem; font-size: 1.25rem; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.content-section p { color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.content-section ul { color: var(--text-muted); line-height: 1.6; margin-top: 0; margin-bottom: 1.5rem; padding-left: 1.5rem; }
.content-section li { margin-bottom: 0.5rem; }
.content-section strong { color: var(--text); font-weight: 600; }

/* =========================================
   FLOATING SCROLL-TO-TOP BUTTON
   ========================================= */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: rgba(30, 33, 43, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s ease;
    z-index: 990;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(237, 43, 52, 0.4);
}

/* =========================================
   8. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
    /* Global Layout & Padding */
    .container { padding: 0 1rem; margin: 1.5rem auto; }
    
    /* Mobile Header Navigation */
    .header-content { padding: 0.85rem 1rem; gap: 0.75rem; min-height: 65px; }
    .logo-container { gap: 8px; flex-shrink: 1; min-width: 0; }
    .logo-container img { height: 26px; width: auto; }
    .logo-container span { font-size: 1.15rem; padding-left: 8px; white-space: nowrap; }
    .header-controls { flex-shrink: 0; margin-left: auto; }
    .cart-icon-btn { width: 38px; height: 38px; }
    .cart-icon-btn svg { width: 20px; height: 20px; }
    .cart-badge { top: 0px; right: 0px; min-width: 16px; height: 16px; font-size: 0.65rem; }
    .header-back-link {
        font-size: 0.85rem; padding: 0.4rem 0.75rem; background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border); border-radius: 6px; white-space: nowrap; flex-shrink: 0;
    }

    /* Footer */
    .site-footer { margin-top: 3rem; padding: 2rem 1rem 1.5rem 1rem; }
    .footer-container { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
    .footer-container > .footer-col:last-of-type { text-align: center; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 1rem; }
    .footer-links { justify-content: center; gap: 1rem; }
    
    /* Cookie Banner */
    .cookie-banner { flex-direction: column; text-align: center; padding: 1.25rem 1rem; gap: 1rem; }
    .cookie-banner .btn { width: 100%; }
    
    /* Forms & Inputs */
    .form-row { flex-direction: column; gap: 0; }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* Prevents unwanted iOS Safari zoom */
    }

    /* Store (Index) */
    .categories { padding: 1rem 0; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
    .cat-btn { padding: 0.4rem 1rem; font-size: 0.85rem; }
    .products { grid-template-columns: 1fr; gap: 1.5rem; }
    .product-content { padding: 1.25rem; }
    
    /* Cart Drawer */
    .cart-drawer { width: 100%; right: -100%; }
    .cart-header, .cart-body, .cart-footer { padding: 1.25rem 1rem; }
    .qty-btn { width: 32px; height: 32px; font-size: 1.1rem; }
    .qty-input { width: 44px; height: 32px; font-size: 16px; }

    /* Product Modal */
    .modal { padding: 0.5rem; }
    .modal-content, .modal-content-lg { padding: 1.25rem; border-radius: 12px; }
    .product-modal-content { flex-direction: column; max-height: 85vh; overflow-y: auto; border-radius: 12px; }
    .product-modal-gallery { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
    .product-modal-details { padding: 1.25rem; }
    .product-modal-details h2 { font-size: 1.3rem; }
    .pm-price { font-size: 1.4rem; }
    .pm-main-image-container { height: 230px; padding: 1rem; }
    .pm-thumb { width: 55px; height: 55px; }
    .pm-specs-grid { grid-template-columns: 1fr; gap: 1rem; }
    .pm-bottom-section { margin-top: 1.25rem; padding-top: 1rem; }
    .pm-price-container { flex-direction: column; align-items: flex-start; gap: 0.25rem; margin-bottom: 0.75rem; }
    .pm-actions-container { width: 100%; }
    .pm-actions-container .btn { flex: 1; }
    .volume-price-table { font-size: 0.85rem; }
    .volume-price-table th, .volume-price-table td { padding: 0.4rem; }

    /* Checkout */
    .checkout-container { margin: 1.5rem auto; grid-template-columns: 1fr; gap: 1.5rem; }
    .form-section, .summary-section { padding: 1.25rem; border-radius: 12px; }
    .form-section h2, .summary-section h2 { font-size: 1.3rem; margin-bottom: 1rem; }

    /* Terms */
    .terms-container { margin: 1.5rem auto; }
    .content-section { padding: 1.25rem; border-radius: 12px; }
    .content-section h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    .header-content { padding: 0.75rem 0.85rem; gap: 0.5rem; min-height: 60px; }
    .logo-container img { height: 21px; }
    .logo-container span { font-size: 0.95rem; padding-left: 6px; }
    .cart-icon-btn { width: 36px; height: 36px; }
    .cart-icon-btn svg { width: 19px; height: 19px; }
    .header-back-link { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
    .scroll-top-btn { bottom: 1.25rem; right: 1.25rem; }
}

@media (max-width: 360px) {
    .header-content { min-height: 58px; }
    .logo-container img { height: 18px; }
    .logo-container span { display: none; } /* On extremely small screens (<=360px), hide 'Store' sublabel */
    .cart-icon-btn { width: 34px; height: 34px; }
    .cart-icon-btn svg { width: 18px; height: 18px; }
    .header-back-link { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
}