/* 
    Ham-Store Premium Dark Theme
    Designed for Hamza - Software Engineer & Laser Weapon Enthusiast
*/

:root {
    /* Color Palette */
    --bg-deep: #0a0a0b;
    --bg-surface: #161618;
    --bg-nav: #111113;
    --accent: #00d1ff; /* Laser Cyan */
    --accent-glow: rgba(0, 209, 255, 0.3);
    --text-main: #e1e1e1;
    --text-dim: #888888;
    --border: #2a2a2c;
    --error: #ff4d4d;
    
    /* Animation & Curves */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 1. Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* 2. Header & Navigation */
header {
    background-color: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    gap: 30px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

/* 3. Custom Search Bar Animation */
.search-bar {
    flex-grow: 1;
    max-width: 800px;
    position: relative;
}

.search-bar form {
    display: flex;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
    overflow: hidden;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-size: 0.95rem;
}

.search-bar button {
    padding: 0 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-left: 1px solid var(--border);
    transition: var(--transition);
}

/* Search Focus Interaction */
.search-bar:focus-within form {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.search-bar:focus-within button {
    color: var(--accent);
    background: rgba(0, 209, 255, 0.05);
}

/* 4. Sub-Navigation (Categories) */
.sub-nav {
    background: var(--bg-nav);
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
}

.sub-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.sub-nav a {
    display: block;
    padding: 12px 0;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.sub-nav a:hover, .sub-nav a.active {
    color: var(--accent);
}

.sub-nav a::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.sub-nav a:hover::after, .sub-nav a.active::after {
    width: 100%;
}

/* 5. Layout Container */
.container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 40px;
}

/* 6. Sidebar & Custom Checkboxes */
.sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 20px;
    border-left: 2px solid var(--accent);
    padding-left: 10px;
}

.filter-section {
    margin-bottom: 35px;
}

.filter-group ul {
    list-style: none;
}

.filter-group li {
    margin-bottom: 12px;
    position: relative;
}

/* Hiding original checkbox/radio */
.filter-group input[type="checkbox"], 
.filter-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom Label Styling */
.filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: color 0.2s;
}

/* Custom Box/Circle */
.filter-group label::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    background: var(--bg-surface);
    margin-right: 12px;
    border-radius: 4px; /* Default for checkbox */
    transition: all 0.2s var(--bounce);
}

/* Radio Specific Shape */
.filter-group input[type="radio"] + label::before {
    border-radius: 50%;
}

/* Hover effect on label */
.filter-group label:hover {
    color: var(--text-main);
}

.filter-group label:hover::before {
    border-color: var(--text-dim);
}

/* CHECKED STATE ANIMATION */
.filter-group input:checked + label {
    color: var(--accent);
    font-weight: 600;
}

.filter-group input:checked + label::before {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.1);
    animation: checkPop 0.4s var(--bounce);
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.1); }
}

/* 7. Product Grid & Cards */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
    transition: transform 0.5s var(--transition);
}

.product-card:hover img {
    transform: scale(1.08);
}

.product-card h3 {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-card h4 {
    font-size: 15px;
    font-weight: 200;
}

.product-card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin: 10px 0;
}

.product-card button {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.3s;
}

.product-card button:hover {
    background: var(--accent);
    color: var(--bg-deep);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* 8. Footer */
footer {
    margin-top: 80px;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    padding: 60px 40px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand h2 {
    color: var(--accent);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.link-group h4 {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.link-group a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- User Menu & Cart Button Styling --- */
.user-menu ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 25px;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition);
}

.cart-btn:hover {
    border-color: var(--accent);
    background: rgba(0, 209, 255, 0.05);
    transform: translateY(-2px);
}

.cart-icon {
    font-size: 1.1rem;
}

#cart-count {
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
    transition: transform 0.2s var(--bounce);
}

/* --- Custom Sort Dropdown --- */
.sort-options select {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    appearance: none; /* Removes default arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 35px;
}

.sort-options select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.sort-options select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

/* --- Sidebar Price Checkbox Fix --- */
.filter-price + label::before {
    /* Ensures the specific price checkboxes use the premium style */
    content: "";
    display: inline-block;
}

/* Results Title Styling */
#results-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- Side Cart Drawer --- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--bg-nav);
    border-left: 1px solid var(--border);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-drawer.active {
    transform: translateX(0);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
}

.cart-overlay.active {
    display: block;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
}

/* --- Cart Item Rectangle Cards --- */
.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item-card {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    gap: 15px;
}

.cart-item-left .cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-price {
    color: #007bff; /* Specific Blue */
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- QTY Controls --- */
.cart-item-qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.qty-btn {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.qty-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.qty-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* --- Model Dropdown Selector (Matching PC Selector) --- */
.model-dropdown {
    width: 100%;
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    appearance: none; /* Removes default OS arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 35px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.model-dropdown:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.model-dropdown option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

/* Error state if user forgets to pick a model */
.model-dropdown.error-shake {
    border-color: var(--error);
    animation: shake 0.4s var(--bounce);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}


/* --- Cart Footer & Buttons --- */
.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-nav);
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border);
}


.cart-actions {
    display: flex;
    gap: 10px;
}

.place-order-btn {
    flex: 1;
    background-color: #0056b3; /* Blue */
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.clear-cart-btn {
    flex: 1;
    background-color: #8b0000; /* Dark Red */
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.place-order-btn:hover, .clear-cart-btn:hover {
    opacity: 0.9;
}

/* --- Mobile Results Title Scaling --- */
@media (max-width: 600px) {
    #results-title {
        font-size: 0.65rem; /* Shrinks the "Available Products" text */
        font-weight: 600;
        letter-spacing: 0.5px;
        color: var(--text-dim);
        text-transform: uppercase;
    }

    @media (max-width: 600px) {
    .badge {
        top: 8px !important;
        right: 8px !important;
        padding: 4px 10px !important;
        font-size: 0.4rem !important;
        font-weight: 900 !important;
        border-radius: 5px !important;
        box-shadow: 0 0 12px var(--accent-glow) !important;
        letter-spacing: 0.5px !important;
    }
}


    .content-header {
        margin-bottom: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Scaling down the sort dropdown to match the smaller title */
    .sort-options select {
        font-size: 0.8rem;
        padding: 5px 10px;
        padding-right: 30px;
        height: auto;
    }
}

/* --- Mobile Compatibility --- */
@media (max-width: 768px) {
    .cart-drawer {
        width: 100%;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .sidebar {
        display: none; /* Hide sidebar filters on mobile or move to a dropdown */
    }
    
    .header-top {
        padding: 12px 20px;
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
}

/* --- Custom Modal Popup --- */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

#modal-overlay.active {
    display: flex;
}

#custom-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    transform: scale(0.9);
    transition: transform var(--transition);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

#custom-modal.active {
    transform: scale(1);
}

#modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 15px;
}

#modal-message {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

#modal-confirm {
    background-color: #0056b3; /* Blue */
    color: white;
}

#modal-cancel {
    background-color: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.modal-btn:hover {
    opacity: 0.8;
}

/* --- Place Order Disabled State --- */
#place-order-btn:disabled {
    background-color: var(--border);
    color: var(--text-dim);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Mobile Tweak for Modal */
@media (max-width: 480px) {
    #custom-modal {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* --- 1. Production Mobile Optimization (No Zoom on Focus) --- */
/* Setting inputs to 16px prevents iOS from auto-zooming, which breaks UX */
input, select, textarea {
    font-size: 16px !important;
}

/* --- 2. Mobile Category Horizontal Scroll --- */
@media (max-width: 768px) {
    .sub-nav {
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth momentum scroll for iOS */
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    .sub-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .sub-nav ul {
        display: flex;
        white-space: nowrap;
        gap: 20px;
        padding: 10px 0;
    }

    .sub-nav a {
        font-size: 0.85rem;
        padding: 8px 5px;
    }
}

/* --- 3. Production Product Grid (2 Items Per Row on Phone) --- */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Forces 2 items per row */
        gap: 12px !important;
        padding: 0 5px;
    }

    .product-card {
        padding: 12px;
        border-radius: 10px;
    }

    .product-card img {
        height: 130px; /* Adjusted for smaller cards */
        margin-bottom: 10px;
    }

    .product-card h3 {
        font-size: 0.85rem;
        height: 2.4em; /* Ensures alignment if titles are long */
        overflow: hidden;
    }

    .product-card .price {
        font-size: 1.1rem;
        margin: 5px 0;
    }

    .product-card button {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* --- 4. Header & Search Polish (Top of Page) --- */
@media (max-width: 768px) {
    .header-top {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
        order: 3; /* Places search below logo and cart on mobile */
    }

    .user-menu {
        width: 100%;
        order: 2;
    }

    .user-menu ul {
        justify-content: center;
        gap: 30px;
    }

    .cart-btn {
        padding: 6px 14px;
    }
}

/* --- 5. Checkout & Success Modal Polish (Bottom/Overlay) --- */
@media (max-width: 480px) {
    #custom-modal {
        width: 95%;
        padding: 20px 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row input, .form-row select {
        width: 100%;
        margin-bottom: 10px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Success Popup Specifics */
    .order-id-display {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    #copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- 6. Footer Layout --- */
@media (max-width: 768px) {
    footer {
        padding: 40px 20px 20px;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 40px;
    }

    .footer-links {
        justify-content: center;
        gap: 40px;
    }
}

/* --- 1. Production Checkout Form (Delivery Details) --- */
.checkout-container {
    text-align: left;
}

/* Add this to your style.css under the Checkout Form section */

.checkout-container h3 {
    margin-bottom: 20px;
}


.total-display {
    background: rgba(0, 209, 255, 0.1);
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-main);
}

#order-form input, 
#order-form select {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    outline: none;
    transition: var(--transition);
}

#order-form input:focus, 
#order-form select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row input, 
.form-row select {
    flex: 1;
}

/* --- 2. Success Popup (Order Confirmation) --- */
.success-container {
    padding: 10px;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* --- Clickable Order ID Rectangle --- */
.order-id-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dotted var(--accent); /* Dotted border */
    padding: 18px 30px;
    border-radius: 10px;
    margin: 25px 0;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.order-id-box:hover {
    background: rgba(0, 209, 255, 0.05);
    border-style: solid; /* Changes to solid on hover for feedback */
}

.order-id-box:active {
    transform: scale(0.97);
}

.order-id-box.copied {
    border-color: #00ff88;
    border-style: solid;
    background: rgba(0, 255, 136, 0.05);
}

#display-order-id {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-main);
}

#copy-icon {
    font-size: 1.3rem;
    color: var(--accent);
    transition: transform 0.2s;
}

.order-id-box.copied #copy-icon {
    color: #00ff88;
    transform: scale(1.2);
}

/* --- Button Color Logic --- */
.modal-btn.confirm {
    background-color: #007bff !important; /* Production Blue */
    color: white !important;
}

.modal-btn.cancel {
    background-color: #dc3545 !important; /* Production Red */
    color: white !important;
}

/* --- Mobile Compatibility & Zoom Fix --- */
/* Prevents mobile browsers from zooming in when tapping inputs */
input, select, textarea {
    font-size: 16px !important;
}

@media (max-width: 600px) {
    #custom-modal {
        width: 92%;
        padding: 25px 15px;
    }

    /* Add this inside your @media (max-width: 600px) block in style.css */

    .variant-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }


    .order-id-box {
        padding: 15px 20px;
        margin: 20px 0;
    }

    #display-order-id {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
        padding: 16px; /* Larger tap target */
    }
}

/* --- Success Popup Refinement --- */
.success-title {
    color: #00ff88; /* Success Green */
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.success-icon-wrapper {
    width: 70px;
    height: 70px;
    background: #00ff88;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.success-icon-wrapper span {
    font-size: 35px;
    color: var(--bg-deep);
}

.status-tracker {
    margin-bottom: 25px;
}

.status-tag {
    background: #ffa500;
    color: black;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- 3. Production Mobile Compatibility (Top, Bottom, & Grid) --- */

/* Prevent Auto-Zoom on Mobile Focus */
input, select, textarea {
    font-size: 16px !important;
}

@media (max-width: 768px) {
    /* Header Top Polish */
    .header-top {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    /* Category Scroll Option */
    .sub-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0 15px;
        scrollbar-width: none;
    }

    .sub-nav::-webkit-scrollbar {
        display: none;
    }

    .sub-nav ul {
        display: inline-flex;
        gap: 20px;
        padding: 10px 0;
    }
}

/* Update your @media (max-width: 600px) block in style.css with these refinements */

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 10px;
    }

    .product-card {
        padding: 10px;
        /* Ensures the card doesn't expand past its grid cell */
        min-width: 0; 
        overflow: hidden;
    }

    .product-card img {
        height: 100px; /* Smaller images for mobile */
        margin-bottom: 8px;
    }

    .product-card h3 {
        font-size: 0.8rem;
        line-height: 1.2;
        height: 2.4em;
        margin-bottom: 5px;
    }

    .variant-container {
        margin: 8px 0;
    }

    /* Update your @media (max-width: 600px) block in style.css */

.variant-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.variant-btn {
    width: 100%;
    height: 30px;
    font-size: 0.65rem;
    margin-bottom: 0;
}


    .product-card .price {
        font-size: 0.9rem;
    }

    .product-card button.add-btn {
        padding: 8px;
        font-size: 0.75rem;
    }


    /* Smaller "Available Products" Text */
    #results-title {
        font-size: 0.8rem;
        text-transform: uppercase;
        color: var(--text-dim);
    }

    /* Modal Form Row Stacking */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Footer Mobile Polish */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .footer-links {
        justify-content: center;
        gap: 30px;
    }
}

/* --- Checkout Modal Buttons (Blue & Red) --- */
.modal-btn.confirm {
    background-color: #007bff !important; /* Specific Blue */
    color: white !important;
    border: none;
}

.modal-btn.cancel {
    background-color: #dc3545 !important; /* Specific Red */
    color: white !important;
    border: none;
}

.modal-btn:hover {
    filter: brightness(1.2);
}

/* --- Phone Compatibility & Scroll Fixes --- */

/* Prevent Auto-Zoom on Mobile Focus (iOS Fix) */
input, select, textarea {
    font-size: 16px !important;
}

@media (max-width: 600px) {
    /* Category Scroll Option */
    .sub-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0 10px;
    }

    .sub-nav ul {
        display: inline-flex;
        gap: 15px;
    }

    /* Modal Button Stacking for Phone */
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
        padding: 15px; /* Larger tap target for fingers */
    }

    /* Form Layout for Phone */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    #order-form input, 
    #order-form select {
        width: 100%;
        margin-bottom: 12px;
    }
}

/* --- 1. Production Form & Input Styling (No Zoom on Focus) --- */
/* Setting inputs to 16px prevents iOS from auto-zooming on focus */
input, select, textarea {
    font-size: 16px !important;
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row input, .form-row select {
    flex: 1;
}

/* --- 2. Success Popup & Order ID Styling --- */
.success-title {
    color: #00ff88; /* Success Green */
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.success-icon-wrapper {
    width: 70px;
    height: 70px;
    background: #00ff88;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.success-icon-wrapper span {
    font-size: 35px;
    color: var(--bg-deep);
}

/* Rectangle with Dotted Border (Clickable Copy Area) */
.order-id-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dotted var(--accent);
    padding: 18px 30px;
    border-radius: 10px;
    margin: 25px 0;
    cursor: pointer;
    transition: all var(--transition);
}

.order-id-box:hover {
    background: rgba(0, 209, 255, 0.05);
}

.order-id-box.copied {
    border-color: #00ff88;
    border-style: solid;
    background: rgba(0, 255, 136, 0.05);
}

#display-order-id {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-main);
}

#copy-icon {
    font-size: 1.3rem;
    color: var(--accent);
}

.order-id-box.copied #copy-icon {
    color: #00ff88;
}

/* --- 3. Modal Buttons (Blue & Red) --- */
.modal-btn.confirm {
    background-color: #007bff !important; /* Blue */
    color: white !important;
    border: none;
}

.modal-btn.cancel {
    background-color: #dc3545 !important; /* Red */
    color: white !important;
    border: none;
}

/* --- 4. Mobile Production Optimizations --- */
@media (max-width: 768px) {
    /* Horizontal Category Scroll */
    .sub-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0 15px;
        scrollbar-width: none;
    }

    .sub-nav::-webkit-scrollbar {
        display: none;
    }

    .sub-nav ul {
        display: inline-flex;
        gap: 20px;
        padding: 10px 0;
    }

    /* 2 Items Per Row on Phone */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 10px;
    }

    .product-card {
        padding: 10px;
    }

    .product-card img {
        height: 120px;
    }

    .product-card h3 {
        font-size: 0.85rem;
    }

    /* Form Stacking */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Modal Button Stacking */
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
        padding: 16px;
    }
}

/* --- Order Tracking & WhatsApp Contact Styles --- */
.track-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    border-left: 4px solid var(--accent);
    margin-top: 20px;
    animation: fadeInSlide 0.4s ease-out;
}

.track-card p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.track-card hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 15px 0;
}

/* WhatsApp Button for Declined Orders */
.wa-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background-color: #25D366 !important; /* WhatsApp Official Green */
    color: white !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    margin-top: 15px;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.wa-contact-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.wa-contact-btn:active {
    transform: scale(0.98);
}

@keyframes fadeInSlide {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Compact Variant Selector */
.variant-container {
    margin: 12px 0;
    text-align: left;
}

.variant-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    font-weight: 800;
}

.variant-selector {
    display: flex;
    gap: 8px;
}

.variant-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s var(--transition);
    font-weight: 700;
    padding: 0;
}

.variant-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.variant-btn.active {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* --- Cancel Order Button Styling --- */

.modal-btn.cancel {
    background-color: var(--error) !important;
    color: white !important;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.2);
}

.modal-btn.cancel:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 77, 0.3);
}

.modal-btn.cancel:active {
    transform: scale(0.98);
}

.modal-btn.cancel:disabled {
    background-color: #444 !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Container for the cancel button in tracking/success popups */
#cancel-action-container {
    margin-top: 15px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Add this to the VERY BOTTOM of your style.css to ensure it overrides everything else */

@media (max-width: 600px) {
    .variant-selector {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .variant-btn {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
}

/* --- New Cart & Delivery Logic --- */
.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-dim);
}

.summary-line span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

.total-final {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 1.2rem;
    color: var(--text-main) !important;
}

.total-final span:last-child {
    color: var(--accent) !important;
    font-weight: 800;
    text-shadow: 0 0 10px var(--accent-glow);
}

.free-delivery {
    color: #00ff88 !important; /* Laser Green */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

#delivery-row small {
    margin-left: 8px;
    font-size: 0.8rem;
    text-decoration: line-through;
    opacity: 0.4;
    color: var(--text-dim);
}

.total-display {
    background: rgba(0, 209, 255, 0.05);
    border: 1px solid var(--accent);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    color: var(--text-main);
    font-size: 1.1rem;
}

.total-display strong {
    color: var(--accent);
    font-size: 1.3rem;
    margin-left: 5px;
}

/* --- Product Badge & Discount Display --- */
.product-card {
    position: relative; /* Required for absolute positioning of the badge */
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: var(--bg-deep);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 0 15px var(--accent-glow);
    z-index: 5;
    pointer-events: none;
}

/* Pricing Layout with Discount */
.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 10px 0;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-dim);
    font-size: 0.9rem;
    opacity: 0.6;
}

.discount-tag {
    color: var(--error);
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(255, 77, 77, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

/* Cart Drawer Discount Styling */
#discount-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
    margin-top: 5px;
}

#cart-discount {
    color: var(--error) !important;
    font-weight: 700;
}

/* Ensure the badge doesn't overlap with the image hover effect */
.product-card:hover .badge {
    transform: translateY(-2px);
    transition: var(--transition);
}
