/* Global Styles */
:root {
    --primary-color: #8D6E63;
    /* Earthy brown for ceramics */
    --secondary-color: #D7CCC8;
    /* Light beige */
    --accent-color: #5D4037;
    /* Darker brown */
    --text-color: #333;
    --light-bg: #f8f9fa;
    --font-family: 'Outfit', sans-serif;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #fff;
    padding-top: 76px;
    /* For fixed navbar */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--accent-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

a:hover {
    color: var(--primary-color);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: #555 !important;
    margin: 0 10px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-icons .icon-link {
    font-size: 1.2rem;
    color: #555;
    margin-left: 15px;
}

.navbar-icons .icon-link:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 0;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 0;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Footer */
footer {
    background-color: var(--accent-color);
    color: #fff;
    padding: 3rem 0;
    margin-top: 5rem;
}

footer h5 {
    color: #fff;
    margin-bottom: 1.5rem;
}

footer a {
    color: #ccc;
    display: block;
    margin-bottom: 0.5rem;
}

footer a:hover {
    color: #fff;
}

/* Product Card */
.product-card {
    border: none;
    transition: 0.3s;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    height: 100%;
    /* Equal height */
    overflow: hidden;
    /* For border radius */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    /* Stronger shadow */
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    background-color: var(--light-bg);
    aspect-ratio: 1 / 1;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.product-card:hover .product-img {
    transform: scale(1.05);
    /* Slight zoom */
}

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    text-align: center;
    transition: 0.3s;
}

.product-card:hover .product-actions {
    bottom: 0;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: #777;
    max-width: 600px;
    margin: 0 auto;
}

/* Navbar Redesign */
.navbar-nav .nav-link {
    position: relative;
    padding-bottom: 5px;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.btn-terracotta {
    background-color: #B08968;
    color: #fff;
    border: 1px solid #B08968;
    padding: 8px 25px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-terracotta:hover {
    background-color: #8C5A3C;
    border-color: #8C5A3C;
    color: #fff;
    transform: translateY(-1px);
}

/* Modal Styling */
.modal-content {
    border-radius: 12px;
}

/* Category Section */
.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-img-wrapper {
    background-color: #f8f9fa;
    /* Soft neutral background */
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    /* Subtle shadow */
    transition: all 0.3s ease;
}

.category-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.category-card:hover .category-img-wrapper {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    /* Increased shadow */
}

.category-card:hover .category-img {
    transform: scale(1.1);
    /* Zoom effect */
}

/* Product Price Discount Styles */
.product-price-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.original-price {
    font-size: 0.9rem;
    color: #999;
}

.discounted-price {
    font-size: 1.1rem;
    color: #e63946; /* Strong red for discount */
    font-weight: 700;
}

.discount-label-mini {
    background-color: #e63946;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-info {
    transition: all 0.3s ease;
}

.product-card:hover .product-info {
    background-color: #fcfcfc;
}

.category-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    color: var(--text-color);
    font-size: 1rem;
}

.category-count {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Search Functionality */
.search-container {
    position: relative;
    display: inline-block;
}
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f1f1;
    border-radius: 20px;
    padding: 2px 10px;
    transition: all 0.3s;
}
.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding: 5px;
    width: 200px;
    font-size: 0.9rem;
}
.search-input::placeholder {
    color: #999;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 10px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}
.search-result-item:hover {
    background: #f1f1f1;
}
.search-result-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}
.search-result-info {
    flex: 1;
}
.search-result-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
}
.search-result-price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}
.search-no-results {
    padding: 15px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* ========================================================== */
/*                   Global Responsive Tweaks                 */
/* ========================================================== */
@media (max-width: 768px) {
    /* Prevent Horizontal Overflow */
    body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding-top: 60px; /* Reduced padding for smaller navbar */
    }

    /* Overall Section Padding */
    section {
        padding: 40px 15px !important; /* Balanced mobile padding */
    }

    /* Navbar Collapse Container */
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        margin-top: 10px;
    }

    /* Ensure flex lists stack cleanly */
    .navbar-collapse .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        gap: 10px;
    }

    .navbar-collapse .navbar-icons {
        justify-content: flex-start !important;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 10px;
    }

    .navbar-icons .icon-link {
        margin-left: 0;
        margin-right: 15px;
        font-size: 1.5rem; /* Better tap target */
        padding: 8px; /* Touch target space */
    }

    #authContainer {
        width: 100%;
        justify-content: stretch !important;
    }
    
    #authContainer a, #authContainer button {
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0 !important;
    }

    /* Scaling Typography */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.2rem; }
    
    /* Touch Friendly Buttons and Inputs */
    .btn, .form-control, .form-select {
        min-height: 44px;
    }

    /* Protect Images from Overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Adjust Pricing size */
    .product-price-large {
        font-size: 1.5rem !important; /* Tone down massive scaling */
    }
    .original-price { font-size: 1rem !important; }
    .discounted-price { font-size: 1.5rem !important; }
}

/* ========================================================== */
/*                   Skeleton Loader Utilities                */
/* ========================================================== */

.skeleton {
    background: #e2e5e7;
    background-image: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0), 
        rgba(255, 255, 255, 0.5), 
        rgba(255, 255, 255, 0)
    );
    background-size: 200px 100%;
    background-repeat: no-repeat;
    border-radius: 4px;
    display: inline-block;
    color: transparent !important;
    animation: shimmer 1.5s infinite linear;
}

.skeleton * {
    visibility: hidden;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

.skeleton-text {
    height: 1.2rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-img {
    width: 100%;
    height: 100%;
    min-height: 250px;
    background-color: #e2e5e7;
}