/* ===================================================
   Tweet Treats Cookie Bundle Builder – Styles
=================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@400;500;600&display=swap');

#ttcb-app {
    font-family: 'DM Sans', sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 60px;
    color: #2d1a0e;
}

.ttcb-hero {
    text-align: center;
    padding: 48px 24px 32px;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-radius: 20px;
    margin-bottom: 40px;
}
.ttcb-hero h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(26px, 5vw, 42px);
    color: #7b3f00;
    margin: 0 0 10px;
}
.ttcb-hero p {
    font-size: 17px;
    color: #6b4c2a;
    margin: 0;
}

/* Steps */
.ttcb-step { margin-bottom: 40px; }
.ttcb-step h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #5c2d0a;
    margin-bottom: 16px;
    border-bottom: 2px solid #f5c491;
    padding-bottom: 8px;
}
.ttcb-hidden { display: none !important; }

/* Bundle Cards */
.ttcb-bundle-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.ttcb-bundle-card {
    border: 3px solid #f5c491;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.ttcb-bundle-card:hover,
.ttcb-bundle-card.selected {
    border-color: #d97706;
    background: #fff8f0;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(217,119,6,.2);
}
.ttcb-bundle-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 12px;
    background: #d97706;
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    line-height: 24px;
}
.ttcb-bundle-emoji { font-size: 32px; margin-bottom: 8px; }
.ttcb-bundle-label { font-size: 18px; font-weight: 700; color: #7b3f00; }
.ttcb-bundle-count { font-size: 14px; color: #a0683a; margin: 2px 0; }
.ttcb-bundle-price { font-size: 22px; font-weight: 700; color: #d97706; margin: 8px 0 4px; }
.ttcb-bundle-desc  { font-size: 13px; color: #888; }

/* Cookie Grid */
.ttcb-cookie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.ttcb-cookie-item {
    border: 2px solid #e8d5c0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.ttcb-cookie-item.selected {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,.15);
}
.ttcb-cookie-item.is-premium {
    border-color: #f9a825;
}
.ttcb-cookie-img {
    position: relative;
    background: #fff8f0;
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.ttcb-cookie-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.ttcb-cookie-placeholder {
    font-size: 48px;
    display: block;
}
.ttcb-premium-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: #f9a825;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}
.ttcb-quantity-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255,255,255,.92);
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.ttcb-cookie-item:hover .ttcb-quantity-controls,
.ttcb-cookie-item.selected .ttcb-quantity-controls {
    opacity: 1;
}
.ttcb-qty-btn {
    background: #d97706;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px; height: 26px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.ttcb-qty-btn:hover { background: #b45309; }
.ttcb-qty { font-weight: 700; min-width: 20px; text-align: center; font-size: 16px; }
.ttcb-cookie-name {
    font-weight: 600;
    font-size: 13px;
    padding: 8px 8px 2px;
    text-align: center;
}
.ttcb-cookie-price {
    font-size: 12px;
    color: #a0683a;
    padding: 0 8px 8px;
    text-align: center;
}
#ttcb-counter {
    background: #d97706;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}
.ttcb-note {
    background: #fff8ec;
    border-left: 4px solid #f9a825;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Summary */
.ttcb-summary {
    background: #fff8f0;
    border: 2px solid #f5c491;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
#ttcb-summary-items .ttcb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0e0cc;
    font-size: 15px;
}
.ttcb-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    color: #7b3f00;
    margin-top: 14px;
    padding-top: 10px;
}
.ttcb-email-wrap {
    margin-bottom: 20px;
}
.ttcb-email-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.ttcb-email-wrap input {
    width: 100%;
    max-width: 360px;
    padding: 10px 14px;
    border: 2px solid #e8d5c0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.ttcb-email-wrap input:focus {
    outline: none;
    border-color: #d97706;
}

/* Buttons */
.ttcb-btn-checkout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(180,83,9,.35);
}
.ttcb-btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(180,83,9,.45);
}
.ttcb-btn-checkout:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.ttcb-btn-back {
    display: inline-block;
    margin-top: 14px;
    background: none;
    border: 2px solid #d0b090;
    color: #7b3f00;
    font-size: 14px;
    font-family: inherit;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.15s;
}
.ttcb-btn-back:hover { background: #fff0e0; }
.ttcb-secure {
    font-size: 13px;
    color: #888;
    margin: 8px 0;
}

/* Message area */
#ttcb-message {
    padding: 14px 18px;
    border-radius: 10px;
    display: none;
    font-weight: 600;
}
#ttcb-message.error   { background: #fde8e8; color: #b91c1c; display: block; }
#ttcb-message.loading { background: #e8f0fe; color: #1d4ed8; display: block; }

@media (max-width: 520px) {
    .ttcb-cookie-grid { grid-template-columns: repeat(2, 1fr); }
    .ttcb-bundle-options { grid-template-columns: 1fr; }
}
