:root {
    --primary: #2c3e50;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --ff: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--ff);
}

body {
    margin: 0;
    padding-bottom: 60px;
    background: #ffff;
    color: #454545;
}

svg {
    cursor: pointer;
}
a {
    text-decoration: none;
    color: #454545;
}
.currency {
    font-size: 12px;
    font-weight: normal;
    margin-right: 0.2rem;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s;
    pointer-events: none;
    opacity: 0;
}

#preloader.active {
    pointer-events: all;
    opacity: 1;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Layout & Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.masonry-grid {
    column-count: 5;
    column-gap: 12px;
}

@media (max-width: 900px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 2;
    }
}

.product-card {
    break-inside: avoid;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-card svg {
    background: #000;
    fill: #fff;
    padding: 0.2rem;
    border-radius: 5px;
    width: 26px;
    height: 26px;
}

.product-card img {
    /* Constraint */
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* UI Elements */
.search-container {
    top: -200%;
    background: white;
    padding: 10px;
    z-index: 6;
    width: 100%;
    position: fixed;
    left: 0;
    padding: 1rem;
    height: 100%;
}

.search-container.active {
    top: 0;
}

.search {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 50px;
    outline: none;
    border: 1px solid #000;
}

.search-container .search-icon {
    cursor: pointer;
}
.search-container .check-search-btn {
    position: relative;
    left: calc(100% - 2.2rem);
    bottom: 2rem;
}
#suggestions {
    left: 0;
    background: white;
    max-width: 800px;
    margin: 0 auto;
    display: none;
    position: relative;
    top: -1rem;
}

#suggestions div {
    padding: 8px;
    cursor: pointer;
}

#suggestions div:hover {
    background: var(--light);
}

/* Cart Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(50px);
    color: rgb(0, 0, 0);
    border-radius: 5px 5px 0 0;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 4;
    font-weight: 600;
    max-width: 1400px;
    font-size: 18px;
    margin: 0 auto;
}

.bottom-bar button {
    background: #000000;
    border-radius: 5px;
    color: #ffffff;
    font-weight: 500;
    outline: none;
    border: none;
    font-size: 16px;
    padding: 0.4rem 0.5rem;
}

.bottom-bar .right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bottom-bar #total-items {
    background: #0050e4;
    padding: 0.3rem 0.6rem;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    position: relative;
}
.bottom-bar #total-items::before {
    content: '';
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    background: #ff006a;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: -1;
}
.bottom-bar .total-items.active {
    animation: 2s animate infinite;
}

@keyframes animate {
    from {
        background: transparent;
    }
    to {
        background: #0050e4;
    }
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 100%;
    right: 0;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    background: white;
    transition: 0.2s;
    z-index: 4;
    overflow-y: auto;
}

.cart {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.cart-drawer.open {
    top: 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.cart-drawer form {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-drawer form label {
    font-size: 14px;
}

.cart-drawer form a {
    color: #000;
    font-size: 13px;
    margin-bottom: 0.5rem;
}

/* Admin Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-top: 1px solid #ccc;
}

th,
td {
    padding: 10px;
    text-align: left;
}

.btn-del {
    color: #ff0066;
    font-weight: 600;
    cursor: pointer;
}

.btn-edit {
    color: #000000;
    font-weight: 600;
    cursor: pointer;
}

.btn-2 {
    background: #ddd;
    color: #000;
    border: none;
    padding: 0.3rem;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
}

.btn-3 {
    cursor: pointer;
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
}

.btn-4 {
    cursor: pointer;
    background: transparent;
    color: #000;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

/* Modal */
#product-modal {
    margin-top: 4rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    z-index: 2;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
    overflow-y: auto;
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;

}

/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed #000;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    background: #ffffff;
    margin-bottom: 15px;
}

.drop-zone.dragover {
    background: #e4e4e4;
    border-color: var(--primary);
}

.drop-zone p {
    margin: 0;
    color: #666;
    pointer-events: none;
}

/* Image Previews */
#preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.preview-card {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.preview-remove:hover {
    background: red;
}

/* Carousel Wrapper */
.carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    padding: 5px;
}

/* The Scrollable Container */
.scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    /* Smooth sliding */
    scroll-snap-type: x mandatory;
    /* Snap to images */
    width: 100%;
    padding: 10px 0;

    /* Hide Scrollbars */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hide Scrollbar for Chrome/Safari/Opera */
.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Images inside the carousel */
.scroll-container img {
    height: 200px;
    /* Fixed height for consistency */
    flex-shrink: 0;
    /* Prevent shrinking */
    border-radius: 5px;
    scroll-snap-align: center;
    /* Snap logic */
    max-width: 100%;
    /* Responsive width */
    object-fit: contain;
}

/* Navigation Buttons */
.nav-btn {
    background: rgba(255, 255, 255, 0.5);
    color: rgb(0, 0, 0);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
    flex-shrink: 0;
    /* Don't shrink buttons */
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .scroll-container img {
        height: 150px;
    }

    /* Smaller images on mobile */
    .nav-btn {
        width: 25px;
        height: 25px;
    }
}

/* header */
header {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    left: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(50px);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0rem 1rem;
    max-width: 1400px;
}

header .container .left,
header .container .right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #000;
    text-decoration: none;
}

header .container .left img {
    width: 30px;
    border-radius: 5px;
}

/* product-form */
.manager-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

#csv-modal {
    max-width: 100%;
    height: 100% !important;
    justify-content: center !important;
    height: fit-content;
}

#csv-modal .modal-content {
    margin-top: 1rem;
    width: 100% !important;
    box-shadow: 0 0 0 100vh rgba(0, 0, 0, 0.5);
    height: fit-content;
}

#product-form {
    background: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 5px;
    border: 2px solid #000000 !important;
    resize: none;
    font-weight: 600;
    font-family: var(--ff);
}

textarea {
    height: 300px;
}

/* Category Grid Layout */
#quick-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

/* Individual Category Box */
.cat-box {
    background: #eee;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

/* SVG Icon Styling */
.cat-box svg {
    width: 24px;
    height: 24px;
    fill: #000;
}

.cat-box span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.product-section {
    padding-top: 0;
    margin-top: 0;
    overflow-x: auto;
}

.product-section .cats {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.product-section .category-grid {
    display: flex;
    gap: 0.5rem;
    width: fit-content;
}

.product-section .cat-box {
    white-space: nowrap;
}

#m-desc {
    padding-bottom: 10rem;
}


/* add to cart */
/* The Notification Box */
#cart-notification {
    visibility: hidden;
    /* Hidden by default */
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    z-index: 4;
    width: 100%;
    height: 100%;
    font-size: 22px;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The 'show' class triggers the animation */
#cart-notification.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Icon styling */
.check-icon {
    color: #ffffff;
    margin-right: 10px;
    font-weight: bold;
}

.copyrights {
    padding: 2rem;
    text-align: center;
    font-size: 13px;
}
.copyrights a {
    padding: 0 0.1rem;
}

.copyrights a {
    color: #454545;
}

/* cover-imgd */
.cover-img {
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.cover-img img {
    object-fit: cover;
    width: 100%;
}

/* signin */
.sign-in {
    position: fixed;
    top: -200%;
    left: 0;
    height: 100%;
    width: 100%;
    background: #fff;
    z-index: 7;
}

.sign-in .sign-in-form {
    max-width: 400px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 auto;
    text-align: center;
    margin-top: 2rem;
}

.sign-in .sign-in-form a {
    color: #454545;
    font-size: 14px;
}

.sign-in .sign-in-form img {
    width: 70px;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
}

.sign-in .sign-in-form input,
.sign-in .sign-in-form button {
    border-radius: 50px;
    padding: 0.7rem 1rem;
}

/* load more */
.load-more {
    padding: 2rem;
    text-align: center;
    display: none;
}

.load-more button {
    font-size: 16px;
}

/* Order History Cards */
.order-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.order-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.order-items {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.4;
    /* Limit to 2 lines for tidiness */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.order-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
}

.btn-cancel {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

/* Tab Navigation */
.tabs-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    border-radius: 0;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid #000;
}

/* Form Layout Improvements */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row input,
.form-row select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Table Responsive Wrapper */
.table-responsive {
    overflow-x: auto;
}

/* Image Skeleton / Placeholder */
.img-container {
    width: 100%;
    /* Match your card image height */
    background-color: #f0f0f0;
    /* Light gray placeholder */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* The Image itself */
.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image fills box without stretching */
    opacity: 0;
    /* Hidden initially */
    transition: opacity 0.2s ease-in;
    /* Fade in effect */
}

/* Class added via JS when image finishes loading */
.img-container img.loaded {
    opacity: 1;
}

.sticky {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    background: #fff;
    padding: 0.5rem;
    border-radius: 5px;
    z-index: 10;
}

/* The Moving Container */
.cart-track {
    display: none;
    width: 400px;
    /* Fixed width */
    max-width: 800px;
    /* Responsive if screen is smaller */
    height: 100%;
    /* Height of the cart area */
    margin: 0 auto;
    /* Centers the track horizontally */
    position: relative;
    overflow: hidden;
    /* Hides the cart when it leaves the 800px area */

    /* Optional: visual aid to see the 800px area (remove if not needed) */
    /* border-bottom: 2px solid #ddd; */
}

/* The Moving Cart */
.cart-container {
    position: fixed;
    bottom: 60px;
    width: 100px;
    /* Start position: just outside the left edge */
    left: -120px;
    z-index: 3;
    animation: driveMiddle 40s linear infinite;
}

/* Cart Icon Styling */
.cart-icon {
    width: 30px;
    height: auto;
    fill: none;
    stroke: black;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The Animation */
@keyframes driveMiddle {
    0% {
        left: -120px;
        /* Start outside left */
    }

    100% {
        left: 100%;
        /* End outside right */
    }
}

.sort-by {
    width: 300px;
    margin-bottom: 1rem;
}

@media screen and (max-width: 500px) {
 .sort-by {
    width: 100%;
    margin-bottom: 1rem;
}   
.cats::-webkit-scrollbar {
    display: none;
}
}

.search-for {
    font-size: 18px;
    font-weight: 600;
}

.cat-box.active {
    background: black !important;
}
.cat-box.active svg {
    fill: white !important;
}
.cat-box.active span {
    color: #fff !important;
}