/**
 * Frontend Styles – Cake Topper Manager
 * Matches the Lavender Dots Design reference exactly.
 */

/* ─── Outer wrapper – full page width, no max-width constraint ─── */
.ctm-form-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 30px 0;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

/* ─── Inner container – provides left/right padding only ─── */
.ctm-form-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    box-sizing: border-box;
    padding: 0;
}

/* ─── Brand Header ─── */
.ctm-brand-header {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 20px;
}

.ctm-brand-tagline {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin: 2px 0;
}

/* ─── Full-bleed purple title bar ─── */
.ctm-form-title {
    background: #B8A7C9;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 12px 20px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Description line ─── */
.ctm-form-description {
    text-align: center;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    padding: 12px 20px 0;
    margin: 0;
}

.ctm-delivery-note {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    padding: 4px 20px 0;
    margin: 0 0 18px 0;
}

/* ─── Store Number – flush left, inside padded content area ─── */
.ctm-store-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.ctm-store-label-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctm-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ctm-store-input {
    width: 200px;
    padding: 4px 8px;
    font-size: 18px;
    border: 2px solid #000;
    border-radius: 0;
    box-sizing: border-box;
}

.ctm-store-input:focus {
    outline: none;
    border-color: #B8A7C9;
}

/* ─── Category sections ─── */
.ctm-category-section {
    margin-bottom: 30px;
}

/* Full-width purple section header */
.ctm-category-title {
    background: #B8A7C9;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 10px 20px;
    margin: 0 auto 20px auto;
    width: 100%;
	max-width: 60%;
    box-sizing: border-box;
}

/* Plain-text sub-heading (used for "Cupcake – Numbers(Wood)") */
.ctm-category-title-plain {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 0 20px;
    margin: 0 0 16px 0;
}

/* ─── Items grid – content area with side padding ─── */
.ctm-items-grid {
    padding: 0 20px;
    display: grid;
    gap: 20px 10px;
    box-sizing: border-box;
}

/* Fixed column counts per category */
.ctm-category-section[data-category="cake"] .ctm-items-grid {
    grid-template-columns: repeat(4, 1fr);
}

.ctm-category-section[data-category="cupcake"] .ctm-items-grid {
    grid-template-columns: repeat(5, 1fr);
}

.ctm-category-section[data-category="number"] .ctm-items-grid {
    grid-template-columns: repeat(10, 1fr);
}

/* ─── Single item card ─── */
.ctm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Item name – above image */
.ctm-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin: 0 0 6px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Item image */
.ctm-item-image {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

/* Cake toppers - larger images */
.ctm-category-section[data-category="cake"] .ctm-item-image {
    height: 200px;
}

/* Cupcake toppers - medium */
.ctm-category-section[data-category="cupcake"] .ctm-item-image {
    height: 140px;
}

/* Numbers - smaller images */
.ctm-category-section[data-category="number"] .ctm-item-image {
    height: 100px;
}

.ctm-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ─── Quantity control ─── */
.ctm-quantity-control {
    text-align: center;
}

.ctm-quantity-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.ctm-quantity-input-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid #333;
}

.ctm-qty-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.ctm-qty-btn:hover {
    background: #f0f0f0;
}

.ctm-quantity-input {
    width: 28px;
    height: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    padding: 0;
    background: #fff;
}

.ctm-quantity-input:focus {
    outline: none;
}

/* hide native spinners */
.ctm-quantity-input::-webkit-inner-spin-button,
.ctm-quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.ctm-quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* ─── Order summary – hidden ─── */
.ctm-order-summary {
    display: none;
}

/* ─── CUSTOM CAKE TOPPER section ─── */
.ctm-custom-section {
    margin-top: 10px;
    margin-bottom: 30px;
}

/* ─── Submit button ─── */
.ctm-form-actions {
    text-align: center;
    padding: 20px 0 30px;
}

.ctm-submit-btn {
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 7px 36px;
    border: 2px solid #c0392b;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ctm-submit-btn:hover {
    background: #c0392b;
    color: #fff;
}

.ctm-submit-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* loading state */
.ctm-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ctm-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #333;
    border-radius: 50%;
    animation: ctm-spin 0.7s linear infinite;
}

@keyframes ctm-spin {
    to { transform: rotate(360deg); }
}

/* ─── Messages ─── */
.ctm-form-messages {
    margin: 16px 20px 0;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 14px;
}

.ctm-form-messages.ctm-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ctm-form-messages.ctm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ─── No-items fallback ─── */
.ctm-no-items-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

/* Tablet – numbers row wraps to 5 */
@media (max-width: 900px) {
    .ctm-category-section[data-category="number"] .ctm-items-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Small tablet */
@media (max-width: 680px) {
    .ctm-category-section[data-category="cake"] .ctm-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ctm-category-section[data-category="cupcake"] .ctm-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ctm-category-section[data-category="number"] .ctm-items-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .ctm-item-image {
        height: 80px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .ctm-items-grid {
        padding: 0 10px;
        gap: 14px 6px;
    }
    .ctm-category-section[data-category="cake"] .ctm-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ctm-category-section[data-category="cupcake"] .ctm-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ctm-category-section[data-category="number"] .ctm-items-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .ctm-item-name {
        font-size: 10px;
        min-height: 24px;
    }
    .ctm-item-image {
        height: 60px;
    }
    .ctm-category-section[data-category="number"] .ctm-item-image {
        height: 50px;
    }
    .ctm-qty-btn {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
    .ctm-quantity-input {
        width: 22px;
        height: 18px;
        font-size: 11px;
    }
    .ctm-store-label-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .ctm-store-input {
        width: 100%;
    }
    .ctm-form-title {
        font-size: 14px;
        letter-spacing: 2px;
    }
}

/* Print */
@media print {
    .ctm-submit-btn, .ctm-qty-btn { display: none; }
}

/* ═══════════════════════════════════════
   CUSTOM CAKE TOPPER ORDERS SECTION
   ═══════════════════════════════════════ */

.ctm-custom-orders-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

.ctm-custom-delivery-note {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    line-height: 1.5;
    padding: 12px 20px 4px;
    margin: 0;
}

.ctm-custom-subheader {
    max-width: 60%;
    margin: 16px auto 20px auto;
    width: 100%;
}

/* Grid container: single image on left, form on right */
.ctm-custom-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 0 20px;
    margin-bottom: 20px;
}

/* Left: Single full reference image */
.ctm-custom-single-image {
    width: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ctm-custom-reference-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 600px;
}

.ctm-custom-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    border: 2px solid #ddd;
}

.ctm-custom-placeholder p {
    margin: 8px 0;
}

/* Right: Form fields stacked */
.ctm-custom-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ctm-custom-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ctm-custom-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.ctm-custom-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 2px solid #000;
    border-radius: 0;
    box-sizing: border-box;
    min-height: 36px;
}
#custom_design{
	max-width:25%;
}
#custom_color{
	max-width:50%;
}
#custom_personalization{
	max-width:75%;
}

.ctm-custom-input:focus {
    outline: none;
    border-color: #B8A7C9;
}

/* Submit button spacing */
.ctm-form-actions-first {
    margin-top: 30px;
    padding: 10px 0 20px;
}

.ctm-form-actions-final {
    margin-top: 20px;
    padding: 20px 0 30px;
}

/* Responsive for custom section */
@media (max-width: 680px) {
    .ctm-custom-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ctm-custom-single-image {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ctm-custom-single-image {
        min-height: 200px;
    }
    
    .ctm-custom-field label {
        font-size: 10px;
    }
    
    .ctm-custom-input {
        font-size: 12px;
        padding: 6px 8px;
        min-height: 32px;
    }
    
    .ctm-form-title {
        font-size: 14px;
        letter-spacing: 1.5px;
    }
    
    .ctm-category-title {
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════
   SUCCESS POPUP
   ═══════════════════════════════════════ */

.ctm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ctm-popup-content {
    background: #fff;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 40px 30px 30px;
}

.ctm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.ctm-popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

.ctm-popup-content h2 {
    margin: 0 0 20px;
    color: #2C5F2D;
    font-size: 24px;
    text-align: center;
}

.ctm-popup-content h3 {
    margin: 20px 0 10px;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #B8A7C9;
    padding-bottom: 8px;
}

.ctm-popup-order-details {
    margin-bottom: 20px;
}

.ctm-popup-order-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.ctm-popup-order-details strong {
    color: #333;
    font-weight: 600;
}

.ctm-popup-items {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
}

.ctm-popup-items tr {
    border-bottom: 1px solid #eee;
}

.ctm-popup-items td {
    padding: 10px 8px;
    font-size: 14px;
}

.ctm-popup-items td:first-child {
    color: #333;
}

.ctm-popup-items td:last-child {
    text-align: right;
    font-weight: 600;
    color: #B8A7C9;
}

.ctm-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ctm-popup-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.ctm-popup-close-btn {
    background: #f0f0f0;
    color: #333;
}

.ctm-popup-close-btn:hover {
    background: #e0e0e0;
}

.ctm-popup-login-btn,
.ctm-popup-account-btn {
    background: #B8A7C9;
    color: #fff;
	display:none;
}

.ctm-popup-login-btn:hover,
.ctm-popup-account-btn:hover {
    background: #9F8DB5;
}

@media (max-width: 480px) {
    .ctm-popup-content {
        padding: 30px 20px 20px;
    }
    
    .ctm-popup-content h2 {
        font-size: 20px;
    }
    
    .ctm-popup-actions {
        flex-direction: column;
    }
    
    .ctm-popup-btn {
        width: 100%;
    }
}