/**
 * Kassesalg Frontend Styling - Updated to Match Mix Tilbud Style
 */

/* Import fonts like in mix-tilbud */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Poppins:wght@300;400;500;600&display=swap');

/* Kassesalg grid layout */
.kassesalg_products_grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 products per row like mix-tilbud */
    gap: 20px;
    margin: 30px 0;
}

.kassesalg_product_item {
    /* Remove flex to use grid layout */
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease forwards; /* Add animation like mix-tilbud */
}

/* Animation delays like in mix-tilbud */
.kassesalg_product_item:nth-child(2) {
    animation-delay: 0.1s;
}

.kassesalg_product_item:nth-child(3) {
    animation-delay: 0.2s;
}

.kassesalg_product_item:nth-child(4) {
    animation-delay: 0.3s;
}

.kassesalg_product_item:nth-child(5) {
    animation-delay: 0.4s;
}

.kassesalg_product_item:nth-child(n+6) {
    animation-delay: 0.5s;
}

.kassesalg_product_inner {
    border: 1px solid #eee;
    border-radius: 12px; /* Rounder corners like mix-tilbud */
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px; /* Add padding like mix-tilbud */
}

.kassesalg_product_item:hover .kassesalg_product_inner {
    transform: translateY(-3px); /* Match mix-tilbud hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.kassesalg_product_image {
    position: relative;
    height: 160px; /* Fixed height like mix-tilbud */
    margin-bottom: 15px;
    padding-top: 0; /* Remove aspect ratio padding */
    overflow: hidden;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.kassesalg_product_image img {
    /* Remove absolute positioning */
    width: 100%;
    height: 100%;
    object-fit: contain; /* Use contain instead of cover for better product visibility */
    transition: transform 0.4s ease;
}

.kassesalg_product_item:hover .kassesalg_product_image img {
    transform: scale(1.05);
}

.kassesalg_product_details {
    padding: 0; /* Remove padding since we added it to inner container */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kassesalg_product_title {
    font-family: "korolev", sans-serif;
    font-size: 14px;
    margin: 0 0 8px;
    font-weight: 500;
    line-height: 1.3;
    text-transform: uppercase; /* Match text transform */
    color: #000;
}

.kassesalg_product_price {
    font-family: "korolev", sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #000;
}

.kassesalg_product_price del {
    font-weight: normal;
    opacity: 0.7;
    margin-right: 5px;
}

.kassesalg_product_price ins {
    text-decoration: none;
    color: #d53a3a;
}

.kassesalg_product_excerpt {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #666;
}

.kassesalg_product_actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px; /* Add padding top */
    border-top: 1px solid #f0f0f0; /* Add separator like mix-tilbud */
}

.kassesalg_info_button,
.kassesalg_add_to_cart {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kassesalg_info_button {
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #ddd;
}

.kassesalg_info_button:hover {
    background-color: #ebebeb;
}

.kassesalg_add_to_cart {
    background-color: #8c7131; /* Use gold color from mix-tilbud */
    color: #fff !important;
    border: none;
    text-decoration: none !important;
}

.kassesalg_add_to_cart:hover {
    background-color: #000; /* Hover to black like mix-tilbud */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Animation for products like mix-tilbud */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal styling - keep the original but style it like mix-tilbud */
#kassesalg_modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45); /* Match mix-tilbud opacity */
    overflow-y: auto;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px); /* Add blur effect like mix-tilbud */
}

#kassesalg_modal.open {
    display: flex;
}

.kassesalg_modal_content {
    background-color: #fff;
    border-radius: 15px; /* Rounder corners like mix-tilbud */
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 5px 15px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: kassesalgModalIn 0.5s cubic-bezier(0.33, 1, 0.68, 1); /* Match mix-tilbud animation */
}

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

.kassesalg_modal_close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #8c7131; /* Match gold color */
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.kassesalg_modal_close:hover {
    background-color: #8c7131;
    color: white;
    transform: rotate(90deg);
}

.kassesalg_modal_inner {
    padding: 30px; /* Match mix-tilbud padding */
}

#kassesalg_modal_loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.kassesalg_modal_product {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.kassesalg_modal_product_main {
    display: flex;
    flex-wrap: wrap;
    gap: 40px; /* Increased gap like mix-tilbud */
}

.kassesalg_modal_product_image {
    flex: 0 0 35%; /* Match mix-tilbud ratio */
    max-width: 35%;
    border-radius: 10px; /* Rounder corners */
    overflow: hidden;
}

.kassesalg_modal_product_image img {
    width: 100%;
    height: auto;
    border-radius: 0; /* Remove inner radius */
    transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1); /* Add transition */
    padding: 15px;
    background-color: #f9f9f9;
    object-fit: contain;
}

.kassesalg_modal_product:hover .kassesalg_modal_product_image img {
    transform: scale(1.04); /* Add hover effect */
}

.kassesalg_modal_product_info {
    flex: 0 0 calc(65% - 40px); /* Match mix-tilbud ratio */
    min-width: 250px;
}

.kassesalg_modal_product_title {
    font-family: "korolev", sans-serif;
    font-size: 32px;
    margin: 0 0 15px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
}

.kassesalg_modal_product_price {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #8c7131; /* Gold color */
}

.kassesalg_modal_product_short_desc {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 20px;
    line-height: 1.7;
    color: #333;
}

.kassesalg_modal_product_actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.kassesalg_modal_add_to_cart {
    font-family: "korolev", sans-serif;
    padding: 12px 20px;
    background-color: #8c7131; /* Gold color */
    color: #fff !important;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.kassesalg_modal_add_to_cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%) skewX(-30deg);
    transition: transform 0.6s cubic-bezier(0.3, 1, 0.8, 1);
}

.kassesalg_modal_add_to_cart:hover {
    background-color: #000; /* Black on hover */
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.kassesalg_modal_add_to_cart:hover::before {
    transform: translateX(100%) skewX(-15deg);
}

.kassesalg_modal_view_product {
    padding: 10px;
    text-align: center;
    color: #555;
    text-decoration: underline;
    font-family: 'Poppins', sans-serif;
}

.kassesalg_modal_product_desc {
    border-top: 1px solid #eee;
    padding-top: 20px;
    font-family: 'Poppins', sans-serif;
}

.kassesalg_modal_product_desc h4 {
    font-family: "korolev", sans-serif;
    font-size: 16px;
    margin: 0 0 15px;
    font-weight: 600;
    text-transform: uppercase;
}

.kassesalg_modal_message {
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.kassesalg_modal_success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kassesalg_modal_error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive styling */
@media (max-width: 1200px) {
    .kassesalg_products_grid {
        grid-template-columns: repeat(4, 1fr); /* 4 products per row */
    }
}

@media (max-width: 992px) {
    .kassesalg_products_grid {
        grid-template-columns: repeat(3, 1fr); /* 3 products per row */
    }
}

@media (max-width: 768px) {
    .kassesalg_products_grid {
        grid-template-columns: repeat(2, 1fr); /* 2 products per row */
    }
    
    .kassesalg_modal_product_main {
        flex-direction: column;
    }
    
    .kassesalg_modal_product_image {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .kassesalg_products_grid {
        grid-template-columns: repeat(2, 1fr); /* 2 products per row */
    }
}