/* Stork Gifts Frontend Styles */

.stork-gifts-selection {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    width: -webkit-fill-available;
    width: -moz-available;
    width: fill-available;
    clear: both;
    display: block;
}

/* Separator styles */
.stork-gifts-separator {
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin: 15px 0;
    clear: both;
}

.stork-gifts-selection h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.gifts-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.gift-option {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 250px;
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Desktop layout - 4 gifts per row */
@media (min-width: 769px) {
    .gift-option {
        flex: 0 0 calc(25% - 11.25px) !important;
        min-width: calc(25% - 11.25px) !important;
        max-width: calc(25% - 11.25px) !important;
    }
}

.gift-option:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.gift-option.selected {
    border-color: #0073aa;
    background-color: #f0f8ff;
    box-shadow: 0 2px 12px rgba(0, 115, 170, 0.2);
}

.gift-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gift-label {
    display: block;
    padding: 15px;
    cursor: pointer;
    text-align: center;
}

.gift-image {
    margin-bottom: 10px;
}

.gift-image img {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.gift-info {
    text-align: center;
}

.gift-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.default-badge {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Mobile Layout - 2 gifts per row on mobile devices */
@media (max-width: 768px) {
    .gifts-container {
        gap: 10px !important;
        justify-content: flex-start !important;
    }
    
    .gift-option {
        flex: 0 0 calc(50% - 5px) !important;
        min-width: calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
    }
    
    .gift-image img {
        height: 80px !important;
    }
    
    .gift-name {
        font-size: 12px !important;
    }
    
    .default-badge {
        font-size: 10px !important;
        padding: 1px 6px !important;
    }
}

/* Very small screens - still 2 per row but smaller */
@media (max-width: 480px) {
    .stork-gifts-selection {
        padding: 15px;
    }
    
    .gifts-container {
        gap: 8px !important;
    }
    
    .gift-option {
        flex: 0 0 calc(50% - 5px) !important;
        min-width: calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
    }
    
    .gift-label {
        padding: 10px;
    }
    
    .gift-image img {
        height: 60px !important;
    }
    
    .gift-name {
        font-size: 11px !important;
    }
}

/* Order Details Styles */
.stork-gift-order-details {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.stork-gift-order-details h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.stork-gift-order-details .gift-image {
    margin-bottom: 10px;
}

.stork-gift-order-details .gift-image img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Cart Table Styles */
.cart .stork-gift-info {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Checkout Styles */
.woocommerce-checkout .stork-gift-info {
    background-color: #f0f8ff;
    padding: 10px;
    border-radius: 4px;
    margin: 5px 0;
    border-left: 3px solid #0073aa;
}

/* Ensure proper layout separation */
.woocommerce div.product form.cart .stork-gifts-selection {
    width: 100% !important;
    flex-basis: 100% !important;
    flex: 1 0 100% !important;
    clear: both !important;
    margin-bottom: 20px !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    clear: both !important;
    margin-top: 20px !important;
}
