/* ══════════════════════════════════════
   Resala Donation Store — Frontend CSS
   ══════════════════════════════════════ */

/* ── Variables ── */
:root {
    --rds-navy:   #27318b;
    --rds-red:    #e31b24;
    --rds-dark:   #1a1a2e;
    --rds-grey:   #f8f9fb;
    --rds-border: #eef0f6;
    --rds-shadow: 0 2px 14px rgba(0,0,0,.07);
    --rds-radius: 16px;
    --rds-font:   'Cairo', sans-serif;
}

/* ══════════════════════════════════════
   ARCHIVE / STORE LISTING
   ══════════════════════════════════════ */
.rds-store-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 80px;
    font-family: var(--rds-font);
    direction: rtl;
}

/* ── Store Header ── */
.rds-store-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 32px 0 28px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 32px;
}
.rds-store-head-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--rds-navy), var(--rds-red));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; flex-shrink: 0;
}
.rds-store-title {
    font-size: clamp(20px, 2.5vw, 30px);
    font-weight: 800; color: var(--rds-dark); margin: 0 0 4px;
}
.rds-store-sub { color: #888; font-size: 14px; margin: 0; }

/* ── Filters Bar ── */
.rds-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.rds-filter-btn {
    border: 1.5px solid var(--rds-red);
    background: var(--rds-red);
    color: #fff;
    border-radius: 30px;
    padding: 7px 18px;
    font-family: var(--rds-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}
.rds-filter-btn:hover,
.rds-filter-btn.active {
    background: var(--rds-navy);
    border-color: var(--rds-navy);
    color: #fff;
}

/* ── Products Grid ── */
.rds-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 768px) { .rds-products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px) { .rds-products-grid { grid-template-columns: 1fr; } }

/* ── Product Card ── */
.rds-product-card {
    background: #fff;
    border-radius: var(--rds-radius);
    box-shadow: var(--rds-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    animation: rdsCardIn .5s ease forwards;
    transition: transform .3s, box-shadow .3s;
    position: relative;
}
.rds-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(39,49,139,.13);
}
@keyframes rdsCardIn { to { opacity: 1; transform: translateY(0); } }

/* Stagger animation delay */
.rds-product-card:nth-child(1) { animation-delay: .05s; }
.rds-product-card:nth-child(2) { animation-delay: .1s; }
.rds-product-card:nth-child(3) { animation-delay: .15s; }
.rds-product-card:nth-child(4) { animation-delay: .2s; }
.rds-product-card:nth-child(5) { animation-delay: .25s; }
.rds-product-card:nth-child(6) { animation-delay: .3s; }

/* Badge */
.rds-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--rds-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
}
.rds-product-badge.featured { background: var(--rds-navy); }

/* Thumbnail */
.rds-product-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.rds-product-thumb-placeholder {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #eef0fb, #f5f6ff);
    display: flex; align-items: center; justify-content: center;
    color: var(--rds-navy); font-size: 40px; opacity: .4;
}

/* Progress Bar */
.rds-product-progress-wrap {
    padding: 10px 16px 0;
}
.rds-product-progress-bar {
    background: #f0f0f0;
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
}
.rds-product-progress-fill {
    background: linear-gradient(90deg, var(--rds-navy), var(--rds-red));
    height: 100%;
    border-radius: 8px;
    transition: width .6s ease;
}
.rds-product-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
.rds-product-progress-label strong { color: var(--rds-navy); }

/* Card Body */
.rds-product-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.rds-product-cat {
    font-size: 11px;
    color: var(--rds-navy);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}
.rds-product-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--rds-dark);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rds-product-excerpt {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Card Footer */
.rds-product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--rds-border);
}
.rds-product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--rds-red);
    white-space: nowrap;
}
.rds-product-price small {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
    margin-right: 2px;
}

/* Add to cart button */
.rds-add-btn {
    background: var(--rds-navy);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-family: var(--rds-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}
.rds-add-btn:hover { background: #1e2570; }
.rds-add-btn.adding { background: #059669; }
.rds-add-btn:active { transform: scale(.96); }

/* ── Cart FAB ── */
.rds-cart-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    left: auto;
    background: var(--rds-navy);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-family: var(--rds-font);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(39,49,139,.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 900;
    transition: transform .2s, box-shadow .2s;
}
.rds-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(39,49,139,.5); }
.rds-cart-fab.hidden { display: none; }

.rds-cart-fab-badge {
    background: var(--rds-red);
    color: #fff;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}

/* ── Cart Drawer ── */
.rds-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.rds-overlay.open { opacity: 1; pointer-events: auto; }

.rds-drawer {
    position: fixed;
    top: 0; right: 0; left: auto;
    width: 380px; max-width: 100vw;
    height: 100dvh;
    background: #fff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 32px rgba(0,0,0,.15);
}
.rds-drawer.open { transform: translateX(0); }

.rds-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 2px solid var(--rds-border);
    background: var(--rds-navy);
    color: #fff;
}
.rds-drawer-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.rds-drawer-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 34px; height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.rds-drawer-close:hover { background: rgba(255,255,255,.25); }

.rds-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rds-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}
.rds-cart-empty i { font-size: 48px; display: block; margin-bottom: 12px; }
.rds-cart-empty p { font-size: 14px; }

/* Cart Item */
.rds-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rds-border);
}
.rds-cart-item:last-child { border-bottom: none; }
.rds-cart-item-thumb {
    width: 56px; height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--rds-grey);
}
.rds-cart-item-info { flex: 1; min-width: 0; }
.rds-cart-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--rds-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rds-cart-item-price { font-size: 12px; color: var(--rds-red); font-weight: 700; margin-top: 2px; }

.rds-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rds-qty-btn {
    width: 26px; height: 26px;
    border: 1.5px solid var(--rds-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    color: var(--rds-navy);
}
.rds-qty-btn:hover { background: var(--rds-navy); color: #fff; border-color: var(--rds-navy); }
.rds-qty-num { font-size: 13px; font-weight: 700; min-width: 20px; text-align: center; }
.rds-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color .2s;
}
.rds-remove-btn:hover { color: var(--rds-red); }

.rds-drawer-foot {
    padding: 16px 20px;
    border-top: 2px solid var(--rds-border);
    background: var(--rds-grey);
}
.rds-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
}
.rds-cart-total-row span { color: #666; font-weight: 700; }
.rds-cart-total-row strong { font-size: 20px; color: var(--rds-red); }

.rds-checkout-btn {
    width: 100%;
    background: var(--rds-navy);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: var(--rds-font);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s;
}
.rds-checkout-btn:hover:not(:disabled) { background: #1e2570; }
.rds-checkout-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════
   SINGLE PRODUCT PAGE
   ══════════════════════════════════════ */
.rds-single-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    font-family: var(--rds-font);
    direction: rtl;
}
.rds-single-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: start;
}
@media (max-width: 720px) { .rds-single-grid { grid-template-columns: 1fr; } }

.rds-single-image {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--rds-shadow);
}
.rds-single-image img { width: 100%; display: block; }
.rds-single-image-placeholder {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #eef0fb, #f5f6ff);
    display: flex; align-items: center; justify-content: center;
    color: var(--rds-navy); font-size: 80px; opacity: .3;
}

.rds-single-info { }
.rds-single-cat { font-size: 12px; color: var(--rds-navy); font-weight: 800; margin-bottom: 8px; }
.rds-single-title { font-size: clamp(22px, 3vw, 32px); font-weight: 800; color: var(--rds-dark); margin: 0 0 16px; }
.rds-single-price { font-size: 28px; font-weight: 800; color: var(--rds-red); margin-bottom: 20px; }
.rds-single-price span { font-size: 14px; color: #aaa; font-weight: 400; }
.rds-single-excerpt { font-size: 14px; color: #666; line-height: 1.8; margin-bottom: 24px; }

/* Qty selector on single */
.rds-single-qty-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.rds-single-qty-wrap label { font-size: 13px; font-weight: 700; color: #555; }
.rds-single-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--rds-border);
    border-radius: 10px;
    overflow: hidden;
}
.rds-single-qty button {
    background: var(--rds-grey);
    border: none;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    color: var(--rds-navy);
    transition: background .15s;
}
.rds-single-qty button:hover { background: #e0e3f0; }
.rds-single-qty-num {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 800;
    border: none;
    border-right: 1.5px solid var(--rds-border);
    border-left: 1.5px solid var(--rds-border);
    text-align: center;
    width: 60px;
    font-family: var(--rds-font);
}
.rds-single-add-btn {
    width: 100%;
    background: var(--rds-navy);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-family: var(--rds-font);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .2s, transform .15s;
    margin-bottom: 12px;
}
.rds-single-add-btn:hover { background: #1e2570; transform: translateY(-2px); }
.rds-single-add-btn.adding { background: #059669; }

.rds-single-secure {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
    justify-content: center;
}

/* ══════════════════════════════════════
   CHECKOUT PAGE
   ══════════════════════════════════════ */
.rds-checkout-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    font-family: var(--rds-font);
}
.rds-checkout-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 28px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 36px;
}
.rds-checkout-head-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--rds-navy), var(--rds-red));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; flex-shrink: 0;
}
.rds-checkout-title { font-size: clamp(20px, 2.5vw, 28px); font-weight: 800; color: var(--rds-dark); margin: 0 0 4px; }
.rds-checkout-sub { color: #888; font-size: 14px; margin: 0; }
.rds-checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 720px) { .rds-checkout-grid { grid-template-columns: 1fr; } }

.rds-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--rds-navy);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rds-order-summary {
    background: #fff;
    border-radius: var(--rds-radius);
    padding: 20px;
    box-shadow: var(--rds-shadow);
}
.rds-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rds-border);
}
.rds-order-item:last-of-type { border-bottom: none; }
.rds-order-thumb {
    width: 50px; height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.rds-order-thumb--placeholder {
    background: var(--rds-grey);
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 20px;
}
.rds-order-info { flex: 1; }
.rds-order-name { font-size: 13px; font-weight: 700; color: var(--rds-dark); display: block; }
.rds-order-qty { font-size: 12px; color: #aaa; }
.rds-order-price { font-size: 14px; font-weight: 800; color: var(--rds-red); white-space: nowrap; }
.rds-order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid var(--rds-border);
    font-size: 16px;
}
.rds-order-total-row span { font-weight: 700; color: #555; }
.rds-order-total-row strong { font-size: 22px; color: var(--rds-red); }

.rds-donor-form-wrap {
    background: #fff;
    border-radius: var(--rds-radius);
    padding: 20px;
    box-shadow: var(--rds-shadow);
}
.rds-form-row { margin-bottom: 16px; }
.rds-form-row label { display: block; font-size: 13px; font-weight: 700; color: #444; margin-bottom: 6px; }
.rds-input-icon-wrap {
    position: relative;
}
.rds-input-icon-wrap i {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    color: #bbb; font-size: 14px;
}
.rds-input-icon-wrap input {
    width: 100%;
    padding: 11px 38px 11px 14px;
    border: 1.5px solid var(--rds-border);
    border-radius: 10px;
    font-family: var(--rds-font);
    font-size: 14px;
    transition: border-color .2s;
    box-sizing: border-box;
}
.rds-input-icon-wrap input:focus { outline: none; border-color: var(--rds-navy); }

.rds-submit-btn {
    width: 100%;
    background: var(--rds-navy);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-family: var(--rds-font);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s;
    margin-top: 8px;
}
.rds-submit-btn:hover { background: #1e2570; }
.rds-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.rds-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
}

.rds-checkout-msg {
    background: #fef0f0;
    border: 1px solid #fcc;
    color: var(--rds-red);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 10px;
}
