/* ==================== PRODUCT LAYOUT CONTAINER ==================== */

:root {
    --columns: 3;
    --gap: 20px;
    --primary-color: #018263;
}

.manus-product-layout {
    width: 100%;
    padding: 20px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gap);
    width: 100%;
}

/* ==================== PRODUCT CARD BASE STYLES ==================== */

.product-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: slideInBadge 0.5s ease-out;
}

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

.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.product-button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.product-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(1, 130, 99, 0.3);
}

/* ==================== MODERN CARD STYLE ==================== */

.product-modern-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-modern-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.product-modern-card:hover .product-image {
    transform: scale(1.08);
}

.product-modern-card:hover .product-title {
    color: var(--primary-color);
}

.product-modern-card .product-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* ==================== MINIMALIST STYLE ==================== */

.product-minimalist {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-minimalist:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(1, 130, 99, 0.12);
}

.product-minimalist:hover .product-image {
    transform: scale(1.05);
}

.product-minimalist .product-content {
    padding: 15px;
    background: #fff;
}

.product-minimalist .product-description {
    display: none;
}

.product-minimalist .product-footer {
    flex-direction: column;
    align-items: flex-start;
}

.product-minimalist .product-button {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

/* ==================== GLASSMORPHISM STYLE ==================== */

.product-glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.product-glassmorphism:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(1, 130, 99, 0.3);
    box-shadow: 0 12px 40px rgba(1, 130, 99, 0.2);
    transform: translateY(-6px);
}

.product-glassmorphism:hover .product-image {
    transform: scale(1.06);
}

.product-glassmorphism .product-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.product-glassmorphism .product-title {
    color: #1a1a1a;
}

.product-glassmorphism .product-description {
    color: #555;
}

.product-glassmorphism .product-button {
    background: linear-gradient(135deg, var(--primary-color), #00a878);
    box-shadow: 0 4px 12px rgba(1, 130, 99, 0.3);
}

.product-glassmorphism .product-button:hover {
    box-shadow: 0 8px 20px rgba(1, 130, 99, 0.4);
}

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

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(min(var(--columns), 2), 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(min(var(--columns), 2), 1fr);
        gap: calc(var(--gap) * 0.8);
    }

    .product-card {
        border-radius: 12px;
    }

    .product-content {
        padding: 15px;
    }

    .product-title {
        font-size: 16px;
    }

    .product-description {
        font-size: 13px;
    }

    .product-price {
        font-size: 18px;
    }

    .product-button {
        padding: 8px 16px;
        font-size: 12px;
    }

    .product-badge {
        padding: 6px 12px;
        font-size: 11px;
        top: 10px;
        right: 10px;
    }
}

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

    .product-content {
        padding: 12px;
    }

    .product-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .product-description {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-button {
        padding: 8px 14px;
        font-size: 11px;
    }

    .product-minimalist .product-footer {
        flex-direction: row;
        justify-content: space-between;
    }

    .product-minimalist .product-button {
        width: auto;
        margin-top: 0;
    }
}

/* ==================== RTL SUPPORT ==================== */

[dir="rtl"] .product-badge {
    left: 15px;
    right: auto;
    animation: slideInBadgeRTL 0.5s ease-out;
}

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

[dir="rtl"] .product-footer {
    flex-direction: row-reverse;
}

[dir="rtl"] .product-minimalist .product-footer {
    align-items: flex-end;
}

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

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

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(n+4) {
    animation-delay: calc(0.1s * (var(--index, 1) - 3));
}
