/**
 * Fowler Meat & Fish - WooCommerce Custom Styles
 * Creates a DoorDash-like shopping experience
 */

/* General Shop Styling */
.woocommerce-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.shop-content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Delivery Banner */
.delivery-banner {
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.delivery-banner-inner {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    gap: 1.5rem;
}

.delivery-icon {
    font-size: 2rem;
    color: #00a04a;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(0,160,74,0.1);
    border-radius: 50%;
}

.delivery-info {
    flex: 1;
}

.delivery-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1.2rem;
}

.delivery-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.delivery-action {
    text-align: right;
}

.check-delivery-btn {
    display: inline-block;
    background: #d62329;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.check-delivery-btn:hover {
    background: #00a04a;
    text-decoration: none;
    color: white;
}

/* Filter Toggle for Mobile */
.filter-toggle {
    display: none;
    width: 100%;
    padding: 0.8rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle.active {
    background: #00a04a;
    color: white;
    border-color: #00a04a;
}

/* Product Grid */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce ul.products li.product {
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
}

.product-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.woocommerce ul.products li.product a img {
    margin: 0 0 1rem 0;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
}

.product-card:hover .woocommerce-loop-product__title {
    color: #00a04a;
}

/* Product Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1rem;
    padding: 0;
    margin: 0 0 0.5rem 0;
    color: #333;
    transition: color 0.2s;
}

/* Product Price */
.woocommerce ul.products li.product .price {
    color: #d62329;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.woocommerce ul.products li.product .price del {
    color: #999;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}

/* Product Badges */
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.sale-badge {
    background: #d62329;
    color: white;
}

.new-badge {
    background: #00a04a;
    color: white;
}

/* Product Meta */
.product-weight-volume {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

.delivery-estimate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #00a04a;
    margin-top: 0.8rem;
}

/* Product Actions */
.product-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
}

.quick-view-btn,
.add-to-cart-btn {
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.quick-view-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.quick-view-btn:hover {
    background: #eee;
}

.add-to-cart-btn {
    background: #00a04a;
    color: white;
    border: none;
}

.add-to-cart-btn:hover {
    background: #008a3f;
    color: white;
    text-decoration: none;
}

/* Loading State */
.add-to-cart-btn.loading {
    position: relative;
    color: transparent;
}

.add-to-cart-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.add-to-cart-btn.added {
    background: #00a04a;
}

.add-to-cart-btn.added::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    color: white;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Quick View Modal */
.quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
}

.quick-view-loader {
    color: white;
    font-size: 2rem;
}

.quick-view-modal {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.quick-view-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}

.quick-view-close:hover {
    background: #ddd;
}

.quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.quick-view-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.quick-view-details h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.quick-view-price {
    font-size: 1.3rem;
    color: #d62329;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quick-view-description {
    margin-bottom: 1.5rem;
    color: #666;
}

.quick-view-meta {
    margin-bottom: 1.5rem;
}

.quick-view-weight {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.quick-view-delivery {
    color: #00a04a;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-view-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-minus,
.quantity-plus {
    width: 36px;
    height: 36px;
    background: #f8f9fa;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-minus:hover,
.quantity-plus:hover {
    background: #eee;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 1rem;
}

.quick-view-actions .add-to-cart-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9998;
    animation: slideIn 0.3s forwards;
}

.cart-notification-icon {
    font-size: 1.5rem;
    color: #00a04a;
}

.cart-notification-message strong {
    display: block;
    margin-bottom: 0.2rem;
}

.cart-notification-message p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Floating Cart Button */
.floating-cart-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 9997;
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.floating-cart-button.has-items {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.floating-cart-button a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: #333;
    text-decoration: none;
    gap: 1rem;
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    color: #00a04a;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d62329;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cart-label {
    font-size: 0.8rem;
    color: #666;
}

.cart-total {
    font-weight: 600;
}

.cart-arrow {
    color: #999;
}

.floating-cart-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.floating-cart-button.pulse {
    animation: pulse 1s;
}

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

/* Checkout Customization */
.delivery-time-selection {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.delivery-time-selection h3 {
    margin-top: 0;
    color: #00a04a;
    font-size: 1.2rem;
}

.delivery-date-field,
.delivery-time-field {
    margin-bottom: 1rem;
}

.woocommerce-checkout #payment {
    background: #f8f9fa;
    border-radius: 8px;
}

.woocommerce-checkout #payment div.payment_box {
    background: white;
}

.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: white;
}

.woocommerce #respond input#submit.alt, 
.woocommerce a.button.alt, 
.woocommerce button.button.alt, 
.woocommerce input.button.alt {
    background-color: #00a04a;
}

.woocommerce #respond input#submit.alt:hover, 
.woocommerce a.button.alt:hover, 
.woocommerce button.button.alt:hover, 
.woocommerce input.button.alt:hover {
    background-color: #008a3f;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .shop-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .widget-area {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        z-index: 9998;
        padding: 2rem;
        overflow-y: auto;
    }
    
    .widget-area.active {
        display: block;
    }
    
    .widget-area .widget {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .filter-toggle {
        display: block;
    }
    
    .quick-view-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .delivery-banner-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .delivery-action {
        margin-top: 1rem;
        text-align: center;
        width: 100%;
    }
    
    .check-delivery-btn {
        width: 100%;
    }
    
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .woocommerce ul.products li.product a img {
        height: 140px;
    }
    
    .product-card-actions {
        grid-template-columns: 1fr;
    }
    
    .cart-notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .floating-cart-button {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .floating-cart-button a {
        justify-content: space-between;
    }
}
