/**
 * Custom Woo Add to Cart & Links Frontend CSS
 *
 * @package Custom_Woo_Add_To_Cart_Links
 */

/* --- Custom Buttons --- */
.cwal-button-wrapper {
    margin: 10px 0;
    display: block;
}

.cwal-button {
    display: inline-block;
    padding: 12px 24px;
    margin: 5px 0;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    color: #fff !important;
    background-color: #007cba !important;
}

.cwal-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Ensure buttons stack nicely */
.woocommerce div.product form.cart, 
.woocommerce div.product .summary {
    display: flex;
    flex-direction: column;
}

/* --- Popup Modal --- */
.cwal-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    -webkit-animation-name: fadeIn;
    -webkit-animation-duration: 0.4s;
    animation-name: fadeIn;
    animation-duration: 0.4s
}

.cwal-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    -webkit-animation-name: slideIn;
    -webkit-animation-duration: 0.5s;
    animation-name: slideIn;
    animation-duration: 0.5s
}

/* Close Button */
.cwal-close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.cwal-close-button:hover,
.cwal-close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.cwal-modal-body {
    padding-top: 20px;
}

/* --- Animations --- */
@-webkit-keyframes slideIn {
    from {top: -300px; opacity: 0} 
    to {top: 0; opacity: 1}
}

@keyframes slideIn {
    from { margin-top: -5%; opacity: 0; }
    to { margin-top: 10%; opacity: 1; }
}

@-webkit-keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

/* Responsive */
@media screen and (max-width: 768px) {
    .cwal-modal-content {
        width: 90%;
        margin: 20% auto;
    }
}
