/* =========================================================
IMPORT FONTS
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600;700&family=Cinzel:wght@400;600;700&display=swap');

/* =========================================================
GLOBAL
========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: #f5f0e4;
    font-family: 'EB Garamond', Georgia, serif;
    color: #2a1a0e;
    margin: 0;
}

/* =========================================================
CONTAINER
========================================================= */

.d-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
}

/* =========================================================
HEADER / TITLE
========================================================= */

.d-header {
    text-align: center;
    margin-bottom: 30px;
}

.d-header h1 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #5a0e0e;
    margin: 0 0 30px 0;
    text-transform: uppercase;
}

/* =========================================================
PROGRESS BAR
========================================================= */

.d-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
    gap: 0;
}

.d-progress-step {
    background: transparent;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 10px;
    font-family: 'Cinzel', serif;
    color: #aaa;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-width: 120px;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    line-height: 1.2;
}

.d-progress-step span {
    display: block;
    font-size: 12px;
    font-family: 'EB Garamond', serif;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 5px;
    font-weight: 600;
    color: #aaa;
}

.d-progress-step.active {
    background: #fff;
    border-color: #d4c5a9;
    color: #7d0000;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.d-progress-step.active span {
    color: #2a1a0e;
}

.d-progress-step.done {
    color: #7d0000;
}

.d-progress-step.done span {
    color: #7d0000;
}

.d-progress-arrow {
    color: #ccc;
    font-size: 14px;
    padding: 0 2px;
    flex-shrink: 0;
}

/* =========================================================
LAYOUT
========================================================= */

.d-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.d-main {
    flex: 1.4;
    min-width: 0;
}

/* =========================================================
STEP VISIBILITY
========================================================= */

.d-step {
    display: none;
}

.d-step.active {
    display: block;
}

/* =========================================================
SECTION TITLE
========================================================= */

.d-section-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    color: #2a1a0e;
    letter-spacing: 1px;
    margin: 0 0 16px 0;
    text-transform: uppercase;
}

/* =========================================================
EVENT OPTIONS (STEP 1)
========================================================= */

.d-option {
    background: #fff;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.d-option:hover {
    border-color: #c0392b;
    box-shadow: 0 3px 12px rgba(122,0,0,0.1);
}

.d-option.selected {
    border-color: #c0392b;
    background: #fff8f8;
}

.d-option-thumb {
    flex-shrink: 0;
    width: 76px;
    height: 76px;
}

.d-option-thumb img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.d-option-content {
    flex: 1;
    min-width: 0;
}

.d-option-label {
    font-size: 16px;
    font-weight: 700;
    color: #2a1a0e;
    margin-bottom: 3px;
    font-family: 'EB Garamond', serif;
}

.d-option-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    font-family: 'EB Garamond', serif;
}

.d-option-sublabel {
    font-size: 13px;
    color: #888;
    margin-top: 3px;
}

.d-option-select-btn {
    flex-shrink: 0;
    background: #7d0000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.d-option.selected .d-option-select-btn {
    background: #3d7a3d;
}

/* =========================================================
TEXT MODE OPTIONS (STEP 2)
========================================================= */

.d-text-options {
    display: flex;
    gap: 14px;
    margin-bottom: 0;
}

.d-text-area-content {
    margin-top: 20px;
}

.d-text-mode {
    flex: 1;
    border-radius: 40px !important;
    padding: 16px 28px !important;
    justify-content: space-between !important;
    margin-bottom: 0 !important;
    gap: 8px !important;
    box-shadow: none !important;
    border: 2px solid #c7a0a0 !important;
    background: #b89090 !important;
    color: #f6deb7;
    transition: all 0.2s ease;
}

.d-text-mode .d-option-label {
    color: #f6deb7 !important;
    font-size: 40px;
    font-weight: 600;
}

.d-text-mode.selected {
    background: #7d0000 !important;
    border-color: #7d0000 !important;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.12);
}

.d-text-mode:hover {
    filter: brightness(0.98);
}

.d-text-arrow {
    opacity: 0.9;
}

.d-option-arrow,
.d-text-arrow,
.d-continue-arrow {
    display: inline-flex;
    align-items: center;
}

.d-option-arrow img,
.d-continue-arrow img {
    width: 16px;
    height: 16px;
    display: block;
}

.d-text-arrow img {
    width: 24px;
    height: 24px;
    display: block;
}

/* Textarea card */
.d-textarea-card {
    background: #f5f0e4;
    border: 9px solid #7d0000;
    border-radius: 24px;
    padding: 22px 24px;
    margin-top: 16px;
    position: relative;
}

.d-textarea-card label {
    display: block;
    font-size: 40px;
    font-weight: 500;
    color: #5a0e0e;
    margin-bottom: 12px;
    letter-spacing: 0;
    text-transform: none;
    font-family: 'EB Garamond', serif;
}

.d-textarea-card textarea {
    width: 100%;
    min-height: 520px;
    padding: 0;
    border: none;
    outline: none;
    font-size: 38px;
    font-family: 'EB Garamond', serif;
    color: #2a1a0e;
    resize: none;
    background: #f5f0e4;
    line-height: 1.45;
}

.d-textarea-card textarea::placeholder {
    color: #c29d9d;
    font-style: normal;
}

.d-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 2px;
    border-top: none;
    font-size: 24px;
    color: #7d0000;
    font-family: 'EB Garamond', serif;
}

#d-save-time {
    color: #2f8a31;
}

/* Info box for "write for me" */
.d-info-box {
    background: #f5f0e4;
    border-radius: 14px;
    padding: 22px;
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin-top: 16px;
    border: 1px solid #ddd;
}

.d-write-intro {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #5a0e0e;
    margin: 18px 0;
    line-height: 1.2;
}

.d-write-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.d-write-card {
    background: #7d0000;
    border: 1px solid #6a0000;
    border-radius: 22px;
    padding: 16px 16px 12px;
}

.d-write-card label {
    display: block;
    color: #fff;
    font-family: 'EB Garamond', serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.d-required {
    color: #f2cf98;
}

.d-write-field {
    width: 100%;
    min-height: 136px;
    border: none;
    border-radius: 18px;
    background: #f5f0e4;
    padding: 18px 22px;
    color: #2a1a0e;
    font-family: 'EB Garamond', serif;
    font-size: 20px;
    line-height: 1.2;
    resize: vertical;
}

.d-write-field::placeholder {
    color: #b9908c;
}

.d-write-field:focus {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 0;
}

.d-write-card .d-textarea-footer {
    border-top: none;
    margin-top: 8px;
    padding-top: 0;
    font-size: 14px;
    color: #f6d7d7;
}

.d-write-save-time {
    color: #8fd46f;
}

/* =========================================================
GIFTS (STEP 3)
========================================================= */

.d-gifts-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    color: #2a1a0e;
    letter-spacing: 1px;
    margin: 0 0 16px 0;
    text-transform: uppercase;
}

.d-gift {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.d-gift:hover {
    border-color: #c0392b;
    box-shadow: 0 3px 12px rgba(122,0,0,0.1);
}

.d-gift.selected {
    border-color: #3d7a3d;
    background: #f4faf4;
}

.d-gift-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: #2a2a2a;
}

.d-gift-thumb-open {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.d-gift-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.d-gift-thumb-overlay {
    position: absolute;
    right: 8px;
    bottom: 8px;
    color: #fff;
    font-size: 12px;
    font-family: 'EB Garamond', serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.65);
}

.d-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.d-image-lightbox.is-open {
    display: flex;
}

.d-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.d-image-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 980px);
    max-height: 90vh;
}

.d-image-lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 14px;
}

.d-image-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #2a1a0e;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

body.d-lightbox-open {
    overflow: hidden;
}

.d-gift-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #2a1a0e;
    font-family: 'EB Garamond', serif;
}

.d-gift-price-btn {
    flex-shrink: 0;
    background: #7d0000;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: 0.2s;
}

.d-gift.selected .d-gift-price-btn {
    background: #3d7a3d;
}

.d-gift-free-btn {
    flex-shrink: 0;
    background: #3d7a3d;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
INPUT FIELDS
========================================================= */

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 13px 18px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1.5px solid #d4c5a9;
    font-size: 15px;
    font-family: 'EB Garamond', serif;
    background: #fff;
    color: #2a1a0e;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: #7d0000;
}

/* =========================================================
NAV BUTTONS
========================================================= */

.d-nav {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

button,
.button.alt {
    background: #7d0000;
    color: #ffffff;
    padding: 13px 30px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-family: 'EB Garamond', serif;
    transition: 0.2s ease;
}

button:hover,
.button.alt:hover {
    opacity: 0.88;
}

button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.d-prev {
    background: #b8a89a;
    padding: 13px 26px;
}

/* Full-width continue button */
.d-continue-btn {
    display: flex;
    width: 100%;
    background: #7d0000;
    color: #fff;
    padding: 16px 24px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-family: 'EB Garamond', serif;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    transition: 0.2s;
}

.d-continue-btn:hover {
    opacity: 0.88;
}

/* =========================================================
SIDEBAR
========================================================= */

.d-sidebar {
    flex: 0 0 330px;
    max-width: 330px;
    position: sticky;
    top: 80px;
}

/* Product card */
.d-sidebar-card {
    background: #fff;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: relative;
}

.d-handmade-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.d-letter-preview {
    height: 130px;
    overflow: hidden;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.d-letter-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.d-sidebar-product-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: #2a1a0e;
    margin: 0 0 6px 0;
}

.d-sidebar-stars {
    color: #c0392b;
    font-size: 14px;
    margin-bottom: 14px;
    letter-spacing: 2px;
}

.d-sidebar-stars span {
    color: #888;
    font-size: 12px;
    letter-spacing: 0;
    margin-left: 4px;
    font-family: 'EB Garamond', serif;
}

.d-sidebar-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 12px 0;
}

.d-sidebar-contents-title {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    color: #2a1a0e;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.d-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-family: 'EB Garamond', serif;
}

.d-sidebar-check {
    color: #5a9a5a;
    font-size: 17px;
    flex-shrink: 0;
}

.d-sidebar-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid #eee;
}

.d-sidebar-price-label {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    color: #2a1a0e;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.d-sidebar-price-value {
    font-family: 'Cinzel', serif;
    font-size: 26px;
    font-weight: 700;
    color: #2a1a0e;
}

/* Gift upsell card */
.d-sidebar-gift-card {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.d-sidebar-selected-gift {
    position: relative;
}

.d-sidebar-gift-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #a78a8a;
    background: #f4ece4;
    color: #5a0e0e;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.d-sidebar-gift-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.d-sidebar-gift-img {
    width: 72px;
    height: 66px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}

.d-sidebar-gift-info {
    flex: 1;
    min-width: 0;
}

.d-sidebar-gift-name {
    font-size: 13px;
    font-weight: 700;
    color: #2a1a0e;
    margin-bottom: 4px;
    font-family: 'EB Garamond', serif;
}

.d-sidebar-gift-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    font-family: 'EB Garamond', serif;
}

.d-sidebar-gift-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.d-sidebar-gift-price-label {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2a1a0e;
}

.d-sidebar-gift-price-value {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: #2a1a0e;
}

.d-sidebar-gift-free-btn {
    background: #3d7a3d;
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Overall total below cards */
.d-sidebar-total-block {
    text-align: right;
    margin-bottom: 14px;
}

.d-sidebar-total-excl {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 4px;
}

.d-sidebar-total-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.d-total-label {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #2a1a0e;
    text-transform: uppercase;
}

.d-total-value {
    font-family: 'Cinzel', serif;
    font-size: 34px;
    font-weight: 700;
    color: #2a1a0e;
}

/* =========================================================
WOOCOMMERCE CLEANUP
========================================================= */

.woocommerce-checkout-payment { margin-top: 20px; }
.wc_payment_methods { list-style: none; padding: 0; margin: 0; }
.wc_payment_methods li {
    background: #fff;
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1.5px solid #d4c5a9;
}
.payment_box { margin-top: 10px; }
.woocommerce-NoticeGroup { margin-bottom: 20px; }

/* =========================================================
ERROR
========================================================= */

.d-error { border: 2px solid #c0392b !important; }

/* =========================================================
RESPONSIVE
========================================================= */

@media (max-width: 992px) {
    .d-layout { flex-direction: column; }
    .d-sidebar { position: relative; top: auto; flex: 1 1 auto; max-width: 100%; }
    .d-progress { flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
    .d-progress-step { min-width: 90px; }
    .d-text-options { flex-direction: column; }
    .d-header h1 { font-size: 28px; letter-spacing: 3px; }
    .d-text-mode .d-option-label { font-size: 26px; }
    .d-text-arrow img { width: 20px; height: 20px; }
    .d-textarea-card label { font-size: 26px; }
    .d-textarea-card textarea { min-height: 300px; font-size: 22px; }
    .d-textarea-footer { font-size: 15px; }
    .d-write-intro { font-size: 22px; }
    .d-write-card label { font-size: 18px; }
    .d-write-field { font-size: 18px; }
    .d-write-card .d-textarea-footer { font-size: 13px; }
}
