/* ===== DICED SUBSCRIPTIONS ===== */

#diced-sub-builder { font-family: 'Outfit', -apple-system, sans-serif; max-width: 1100px; margin: 0 auto; }

/* Steps */
.diced-sub-step { display: none; }
.diced-sub-step.diced-sub-active { display: block; }
.diced-sub-step-header { text-align: center; margin-bottom: 30px; }
.diced-sub-step-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #1B4332; color: #fff; border-radius: 50%; font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.diced-sub-step-title { font-size: 28px; font-weight: 800; color: #1B4332; margin: 0 0 6px 0; }
.diced-sub-step-desc { font-size: 16px; color: #6B7280; margin: 0; }

/* Tier Cards */
.diced-sub-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.diced-sub-tier { background: #fff; border: 2px solid #E5E7EB; border-radius: 14px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all 0.3s ease; }
.diced-sub-tier:hover { border-color: #1B4332; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(27,67,50,0.1); }
.diced-sub-tier-active { border-color: #1B4332; background: #D8F3DC; }
.diced-sub-tier-meals { font-size: 48px; font-weight: 900; color: #1B4332; line-height: 1; margin-bottom: 4px; }
.diced-sub-tier-label { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 12px; }
.diced-sub-tier-discount { display: inline-block; padding: 4px 14px; background: #D4A017; color: #0d2818; border-radius: 20px; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.diced-sub-tier-billing { font-size: 12px; color: #9CA3AF; }

/* Day Cards */
.diced-sub-days { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 600px; margin: 0 auto; }
.diced-sub-day { background: #fff; border: 2px solid #E5E7EB; border-radius: 14px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.diced-sub-day:hover { border-color: #1B4332; transform: translateY(-3px); }
.diced-sub-day-active { border-color: #1B4332; background: #D8F3DC; }
.diced-sub-day-icon { font-size: 36px; }
.diced-sub-day-name { font-size: 22px; font-weight: 800; color: #1B4332; }
.diced-sub-day-cutoff { font-size: 13px; color: #6B7280; }

/* Back Button */
.diced-sub-back-btn { background: none; border: 1px solid #E5E7EB; padding: 10px 20px; border-radius: 8px; font-size: 14px; color: #6B7280; cursor: pointer; margin-top: 24px; font-family: inherit; }
.diced-sub-back-btn:hover { border-color: #1B4332; color: #1B4332; }

/* Summary Bar */
.diced-sub-summary-bar { display: flex; justify-content: space-between; align-items: center; background: #1B4332; color: #fff; padding: 14px 20px; border-radius: 10px; margin-bottom: 16px; position: sticky; top: 60px; z-index: 100; }
.diced-sub-counter { font-size: 16px; font-weight: 700; }
.diced-sub-running-total { font-size: 16px; }
.diced-sub-discount-badge { background: #D4A017; color: #0d2818; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; margin-left: 8px; }

/* Search */
.diced-sub-search { margin-bottom: 16px; }
#diced-sub-search-input { width: 100%; padding: 12px 16px; border: 2px solid #E5E7EB; border-radius: 10px; font-size: 15px; font-family: inherit; }
#diced-sub-search-input:focus { border-color: #1B4332; outline: none; box-shadow: 0 0 0 3px rgba(27,67,50,0.1); }

/* Meal Grid */
.diced-sub-meals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.diced-sub-meal-card { background: #fff; border: 2px solid #E5E7EB; border-radius: 12px; overflow: hidden; transition: all 0.2s; display: flex; flex-direction: column; }
.diced-sub-meal-card.diced-sub-meal-selected { border-color: #1B4332; box-shadow: 0 0 0 2px rgba(27,67,50,0.2); }
.diced-sub-meal-img { width: 100%; height: 140px; object-fit: cover; }
.diced-sub-meal-info { padding: 12px 14px 8px; flex: 1; }
.diced-sub-meal-name { font-size: 14px; font-weight: 700; color: #1B4332; margin-bottom: 4px; line-height: 1.3; }
.diced-sub-meal-meta { display: flex; justify-content: space-between; font-size: 13px; color: #6B7280; }
.diced-sub-meal-variable { font-size: 11px; color: #9CA3AF; font-style: italic; margin-top: 4px; }

/* Quantity Controls */
.diced-sub-meal-qty { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; border-top: 1px solid #F3F4F6; }
.diced-sub-meal-qty button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #1B4332; background: #fff; color: #1B4332; font-size: 18px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; font-family: inherit; line-height: 1; }
.diced-sub-meal-qty button:hover:not(:disabled) { background: #1B4332; color: #fff; }
.diced-sub-meal-qty button:disabled { border-color: #D1D5DB; color: #D1D5DB; cursor: default; }
.diced-sub-meal-count { font-size: 18px; font-weight: 800; color: #1B4332; min-width: 24px; text-align: center; }

/* Bottom Bar */
.diced-sub-bottom-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-top: 2px solid #E5E7EB; position: sticky; bottom: 0; background: #fff; z-index: 100; }
.diced-sub-bottom-summary { font-size: 18px; font-weight: 700; color: #1B4332; }
.diced-sub-subscribe-btn { padding: 14px 32px; background: #D4A017; color: #0d2818; border: none; border-radius: 8px; font-size: 16px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.3s; font-family: inherit; }
.diced-sub-subscribe-btn:hover:not(:disabled) { background: #e8b520; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,160,23,0.3); }
.diced-sub-subscribe-btn:disabled { background: #9CA3AF; cursor: default; color: #fff; }

/* Processing / Step 4 */
.diced-sub-processing { text-align: center; padding: 60px 0; }
.diced-sub-spinner { width: 48px; height: 48px; border: 4px solid #E5E7EB; border-top-color: #1B4332; border-radius: 50%; animation: diced-spin 0.8s linear infinite; margin: 0 auto 20px; }
@keyframes diced-spin { to { transform: rotate(360deg); } }
.diced-sub-processing h2 { font-size: 22px; color: #1B4332; margin: 0 0 6px; }
.diced-sub-processing p { color: #6B7280; }

/* Loading */
.diced-sub-loading, .diced-sub-no-meals { text-align: center; padding: 40px; color: #6B7280; font-size: 15px; }

/* ===== MY ACCOUNT ===== */
.diced-sub-manage-card { background: #fff; border: 2px solid #E5E7EB; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.diced-sub-manage-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #E5E7EB; }
.diced-sub-manage-header h3 { font-size: 18px; font-weight: 800; color: #1B4332; margin: 0 0 8px; }
.diced-sub-manage-meta { text-align: right; font-size: 13px; color: #374151; line-height: 1.8; }
.diced-sub-status { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.diced-sub-status-active { background: #D8F3DC; color: #1B4332; }
.diced-sub-status-on-hold, .diced-sub-status-paused { background: #FFF8E1; color: #92400E; }
.diced-sub-status-cancelled { background: #FFEBEE; color: #C62828; }
.diced-sub-meals-list h4 { font-size: 15px; font-weight: 700; color: #1B4332; margin: 0 0 8px; }
.diced-sub-meals-list ol { margin: 0 0 16px 20px; padding: 0; font-size: 14px; color: #374151; line-height: 1.8; }
.diced-sub-manage-actions { display: flex; gap: 10px; align-items: center; }
.diced-sub-swap-btn { background: #1B4332 !important; color: #fff !important; }
.diced-sub-cutoff-notice { font-size: 13px; color: #92400E; background: #FFF8E1; padding: 10px 14px; border-radius: 8px; border: 1px solid #F59E0B; margin: 0; }
.diced-sub-no-subs { text-align: center; padding: 40px 0; }
.diced-sub-no-subs h3 { font-size: 20px; color: #1B4332; margin: 0 0 8px; }
.diced-sub-no-subs p { color: #6B7280; margin: 0 0 16px; }

/* Mobile */
@media (max-width: 768px) {
    .diced-sub-tiers { grid-template-columns: repeat(2, 1fr); }
    .diced-sub-days { grid-template-columns: 1fr; max-width: 300px; }
    .diced-sub-meals-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .diced-sub-summary-bar { flex-direction: column; gap: 6px; text-align: center; }
    .diced-sub-bottom-bar { flex-direction: column; gap: 10px; padding: 12px 0; }
    .diced-sub-manage-header { flex-direction: column; }
    .diced-sub-manage-meta { text-align: left; margin-top: 8px; }
}
@media (max-width: 480px) {
    .diced-sub-meals-grid { grid-template-columns: 1fr; }
    .diced-sub-tiers { grid-template-columns: 1fr; }
}

/* Filter Buttons */
#diced-sub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}
.diced-sub-filter-btn {
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    color: #111827;
    min-height: 42px;
    white-space: nowrap;
}
.diced-sub-filter-btn:hover {
    background: #F0FFF4;
    border-color: #2D6A4F;
}
.diced-sub-filter-btn.diced-sub-filter-active {
    background: #1B4332;
    color: #ffffff;
    border-color: #1B4332;
}

/* Variation tags on subscription meal cards */
.diced-sub-var-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}
.diced-sub-var-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #D8F3DC;
    color: #1B4332;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Variation Popup (shared with meal packs but duplicated for independence) */
.diced-var-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
}
.diced-var-overlay.diced-var-overlay-show { display: block; }

.diced-var-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 100001;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Outfit', -apple-system, sans-serif;
}
.diced-var-popup.diced-var-open { display: block; }

.diced-var-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #E5E7EB;
    background: #1B4332;
    border-radius: 16px 16px 0 0;
}
.diced-var-header h3 { margin: 0; font-size: 18px; font-weight: 800; color: #ffffff; }
.diced-var-close { background: none; border: none; color: #ffffff; font-size: 26px; cursor: pointer; padding: 0; line-height: 1; }

.diced-var-body { padding: 24px; }
.diced-var-field { margin-bottom: 16px; }
.diced-var-field:last-child { margin-bottom: 0; }
.diced-var-label { display: block; font-size: 13px; font-weight: 700; color: #1B4332; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.diced-var-select {
    width: 100%; padding: 14px 40px 14px 16px; border: 2px solid #E5E7EB; border-radius: 8px; font-size: 15px;
    font-family: 'Outfit', sans-serif; color: #374151; background: #ffffff; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    min-height: 50px; line-height: 1.4; box-sizing: border-box;
}
.diced-var-select:focus { border-color: #1B4332; outline: none; box-shadow: 0 0 0 3px rgba(27,67,50,0.1); }

.diced-var-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-top: 2px solid #E5E7EB; background: #F8F9FA; border-radius: 0 0 16px 16px;
}
.diced-var-price { font-size: 22px; font-weight: 900; color: #1B4332; }
.diced-var-confirm {
    padding: 12px 28px; background: #D4A017; color: #0d2818; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    cursor: pointer; font-family: 'Outfit', sans-serif; transition: all 0.2s;
}
.diced-var-confirm:hover:not(:disabled) { background: #e8b520; transform: translateY(-1px); }
.diced-var-confirm:disabled { background: #9CA3AF; cursor: default; color: #ffffff; }

@media (max-width: 480px) {
    .diced-var-popup { width: 95vw; }
    .diced-var-footer { flex-direction: column; gap: 10px; }
    .diced-var-confirm { width: 100%; }
}

/* Completion popup animation */
@keyframes dicedPopIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
