/* =========================================
   1. GLOBAL STYLES & LUXURY VARIABLES
   ========================================= */
:root {
    --primary-color: #111111;       /* Deep Black */
    --accent-color: #C0A062;        /* Gold */
    --secondary-color: #333333;     /* Dark Grey */
    --bg-color: #FAFAFA;            /* Off-White */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    color: var(--primary-color); 
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased; 
}

.shop-container {
    max-width: 1400px;
    margin: 0 auto; 
    padding-top: 40px; 
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 60px;
    display: block; 
    background-color: var(--bg-color); 
}

/* =========================================
   HEADER & FILTERS
   ========================================= */
.shop-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0px;
}

/* Animated Underline */
.highlight {
    color: var(--accent-color);
    position: relative;
    display: inline-block;
    z-index: 1;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    animation: underline-loop 2.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    z-index: -1;
    opacity: 0.8;
}

@keyframes underline-loop {
    0% { transform-origin: bottom left; transform: scaleX(0); }
    50% { transform-origin: bottom left; transform: scaleX(1); }
    51% { transform-origin: bottom right; transform: scaleX(1); }
    100% { transform-origin: bottom right; transform: scaleX(0); }
}

.sub-title {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-top: 10px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* Search By Category Toggle */
.category-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.category-toggle-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 2px solid transparent; 
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.category-toggle-btn:hover { color: var(--accent-color); }

.toggle-icon {
    font-size: 14px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-toggle-btn.active .toggle-icon { transform: rotate(180deg); }
.category-toggle-btn.active { color: var(--accent-color); }

/* Filter Dropdown */
.filter-dropdown {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: 
        max-height 0.6s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.4s ease-out,
        transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
}

.filter-dropdown.open {
    max-height: 350px; 
    opacity: 1;
    transform: translateY(0);
    margin-top: 20px;
}

.filter-wrapper-outer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.filter-container {
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px; 
    padding: 20px; 
}

/* Category Card Style */
.filter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 130px; 
    height: 150px; 
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.filter-card:hover {
    transform: translateY(-8px);
    box-shadow: 5px 5px 0px var(--primary-color);
    border-color: var(--primary-color);
}

.card-image-area {
    width: 100%;
    height: 72%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
}

.card-image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    filter: grayscale(20%);
}

.filter-card:hover .card-image-area img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.card-color-bar {
    width: 100%;
    height: 3px;
    background-color: var(--accent-color, #111); 
    transform: scaleX(0.8);
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.filter-card:hover .card-color-bar { transform: scaleX(1); }

.card-label {
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--primary-color);
    background: #fff;
    letter-spacing: 1px;
    padding-bottom: 2px;
}

.filter-card.active {
    border-color: var(--primary-color);
    box-shadow: 5px 5px 0px var(--accent-color);
    transform: translateY(-5px);
}

/* =========================================
   2. PRODUCT GRID & CARD DESIGN
   ========================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; 
    width: 100%;
    min-height: 0; /* Reduced from 400px to remove gap */
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #aaa;
}
.no-results i { font-size: 50px; margin-bottom: 20px; color: var(--accent-color); }

.product-card { 
    background: white; 
    border: 1px solid var(--primary-color); 
    border-radius: 4px; 
    padding: 20px; 
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    overflow: hidden; 
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 6px 6px 0px var(--accent-color); 
    border-color: var(--primary-color);
}

.hidden-card { opacity: 0; transform: translateY(40px) scale(0.98); pointer-events: none; }
.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.pagination-hidden { display: none !important; }

/* Badge */
.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    font-weight: 700;
    font-size: 11px;
    padding: 5px 14px;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.1);
    letter-spacing: 1px;
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 60%; 
    margin-bottom: 15px;
    border-radius: 0;
    overflow: hidden;
}

.product-image img { 
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; transition: opacity 0.4s ease-in-out, transform 0.5s ease;
}

.img-hover { opacity: 0; object-fit: cover !important; }
.product-card:hover .img-hover { opacity: 1; transform: scale(1.05); }
.product-card:hover .img-main { opacity: 0; }

.product-info h3 { 
    font-family: var(--font-heading);
    font-size: 20px; margin: 10px 0 8px 0; font-weight: 700; 
    text-transform: uppercase; line-height: 1.2; color: var(--primary-color); 
    letter-spacing: 0.5px;
}

.reviews { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; line-height: 1; }

.stars { 
    color: var(--accent-color) !important;
    font-size: 14px; 
    display: flex; 
    gap: 2px; 
    margin: 0; 
    padding: 0; 
}
.stars i { color: var(--accent-color) !important; }

.review-count { font-size: 13px; color: #666; font-weight: 400; position: relative; top: -1px; font-family: var(--font-body); }

.product-type {
    display: flex; align-items: center; gap: 10px; font-weight: 600;
    font-size: 12px; color: var(--primary-color); margin-bottom: 15px; text-transform: uppercase;
    letter-spacing: 1px;
}

.price-row { 
    position: relative; height: 45px; display: flex; 
    justify-content: space-between; align-items: center; margin-top: auto;
}

.price-wrap { display: flex; align-items: baseline; gap: 10px; transition: opacity 0.2s ease; }
.product-card:hover .price-wrap { opacity: 0; visibility: hidden; }

.price { font-family: var(--font-heading); font-size: 24px; font-weight: 700; color: var(--primary-color); }
.old-price { font-size: 14px; color: #a0a0a0; text-decoration: line-through; font-weight: 400; font-family: var(--font-body); }

/* Buttons */
.add-btn { 
    position: absolute; right: 0; 
    background-color: var(--accent-color);
    border: 2px solid var(--primary-color); 
    color: var(--primary-color); 
    width: 40px; height: 40px; border-radius: 50%; 
    cursor: pointer; display: flex; align-items: center; justify-content: center; 
    padding: 0; box-shadow: 2px 2px 0px var(--primary-color);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); overflow: hidden; z-index: 2;
    text-decoration: none !important;
}

.add-btn * { text-decoration: none !important; }

.btn-text {
    white-space: nowrap; opacity: 0; font-weight: 700; font-size: 13px;
    max-width: 0; margin: 0; overflow: hidden; transition: all 0.4s ease;
    font-family: var(--font-body); letter-spacing: 1px;
    color: var(--accent-color); 
    text-decoration: none !important;
}

.add-btn i { font-size: 16px; transition: transform 0.3s ease; opacity: 1; visibility: visible; margin: 0; }

.product-card:hover .add-btn { 
    width: 100%; border-radius: 30px; 
    background-color: var(--primary-color);
    color: var(--accent-color); 
    box-shadow: 4px 4px 0px var(--accent-color); 
    text-decoration: none !important;
}

.product-card:hover .btn-text { opacity: 1; max-width: 200px; margin-right: 8px; }
.product-card:hover .add-btn i.fa-plus { transform: rotate(90deg); }
.product-card:hover .add-btn i.fa-amazon { transform: rotate(0deg); } 

.add-btn.disabled-btn {
    background-color: #f0f0f0 !important; border-color: #ccc !important;
    color: #999 !important; cursor: not-allowed !important; box-shadow: none !important;
}
.product-card:hover .add-btn.disabled-btn {
    width: 100% !important; background-color: #e0e0e0 !important; color: #888 !important; box-shadow: none !important;
}
.add-btn.disabled-btn .btn-text { color: #888 !important; }

/* Pagination */
.pagination-wrapper { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
    margin-top: 70px; /* :::: MATCHED HEADER MARGIN (70px) :::: */
    width: 100%; 
}
.page-btn {
    background-color: white; color: var(--primary-color); border: 1px solid var(--primary-color);
    padding: 10px 25px; font-family: var(--font-body);
    font-weight: 600; font-size: 13px; border-radius: 30px;
    cursor: pointer; box-shadow: 2px 2px 0px var(--primary-color);
    transition: all 0.2s ease; display: flex; align-items: center; gap: 8px;
    letter-spacing: 1px;
}
.page-btn:hover:not(:disabled) { background-color: var(--accent-color); transform: translateY(-2px); box-shadow: 4px 4px 0px var(--primary-color); }
.page-btn:active:not(:disabled) { transform: translateY(0); box-shadow: 1px 1px 0px var(--primary-color); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; background-color: #eee; border-color: #ccc; box-shadow: none; }
.page-info { font-weight: 700; font-size: 16px; color: var(--primary-color); letter-spacing: 1px; font-family: var(--font-heading); }

/* =========================================
   3. RESPONSIVE DESIGN (FIXED)
   ========================================= */
/* Tablet (< 1024px) */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Landscape / Large Phone (< 768px) */
@media (max-width: 768px) {
    .shop-header { margin-bottom: 30px; }
    .main-title { font-size: 32px; }
    
    .filter-wrapper-outer {
        justify-content: flex-start; width: 100vw; margin-left: -20px; padding-left: 20px; 
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 20px; 
    }
    
    .filter-wrapper-outer::-webkit-scrollbar { display: none; } 

    .filter-container { display: flex; flex-wrap: nowrap; gap: 15px; padding-right: 20px; }

    .filter-card {
        flex: 0 0 auto; 
        width: 110px;
        height: 130px;
    }
    
    .card-label { font-size: 11px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .product-card { padding: 15px; }
    .price { font-size: 20px; }
    
    /* :::: MATCHED HEADER MARGIN (30px) :::: */
    .pagination-wrapper { gap: 10px; margin-top: 30px; }
    .page-btn { padding: 8px 15px; font-size: 12px; }
}

/* :::: MOBILE VIEW FIX: 2 COLUMNS SIDE-BY-SIDE :::: */
@media (max-width: 480px) {
    .shop-container { padding-left: 10px; padding-right: 10px; }
    
    .product-grid { 
        grid-template-columns: repeat(2, 1fr) !important; /* Forces 2 columns */
        gap: 8px !important; /* Even Smaller gap */
        align-items: start !important; /* :::: FIX: কার্ডগুলো এখন আর টেনে লম্বা হবে না, কন্টেন্ট অনুযায়ী সাইজ হবে :::: */
        min-height: 0 !important;
    }
    
    .product-card {
        padding: 8px !important; /* Compact padding */
        justify-content: flex-start !important; /* Pack items to top to remove gaps */
        height: auto !important; /* Let height be natural */
        min-height: 0 !important; /* Ensure no minimum height forces space */
        margin-bottom: 0 !important;
    }
    
    .product-image {
        padding-top: 65% !important; /* Reduced from 100% to remove white space for landscape items */
        margin-bottom: 6px !important;
    }
    
    .main-title { font-size: 24px; }
    .sub-title { font-size: 12px; margin-bottom: 20px; }
    
    /* Font Sizing for Mobile */
    .product-info h3 { 
        font-size: 11px !important; 
        margin: 0 0 4px 0 !important; /* Reduced margin */
        height: auto !important; /* Remove fixed height constraint to shrink fit */
        min-height: 0 !important;
        overflow: hidden;
        line-height: 1.2 !important;
    }
    
    .badge {
        font-size: 8px; padding: 3px 8px; top: 8px; left: 8px;
    }
    
    .product-type { display: none; } /* Hide type on mobile to save space */
    .reviews { display: none; } /* Hide stars/reviews on mobile grid */
    
    .price-row {
        margin-top: 2px !important; /* Minimal gap before price */
        height: auto !important; /* Remove fixed height */
        padding-bottom: 0 !important;
    }

    .price { font-size: 13px !important; }
    .old-price { font-size: 10px !important; }
    
    /* Add Button Compact */
    .add-btn { 
        width: 28px !important; 
        height: 28px !important; 
        position: static !important; /* Flow naturally in price row */
        margin-left: auto; /* Push to right */
    }
    .add-btn i { font-size: 10px !important; }
    
    /* Hide the "ADD TO CART" expanding text on mobile to keep it clean */
    .product-card:hover .btn-text { display: none; }
    .product-card:hover .add-btn { width: 28px !important; border-radius: 50% !important; }

    /* Compact Pagination for Mobile */
    /* :::: MATCHED HEADER MARGIN (40px) :::: */
    .pagination-wrapper { margin-top: 40px !important; gap: 5px !important; }
}