/* General Body Styling */
body {
    background: linear-gradient(135deg, #fff8fa 0%, #fce4ec 100%);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #555;
    overflow-x: hidden;
    position: relative;
    padding-top: 140px; /* Adjusted for static search section */
}

/* Animated Background Elements */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.1) 0%, rgba(240, 98, 146, 0.1) 100%);
    animation: float 20s infinite ease-in-out;
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
    animation-delay: 5s;
}

.bg-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #e91e63; /* Pink color for headings */
}

h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* Sticky Header Wrapper */
.sticky-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Force header elements to be contained within the wrapper */
.sticky-header-wrapper > header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: auto !important;
}

/* Override any existing fixed positioning from header.php */
header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: auto !important;
}

/* --- NEW SEARCH SECTION STYLES (From home.php) --- */
.search-section {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.1);
    padding: 25px;
    margin: 30px auto;
    max-width: 900px;
    width: 90%;
    position: relative;
    z-index: 100;
    transition: transform 0.3s ease;
}

.search-section:hover {
    transform: translateY(-5px);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.search-icon {
    position: absolute;
    right: 20px;
    color: #e91e63;
    font-size: 20px;
}

/* Floating Search Bar */
.floating-search {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.15);
    padding: 15px 0;
    z-index: 999;
    transition: top 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-search.visible {
    top: 80px; /* Adjusted to sit below header */
}

.floating-search-container {
    max-width: 700px;
    width: 90%;
    position: relative;
}

.floating-search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.floating-search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.floating-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #e91e63;
    font-size: 18px;
}

/* --- END NEW SEARCH STYLES --- */

/* --- FLOATING FILTER BUTTON --- */
.floating-filter-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse 2s infinite;
}

.floating-filter-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.6);
    animation: none;
}

.floating-filter-btn i {
    pointer-events: none;
}

/* --- FILTER SIDEBAR (SLIDE-OUT) --- */
.filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.filter-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden state */
    width: 350px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 1003;
    transition: right 0.4s cubic-bezier(0.5, 0, 0, 1);
    display: flex;
    flex-direction: column;
    border-radius: 15px 0 0 15px;
    overflow: hidden;
}

.filter-sidebar.active {
    right: 0; /* Visible state */
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8bbd0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #880e4f;
}

.sidebar-close {
    background: rgba(255,255,255,0.5);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    color: #880e4f;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: rgba(255,255,255,0.8);
}

.sidebar-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-body .filter-group {
    margin-bottom: 20px;
}

.sidebar-body label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.sidebar-body .filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
    transition: border-color 0.3s;
}

.sidebar-body .filter-select:focus {
    border-color: #e91e63;
    outline: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
}

.clear-filters {
    width: 100%;
    padding: 12px 20px;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.2);
}

.clear-filters:hover {
    background: #d81b60;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(233, 30, 99, 0.3);
}

/* Hide old filter toggle and container if they exist */
.filter-toggle {
    display: none;
}
.filter-container {
    display: none; 
}

/* Shop Container */
.shop-container {
    padding: 30px 0;
    background-color: rgba(255, 255, 255, 0.8);
    margin: 30px 0;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.shop-header {
    text-align: center;
    margin-bottom: 30px;
}

.shop-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 15px;
}

.shop-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Search Results Section */
.search-results-section {
    display: none;
    padding: 40px 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    margin: 30px 0;
    backdrop-filter: blur(10px);
}

.search-results-section.active {
    display: block;
}

.search-results-header {
    text-align: center;
    margin-bottom: 30px;
}

.search-results-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 10px;
}

.search-results-count {
    color: #888;
    font-size: 1.1rem;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 50px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    margin: 30px auto;
    max-width: 600px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.no-results i {
    font-size: 3rem;
    color: #e91e63;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #e91e63;
    margin-bottom: 10px;
}

.no-results p {
    color: #888;
}

/* Sections to hide during search */
.non-search-section {
    transition: all 0.3s ease;
}

.search-active .non-search-section {
    display: none !important;
}

/* Subcategory Section */
.subcategory-section {
    margin-bottom: 50px;
}

.subcategory-title {
    text-align: center;
    font-size: 1.8rem;
    color: #e91e63;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.subcategory-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #e91e63, #f06292);
    margin: 10px auto 0;
    border-radius: 2px;
}

.subcategory-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

/* Product Card */
.product-card {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(233, 30, 99, 0.15);
}

.product-img {
    display: block;
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
    background-color: #fff; /* White background for contained images */
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CHANGE: Shows full image without cropping */
    transition: transform 0.5s ease;
    padding: 10px; /* Adds a little spacing around the image inside the container */
    box-sizing: border-box;
}

.product-card:hover .product-img img {
    transform: scale(1.05); /* Slight zoom on hover, but keeps containment */
}

.product-info {
    padding: 20px;
    position: relative;
}

.product-info h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e91e63;
    color: white;
    padding: 6px 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    z-index: 5;
    box-shadow: 0 4px 8px rgba(233, 30, 99, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(233, 30, 99, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0);
    }
}

/* Price Display */
.price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.discounted-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e91e63;
}

.regular-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e91e63;
}

.savings {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 500;
    background: rgba(40, 167, 69, 0.1);
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-block;
}

.price {
    color: #e91e63;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wishlist {
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: #e91e63;
    font-size: 1.5rem;
}

.wishlist:hover {
    color: #d81b60;
    transform: scale(1.2);
}

.add-cart {
    background: linear-gradient(to right, #e91e63, #f06292);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-cart:hover {
    background: linear-gradient(to right, #d81b60, #ec407a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(233, 30, 99, 0.3);
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.ad-banner:hover {
    transform: scale(1.02);
}

.ad-banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Product Modal */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #e91e63;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #e91e63;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: rgba(233, 30, 99, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.modal-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #f8f8f8;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure modal image also fits */
    transition: transform 0.3s ease;
}

.modal-image:hover img {
    transform: scale(1.05);
}

.modal-product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.modal-price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.modal-original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.modal-discounted-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e91e63;
}

.modal-regular-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e91e63;
}

.modal-discount-badge {
    background: #e91e63;
    color: white;
    padding: 5px 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}

.modal-savings {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 500;
    background: rgba(40, 167, 69, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
}

.modal-product-description {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Unit Select Styles */
.modal-actions .form-group {
    margin-bottom: 0;
}
.modal-actions .form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    display: block;
}
.modal-actions .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.modal-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f8f8;
    padding: 10px 15px;
    border-radius: 10px;
}

.modal-quantity label {
    font-weight: 500;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: #e91e63;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background-color: #d81b60;
    transform: scale(1.1);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn-cart {
    background: linear-gradient(to right, #e91e63, #f06292);
    color: white;
}

.modal-btn-cart:hover {
    background: linear-gradient(to right, #d81b60, #ec407a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(233, 30, 99, 0.3);
}

.modal-btn-wishlist {
    background-color: transparent;
    color: #e91e63;
    border: 1px solid #e91e63;
}

.modal-btn-wishlist:hover {
    background-color: rgba(233, 30, 99, 0.1);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    overflow: hidden;
    width: 300px;
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    align-items: center;
    border-left: 4px solid #e91e63;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.toast-content {
    padding: 15px;
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.toast-message {
    font-size: 14px;
    color: #666;
}

.toast-close {
    padding: 15px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.toast-close:hover {
    color: #333;
}

/* Responsive Styles */
@media (max-width: 992px) {
    body {
        padding-top: 140px;
    }
    
    .subcategory-products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 120px;
    }
    
    .shop-header h1 {
        font-size: 2rem;
    }
    
    .subcategory-title {
        font-size: 1.5rem;
    }
    
    .subcategory-products {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        max-width: 400px;
    }
    
    /* Floating button adjustments for mobile */
    .floating-filter-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .floating-search.visible {
        top: 70px;
    }
}

/* =================================================================== */
/* MOBILE FIX: Updated for full image display */
/* =================================================================== */
@media (max-width: 576px) {
    body {
        padding-top: 120px;
    }
    
    .shop-header h1 {
        font-size: 1.8rem;
    }
    
    .subcategory-title {
        font-size: 1.5rem;
    }
    
    /* Mobile Grid Layout */
    .subcategory-products {
        display: grid;
        grid-template-columns: 1fr 1fr; 
        gap: 8px; 
        padding: 0 8px; 
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }
    
    .product-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 8px;
        box-sizing: border-box;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .product-img {
        /* Increased height slightly to accommodate 'contain' images better */
        height: 150px; 
        width: 100%;
        overflow: hidden;
        background-color: #fff;
    }
    
    .product-img img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Ensure full image is shown on mobile */
        padding: 5px; /* Small padding so image doesn't touch edges */
    }
    
    .product-info {
        padding: 8px; 
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    
    .product-info h5 {
        font-size: 0.7rem;
        height: 30px; 
        margin-bottom: 4px;
        line-height: 1.1;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .price-container {
        margin-bottom: 6px;
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .original-price {
        font-size: 0.6rem;
    }
    
    .discounted-price, .regular-price {
        font-size: 0.75rem;
    }
    
    .savings {
        font-size: 0.5rem;
        padding: 1px 2px;
    }
    
    .price {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .product-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 4px;
        margin-top: auto; 
    }
    
    .add-cart {
        padding: 4px 8px;
        font-size: 0.6rem;
        border-radius: 10px;
        flex: 1;
        text-align: center;
        white-space: nowrap; 
    }
    
    .wishlist {
        font-size: 0.8rem;
        padding: 4px;
        flex-shrink: 0; 
    }
    
    .discount-badge {
        padding: 2px 4px;
        font-size: 0.55rem;
        top: 8px;
        left: 8px;
    }
    
    .product-card:hover {
        transform: translateY(-2px);
    }
    
    /* Ensure no horizontal scrolling */
    .shop-container {
        overflow-x: hidden;
        width: 100%;
    }
    
    .subcategory-section {
        width: 100%;
        overflow-x: hidden;
    }
    
    .modal-content {
        width: 95%;
        max-width: 350px;
        margin: 10px auto;
    }

    .modal-image {
        height: 180px;
    }

    .modal-product-name {
        font-size: 16px;
    }

    .modal-product-price {
        font-size: 18px;
    }

    .modal-product-description {
        font-size: 13px;
    }
    
    .search-section {
        padding: 12px 15px;
        margin: 20px auto;
    }
    
    .search-input {
        padding: 10px 40px 10px 15px;
        font-size: 14px;
    }
    
    .search-icon {
        right: 15px;
        font-size: 16px;
    }
}

/* Additional breakpoint for very small screens */
@media (max-width: 400px) {
    .subcategory-products {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 0 4px;
    }
    
    .product-img {
        height: 120px; /* Adjusted for very small screens */
    }
    
    .product-info {
        padding: 6px;
    }
    
    .product-info h5 {
        font-size: 0.65rem;
        height: 28px;
        line-height: 1;
    }
    
    .discounted-price, .regular-price {
        font-size: 0.7rem;
    }
    
    .add-cart {
        padding: 3px 6px;
        font-size: 0.55rem;
    }
    
    .wishlist {
        font-size: 0.7rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}