/* Modern Product Card Styles */
:root {
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modern Card Container */
.modern-product-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px; /* Reduced from 400px to reduce whitespace */
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

.modern-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* Image Styles */
.modern-card-image {
    width: 100%;
    height: 250px; /* Increased from 200px to emphasize photo */
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

/* Content Area */
.modern-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.modern-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #333;
}

/* Layout Containers - Flexbox for Grid Stability */
.layout-center,
.layout-left,
.layout-right {
    display: flex;
    flex-wrap: wrap;
}

/* Center (Default/Option 1) */
.layout-center .modern-product-card {
    text-align: center;
}

/* Left (Option 2) */
.layout-left .modern-product-card {
    flex-direction: row;
    min-height: 140px; /* Adjusted to match image height */
    align-items: center;
}

.layout-left .modern-card-image-wrapper {
    flex: 0 0 140px; /* Fixed width, non-growing */
    height: 140px; /* Fixed height for 1:1 square */
    min-height: 140px;
}

.layout-left .modern-card-image {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 16px 0 0 16px;
    object-fit: cover;
}

.layout-left .modern-card-content {
    text-align: left;
}

/* Right (Option 3) */
.layout-right .modern-product-card {
    flex-direction: row-reverse;
    min-height: 140px; /* Adjusted to match image height */
    align-items: center;
}

.layout-right .modern-card-image-wrapper {
    flex: 0 0 140px; /* Fixed width, non-growing */
    height: 140px; /* Fixed height for 1:1 square */
    min-height: 140px;
}

.layout-right .modern-card-image {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 0 16px 16px 0;
    object-fit: cover;
}

.layout-right .modern-card-content {
    text-align: right;
}

/* Typography Updates */
.modern-card-description {
    font-size: 1.2rem; /* Increased from 0.9rem */
    color: #555;
    margin-bottom: 8px; /* Reduced vertical space slightly */
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */
/* Anchor Wrapper */
.modern-product-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none !important;
}

/* Column Wrapper for Spacing */
.modern-product-wrapper {
    margin-bottom: 18px;
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* FORCE Side-by-Side for Left/Right layouts on mobile */
    
    /* LEFT Layout Mobile */
    .layout-left .modern-product-card {
        flex-direction: row !important;
        text-align: left !important;
        min-height: auto !important; /* Remove fixed height constraint */
        align-items: center !important; /* Center vertically */
    }
    
    .layout-left .modern-card-image-wrapper {
        flex: 0 0 120px !important; /* Fixed width */
        width: 120px !important;
        max-width: 120px !important;
        height: 120px !important; /* Fixed height for 1:1 */
        min-height: 120px !important;
        align-self: center; /* Center image within the card */
    }
    
    .layout-left .modern-card-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        border-radius: 16px 0 0 16px !important;
        object-fit: cover !important;
        max-width: none !important;
    }

    /* RIGHT Layout Mobile */
    .layout-right .modern-product-card {
        flex-direction: row-reverse !important;
        text-align: right !important;
        min-height: auto !important;
        align-items: center !important;
    }

    .layout-right .modern-card-image-wrapper {
        flex: 0 0 120px !important;
        width: 120px !important;
        max-width: 120px !important;
        height: 120px !important; /* Fixed height for 1:1 */
        min-height: 120px !important;
        align-self: center;
    }

    .layout-right .modern-card-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        border-radius: 0 16px 16px 0 !important;
        object-fit: cover !important;
        max-width: none !important;
    }
    
    /* Content adjustments */
    .layout-left .modern-card-content,
    .layout-right .modern-card-content {
        padding: 12px;
        text-align: inherit;
        flex: 1; /* Take remaining space */
    }
    
    .modern-card-title {
        margin-bottom: 4px;
        margin-top: 0;
    }
    
    .modern-card-description {
        font-size: 1.2rem; /* Increased as requested */
        -webkit-line-clamp: 3; /* Increased to 3 lines to fit more text with larger font if needed, or keep 2 */
        line-clamp: 3;
        margin-bottom: 8px;
        color: #555; /* Ensure color is visible */
    }
    
    .modern-card-price {
        font-size: 1.4rem;
        margin-top: auto;
        font-weight: bold;
    }
}

/* Details Page Styles */
.product-details-modern {
    padding: 24px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.product-details-header {
    margin-bottom: 24px;
}

.modern-option-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.modern-option-item {
    position: relative;
    cursor: pointer;
}

.modern-option-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.modern-option-label {
    padding: 12px 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    display: block;
    transition: all 0.2s;
    font-weight: 500;
    user-select: none;
}

.modern-option-item input:checked + .modern-option-label {
    border-color: currentColor; /* Uses text color which allows primary color inheritance */
    background: rgba(0,0,0,0.03);
    color: inherit;
    font-weight: 700;
    user-select: none;
}

.modern-quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #f3f3f3;
    padding: 8px;
    border-radius: 50px;
    width: fit-content;
    margin: 0 auto;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

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

.modern-add-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.modern-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
