/* =========================================================
   Donation System (DS) styles
   - Namespaced with .ds- prefix to avoid conflicts
   - Purpose: clean, readable CSS that is easy to maintain
   ========================================================= */

/* -------------------------
   Layout: wrapper & table
   ------------------------- */
.ds-donation-shop-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    font-family: "Open Sans", Arial, sans-serif;
    color: #222;
}

.ds-donation-products-table {
    margin-bottom: 20px;
}

.ds-donation-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow: hidden;
    table-layout: fixed;
    border: 1px solid #eee;
}

.ds-donation-product-row {
    border-bottom: 1px solid #eee;
}

/* Table cells */
.ds-donation-table td {
    padding: 14px 12px;
    vertical-align: middle;
    font-size: 16px;
    border: 1px solid #eee;
}

/* Column width helpers */
.ds-product-image { width: 12%; max-width: 110px; }
.ds-product-name  { width: 40%; }
.ds-product-price { width: 16%; text-align: left; }
.ds-product-quantity { width: 8%; text-align: center; }
.ds-product-action { width: 18%; text-align: center; }

/* Product image */
.ds-product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Title and description */
.ds-product-name h4 {
    margin: 0 0 6px;
    font-size: 18px; /* desktop title size */
    line-height: 1.2;
}

.ds-product-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* -------------------------
   Inputs & suggested pills
   ------------------------- */
.ds-custom-amount-input {
    width: 120px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background: #fff;
}

.ds-suggested-amounts {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-suggested-btn {
    padding: 6px 12px;
    border: 1px solid #f0b400;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 0 rgba(0,0,0,0.04);
    font-size: 14px;
}

.ds-suggested-btn.active,
.ds-suggested-btn:hover {
    background: #f7d84a;
}

/* Quantity input */
.ds-quantity-input {
    width: 70px;
    padding: 8px;
    border: 2px solid #f0b400;
    border-radius: 8px;
    background: #fffef5;
    font-size: 16px;
    box-sizing: border-box;
}

/* -------------------------
   Add to cart button
   ------------------------- */
.ds-add-to-cart {
    padding: 10px 18px;
    background: #f7d84a;
    color: #222;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s ease;
    box-shadow: 0 6px 12px rgba(247,216,74,0.12);
}

/* Hand icon (uses Font Awesome) */
.ds-add-to-cart::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f4be";
    display: inline-block;
    margin-right: 8px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1;
}

/* Subtle pulse animation to draw attention */
@keyframes ds-pulse {
    0%   { box-shadow: 0 6px 12px rgba(247,216,74,0.12); transform: translateY(0); }
    50%  { box-shadow: 0 10px 20px rgba(247,216,74,0.22); transform: translateY(-5px); }
    100% { box-shadow: 0 6px 12px rgba(247,216,74,0.12); transform: translateY(0); }
}

.ds-add-to-cart {
    animation: ds-pulse 2.6s infinite ease-in-out;
}

/* -------------------------
   Cart summary
   ------------------------- */
.ds-donation-cart-summary {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
    margin-top: 18px;
}

.ds-donation-cart-summary h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.ds-cart-items-list { min-height: 40px; margin-bottom: 12px; }

.ds-cart-item-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f6f6f6;
}

.ds-cart-item-name {
    flex: 1;
    color: #1f4f6c;
    font-size: 14px;
    font-weight: 500;
}

span.ds-cart-item-remove {
    background: red;
    color: white;
    border-radius: 50%;
    line-height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 5px;
    margin-left: 10px;
    font-size: 12px;
    cursor: pointer;
}

.ds-cart-item-details { color: #666; }

/* Cart action buttons */
.ds-cart-actions { display: flex; gap: 10px; margin-top: 10px; }
.ds-cart-actions a,
.ds-cart-actions button {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    color: #194f6d;
}

/* Notification container */
#ds-notification { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.ds-notification .ds-notification-box,
.ds-notification-box,
.notification-box {
    background: #28a745;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Input refinements (shared) */
input.ds-custom-amount-input,
input.ds-quantity-input {
    color: #1f4f6c;
    border-radius: 8px !important;
    font-family: "Open Sans", "OPEN SANS CONDENSED", Sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    vertical-align: middle;
    padding: 6px !important;
    width: 100%;
    max-width: 70px;
}

/* =========================
   Responsive: mobile (stacked)
   ========================= */
@media (max-width: 768px) {
    .ds-donation-table,
    .ds-donation-table tbody,
    .ds-donation-product-row,
    .ds-donation-product-row td {
        display: block;
        width: 100% !important;
        float: left;
    }

    .ds-donation-product-row {
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px;
    }

    .ds-donation-table td {
        padding: 8px 6px;
        font-size: 16px;
        text-align: center;
    }

    td.ds-product-image {
        width: 25% !important;
        max-width: unset;
        border-bottom: 0;
    }

    td.ds-product-image img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    td.ds-product-name {
        width: 75% !important;
        max-width: unset;
        border-bottom: 0;
    }

    td.ds-product-name h4 {
        font-size: 16px; /* mobile title size */
        margin-top: 4px;
    }

    td.ds-product-price,
    td.ds-product-quantity {
        width: 50% !important;
        border-bottom: 0;
        text-align: center !important;
    }

    .ds-suggested-amounts {
        margin-top: 10px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    tr.ds-donation-product-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .ds-product-price,
    .ds-product-quantity,
    .ds-product-action {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        text-align: left;
    }

    .ds-product-action {
        text-align: right;
    }

    .ds-donation-product-row:after {
        content: "";
        display: block;
        clear: both;
    }
}

/* Global box-sizing for wrapper content */
.ds-donation-shop-wrapper *,
.ds-donation-shop-wrapper *:before,
.ds-donation-shop-wrapper *:after {
    box-sizing: border-box;
}