/* shared-checkout.css
 *
 * Single source of truth for the full-screen checkout modal styling.
 * Pulled out of index.html (commit 5e386cc) so all 3 core shop pages
 * + every browse page can render an identical checkout layout.
 *
 * Depends on these :root vars being defined by the host page (already
 * the case on every page that loads shared-header.css):
 *   --warm-cream, --sage-green, --terracotta
 */

/* Checkout Modal - Full Screen */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--warm-cream);
    z-index: 10100;
    overflow: hidden;
}

.checkout-modal.active {
    display: flex;
    flex-direction: column;
}

.checkout-header {
    background: linear-gradient(135deg, var(--sage-green), var(--terracotta));
    color: white;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.checkout-header-logo {
    display: inline-flex;
    align-items: center;
    justify-self: start;
}

.checkout-header-logo img {
    display: block;
}

.checkout-header h2 {
    font-family: 'Lato', sans-serif;
    font-size: clamp(20px, 2.4vw, 24px);
    margin: 0;
    text-align: center;
    justify-self: center;
}

.checkout-header-buttons {
    display: flex;
    gap: 1rem;
    justify-self: end;
}

.checkout-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.checkout-header button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.checkout-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.checkout-content-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.checkout-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.checkout-col > .checkout-section {
    margin-bottom: 0;
}

.checkout-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid transparent;
}

.checkout-section:nth-child(odd) {
    border-left-color: rgba(212, 112, 74, 0.3);
}

.checkout-section:nth-child(even) {
    border-left-color: rgba(156, 175, 136, 0.3);
}

.checkout-section h3 {
    color: #444;
    font-family: 'Lato', sans-serif;
    font-size: clamp(15px, 1.6vw, 17px);
    margin-bottom: 1.5rem;
    text-align: center;
}

.checkout-cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(156, 175, 136, 0.05), rgba(212, 112, 74, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(156, 175, 136, 0.2);
}

.checkout-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: white;
    flex-shrink: 0;
}

.checkout-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.checkout-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.checkout-cart-item-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.3rem;
}

.checkout-cart-item-price {
    font-size: 1.1rem;
    color: #444;
    font-weight: 600;
}

.checkout-cart-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

/* Connected qty pill — single rounded container with -/value/+ inside */
.checkout-cart-item-actions .qty-pill {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--terracotta, #E0AA9A);
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
}

.checkout-cart-item-actions .qty-pill button {
    background: transparent;
    color: var(--terracotta, #E0AA9A);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checkout-cart-item-actions .qty-pill button:hover {
    background: rgba(224, 170, 154, 0.12);
}

/* Remove → terracotta underlined text link instead of a coloured fill button */
.checkout-cart-item-actions .remove-btn {
    background: transparent;
    color: var(--terracotta, #E0AA9A);
    border: none;
    padding: 0.3rem 0.4rem;
    border-radius: 0;
    width: auto;
    height: auto;
    margin-left: auto;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
}

.checkout-cart-item-actions .remove-btn:hover {
    background: transparent;
    opacity: 0.75;
}

.checkout-cart-item-quantity {
    font-size: 1rem;
    font-weight: 700;
    color: #444;
    min-width: 24px;
    text-align: center;
    padding: 0 0.2rem;
}

.checkout-total {
    background: linear-gradient(135deg, rgba(156, 175, 136, 0.15), rgba(212, 112, 74, 0.15));
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.checkout-total span:first-child {
    font-size: 1.4rem;
    font-weight: 700;
    color: #444;
}

.checkout-total span:last-child {
    font-size: 1.8rem;
    font-weight: 700;
    color: #444;
}

.checkout-payment-button {
    width: 100%;
    background: linear-gradient(135deg, var(--sage-green), var(--terracotta));
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2rem;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(156, 175, 136, 0.4);
}

.checkout-payment-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(156, 175, 136, 0.5);
}

/* Tablet — collapse to single column, keep generous spacing */
@media (max-width: 1024px) {
    .checkout-content {
        padding: 1.5rem;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .checkout-col {
        gap: 1.5rem;
    }

    .checkout-section {
        padding: 1.75rem;
    }
}

/* Mobile — tight spacing, header collapses to two rows */
@media (max-width: 768px) {
    .checkout-content {
        padding: 1rem;
    }

    .checkout-grid {
        gap: 1rem;
    }

    .checkout-col {
        gap: 1rem;
    }

    .checkout-section {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .checkout-section h3 {
        font-size: 1.05rem;
        margin-bottom: 1rem;
    }

    .checkout-cart-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .checkout-cart-item-image {
        width: 100%;
        height: 120px;
    }

    .checkout-header {
        padding: 0.9rem 1rem;
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
    }

    .checkout-header h2 {
        font-size: 1.05rem;
    }

    .checkout-header-logo img {
        height: 36px !important;
        width: auto;
    }

    .checkout-header button {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }

    .delivery-method-tab {
        font-size: 0.85rem !important;
        padding: 0.7rem 0.4rem !important;
    }

    .checkout-payment-button {
        font-size: 1.05rem;
        padding: 1rem 1.25rem;
    }
}

/* Trust badges shown beneath the payment button on collections + occasion pages.
 * Styles live here so they keep working when the inline CSS block is removed. */
.checkout-trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(156, 175, 136, 0.08);
    border-radius: 15px;
    border: 1px solid rgba(156, 175, 136, 0.2);
}

.checkout-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
}

.checkout-trust-badge .icon {
    font-size: 1.3rem;
}

@media (max-width: 768px) {
    .checkout-trust-badges {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
    }

    .checkout-trust-badge {
        font-size: 0.85rem;
    }

    .checkout-trust-badge .icon {
        font-size: 17px;
    }
}

/* Small phones — drop the header title to keep logo + Back visible */
@media (max-width: 480px) {
    .checkout-header {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .checkout-header h2 {
        display: none;
    }

    .checkout-section {
        padding: 1rem;
    }

    .checkout-cart-item {
        gap: 0.75rem;
    }

    .delivery-method-tab {
        font-size: 0.8rem !important;
    }
}
