/* ===============================================
   ECOFERT GHANA - SHOP PAGE STYLING
   Modern E-commerce Design with Green, Yellow, White Theme
   =============================================== */

/* CSS Variables (inheriting from main.css) */
:root {
    /* Primary Colors */
    --primary-green: #2e7d32;
    --primary-green-dark: #1b5e20;
    --primary-green-light: #4caf50;
    --secondary-yellow: #ffeb3b;
    --secondary-yellow-dark: #f57f17;
    --secondary-yellow-light: #fff176;
    --pure-white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e8f5e8;
    
    /* Neutral Colors */
    --text-dark: #1a1a1a;
    --text-medium: #424242;
    --text-light: #666666;
    --border-light: #e0e0e0;
    
    /* Gradients */
    --green-gradient: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    --yellow-gradient: linear-gradient(135deg, var(--secondary-yellow) 0%, var(--secondary-yellow-light) 100%);
    --hero-gradient: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 50%, var(--secondary-yellow) 100%);
    --card-gradient: linear-gradient(145deg, var(--pure-white) 0%, var(--light-gray) 100%);
    
    /* Shadows */
    --shadow-light: 0 2px 10px rgba(46, 125, 50, 0.1);
    --shadow-medium: 0 4px 20px rgba(46, 125, 50, 0.15);
    --shadow-heavy: 0 8px 30px rgba(46, 125, 50, 0.2);
    --shadow-card: 0 6px 25px rgba(46, 125, 50, 0.12);
    --shadow-hover: 0 12px 40px rgba(46, 125, 50, 0.25);
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ===============================================
   SHOP PAGE LAYOUT
   =============================================== */

.shop-container {
    margin-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 80px);
    background: var(--pure-white);
}

/* ===============================================
   SHOP HERO SECTION
   =============================================== */

.shop-hero {
    background: var(--hero-gradient);
    padding: 4rem 0;
    text-align: center;
    color: var(--pure-white);
    position: relative;
    overflow: hidden;
}

.shop-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="shop-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23shop-grain)"/></svg>');
    opacity: 0.4;
}

.shop-hero h1 {
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.shop-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* ===============================================
   SHOP CONTENT LAYOUT
   =============================================== */

.shop-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 20px;
    min-height: 70vh;
}

/* ===============================================
   SHOP SIDEBAR
   =============================================== */

.shop-sidebar {
    background: var(--card-gradient);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid var(--border-light);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-green);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-medium);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition-smooth);
    font-weight: var(--font-weight-medium);
    position: relative;
}

.category-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--green-gradient);
    border-radius: 10px;
    transition: var(--transition-smooth);
    z-index: -1;
}

.category-list a:hover::before,
.category-list a.active::before {
    width: 100%;
}

.category-list a:hover,
.category-list a.active {
    color: var(--pure-white);
    transform: translateX(5px);
}

/* Price Range */
.price-range {
    padding: 1rem 0;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--light-gray);
    outline: none;
    margin: 1rem 0;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-gradient);
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-medium);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-gradient);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-light);
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-weight: var(--font-weight-medium);
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* ===============================================
   PRODUCTS SECTION
   =============================================== */

.products-grid {
    background: var(--light-gray);
    border-radius: 20px;
    padding: 2rem;
    min-height: 500px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.sort-options span {
    font-weight: var(--font-weight-medium);
    color: var(--text-medium);
}

#sortBy {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--pure-white);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

#sortBy:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* ===============================================
   PRODUCT CARDS
   =============================================== */

.product-card {
    background: var(--card-gradient);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    border: 1px solid rgba(46, 125, 50, 0.1);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green-gradient);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition-smooth);
    filter: brightness(1) contrast(1);
}

.product-card:hover .product-image {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    display: inline-block;
    background: var(--secondary-yellow);
    color: var(--primary-green);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-green);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.product-description {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

/* ===============================================
   PRODUCT ACTIONS
   =============================================== */

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--light-gray);
    border-radius: 25px;
    padding: 0.5rem;
    width: fit-content;
    margin: 0 auto;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: var(--green-gradient);
    color: var(--pure-white);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary-green-dark);
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    font-size: 1rem;
}

.quantity-input:focus {
    outline: none;
}

.btn-add-to-cart {
    background: var(--green-gradient);
    color: var(--pure-white);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-smooth);
}

.btn-add-to-cart:hover::before {
    left: 100%;
}

.btn-add-to-cart:hover {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-add-to-cart:active {
    transform: translateY(0);
}

/* ===============================================
   CART ICON IN HEADER
   =============================================== */

.cart-icon {
    position: relative;
}

.cart-icon a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.cart-count {
    background: var(--secondary-yellow);
    color: var(--primary-green);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    position: absolute;
    top: -8px;
    right: -8px;
    animation: pulse 2s infinite;
}

/* ===============================================
   CART SIDEBAR
   =============================================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--card-gradient);
    box-shadow: var(--shadow-heavy);
    transition: var(--transition-smooth);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--green-gradient);
    color: var(--pure-white);
}

.cart-header h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    color: var(--pure-white);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-cart:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    animation: slideInRight 0.3s ease-out;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
}

.cart-item-actions {
    display: flex;
    gap: 0.5rem;
}

.remove-item {
    background: #ff5252;
    color: var(--pure-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.remove-item:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.empty-cart-message {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--light-gray);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.btn-checkout {
    width: 100%;
    background: var(--yellow-gradient);
    color: var(--primary-green);
    border: none;
    padding: 1rem;
    border-radius: 25px;
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-checkout:hover {
    background: var(--secondary-yellow-dark);
    color: var(--pure-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 999;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===============================================
   NO PRODUCTS MESSAGE
   =============================================== */

.no-products {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 3rem;
    grid-column: 1 / -1;
}

/* ===============================================
   ANIMATIONS
   =============================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 1024px) {
    .shop-content {
        grid-template-columns: 250px 1fr;
        gap: 2rem;
    }
    
    .products {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Shop Hero Mobile */
    .shop-hero h1 {
        font-size: 2.5rem;
    }
    
    .shop-hero p {
        font-size: 1rem;
    }
    
    /* Shop Content Mobile */
    .shop-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 20px;
    }
    
    .shop-sidebar {
        position: static;
        order: 2;
    }
    
    .products-grid {
        order: 1;
        padding: 1.5rem;
    }
    
    .products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    /* Cart Sidebar Mobile */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .shop-hero h1 {
        font-size: 2rem;
    }
    
    .products {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        margin: 0 10px;
    }
    
    .shop-sidebar {
        padding: 1.5rem;
    }
    
    .products-grid {
        padding: 1rem;
    }
    
    .sort-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid var(--secondary-yellow);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #1b5e20;
        --secondary-yellow: #ffc107;
        --text-dark: #000000;
        --text-medium: #333333;
    }
}

/* Print styles */
@media print {
    .shop-hero {
        background: none !important;
        color: #000 !important;
    }
    
    .cart-sidebar,
    .cart-overlay {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .shop-sidebar {
        display: none !important;
    }
    
    .shop-content {
        grid-template-columns: 1fr;
    }
}

/* ===============================================
   LOADING STATES
   =============================================== */

.product-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* ===============================================
   HOVER STATES FOR TOUCH DEVICES
   =============================================== */

@media (hover: none) {
    .product-card:hover {
        transform: none;
        box-shadow: var(--shadow-card);
    }
    
    .btn-add-to-cart:hover {
        transform: none;
        box-shadow: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .btn-add-to-cart:active {
        transform: scale(0.95);
    }
}

/* ===============================================
   NOTIFICATION STYLES (Enhanced)
   =============================================== */

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--green-gradient);
    color: var(--pure-white);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-heavy);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1100;
    max-width: 350px;
    font-weight: var(--font-weight-medium);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary-yellow);
    border-radius: 15px 15px 0 0;
}

.notification.error::before {
    background: #ffeb3b;
}
