:root {
    --wf-primary: #ff4757;
    --wf-secondary: #2f3542;
    --wf-text: #2f3542;
    --wf-light: #f1f2f6;
    --wf-white: #ffffff;
    --wf-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --wf-radius: 8px;
}

.woofree-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    padding: 0;
}

.woofree-product-card {
    background: var(--wf-white);
    border-radius: var(--wf-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
}

.woofree-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.woofree-product-image {
    position: relative;
    overflow: hidden;
}

.woofree-product-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.woofree-product-card:hover .woofree-product-image img {
    transform: scale(1.05);
}

.wf-placeholder-img {
    width: 100%;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wf-light);
    color: #ccc;
}

/* Badges */
.wf-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}

.wf-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wf-badge-promo {
    background: var(--wf-primary);
    color: #fff;
}

.wf-badge-oos {
    background: #2f3542;
    color: #fff;
}

.woofree-product-link {
    text-decoration: none;
    color: var(--wf-text);
}

/* Product Info */
.woofree-product-info {
    padding: 14px 16px 6px;
}

.wf-card-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.woofree-product-card .woofree-product-title {
    font-size: 1rem;
    padding: 4px 0;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woofree-product-card .woofree-product-price {
    padding: 0 0 8px;
    font-size: 1.05rem;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.woofree-product-card .wf-price-old {
    text-decoration: line-through;
    color: #bbb;
    font-size: 0.85rem;
    font-weight: normal;
}

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

/* Actions */
.woofree-product-actions {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: auto;
}

.woofree-add-to-cart {
    width: 100%;
    background: var(--wf-secondary);
    color: white;
    border: none;
    padding: 11px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.woofree-add-to-cart:hover {
    background: var(--wf-primary);
}

.woofree-oos-label {
    display: block;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    padding: 10px;
}


/* Single Product */
.woofree-product-layout {
    display: flex;
    gap: 50px;
    margin-bottom: 50px;
}

.woofree-product-gallery {
    flex: 1;
}

.woofree-product-summary {
    flex: 1;
}

.woofree-product-gallery img {
    width: 100%;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
}

.woofree-qty {
    width: 60px;
    padding: 10px;
    border: 1px solid var(--wf-light);
    border-radius: 4px;
    margin-right: 10px;
}

.woofree-add-to-cart-btn {
    background: var(--wf-primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Cart Drawer & Overlay */
.woofree-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.woofree-cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--wf-white);
    z-index: 9999;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.woofree-cart-drawer.open {
    right: 0;
}

.woofree-mini-cart {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.woofree-mini-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--wf-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.woofree-mini-cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.woofree-close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wf-text);
}

.woofree-mini-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.woofree-mini-cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.woofree-mini-cart-item .item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

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

.woofree-mini-cart-item .item-title {
    margin: 0 0 5px;
    font-size: 0.9rem;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wf-light);
    padding: 2px 8px;
    border-radius: 20px;
}

.wf-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.item-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
}

.woofree-mini-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--wf-light);
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.woofree-checkout-btn {
    display: block;
    width: 100%;
    background: var(--wf-secondary);
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 15px;
    border-radius: var(--wf-radius);
    font-weight: bold;
}

@media (max-width: 480px) {
    .woofree-cart-drawer {
        width: 100%;
        right: -100%;
    }
}

/* Responsive breakpoints (§13.4) */
@media (max-width: 768px) {
    .woofree-product-layout {
        flex-direction: column;
    }
    .woofree-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .woofree-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility: minimum touch target 44px (§13.4) */
.woofree-add-to-cart,
.woofree-add-to-cart-btn,
.woofree-checkout-btn,
.wf-qty-btn {
    min-height: 44px;
}

/* Dark Mode support (§13.3) */
@media (prefers-color-scheme: dark) {
    :root {
        --wf-primary: #ff6b81;
        --wf-secondary: #dfe4ea;
        --wf-text: #f1f2f6;
        --wf-light: #2f3542;
        --wf-white: #1e272e;
        --wf-shadow: 0 4px 6px rgba(0,0,0,0.3);
    }

    body {
        background-color: #1e272e;
        color: #f1f2f6;
    }

    .woofree-product-link {
        color: #f1f2f6;
    }

    .woofree-mini-cart-footer {
        background: #2f3542;
    }

    .woofree-cart-overlay {
        background: rgba(0,0,0,0.7);
    }

    .woofree-close-cart {
        color: #f1f2f6;
    }

    .item-remove {
        color: #666;
    }

    .woofree-out-of-stock {
        color: #ff4757;
    }
}
