/* ==========================================================================
   Sangjo-Bugo Theme - Wreath Product Detail Page
   Funeral wreath product detail with order form
   ========================================================================== */

/* ==========================================================================
   1. Page Layout
   ========================================================================== */
.wreath-detail-page {
    padding-top: 2rem;
    padding-bottom: 3.75rem;
}

/* ==========================================================================
   2. Breadcrumb
   ========================================================================== */
.wreath-detail-breadcrumb {
    padding: 0.75rem 0;
    font-size: 0.8125rem;
    color: var(--color-gray-500);
}

.wreath-detail-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wreath-detail-breadcrumb li {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.wreath-detail-breadcrumb li + li::before {
    content: '/';
    display: inline-block;
    margin: 0 0.5rem;
    color: var(--color-gray-300);
    font-size: 0.75rem;
}

.wreath-detail-breadcrumb a {
    color: var(--color-gray-500);
    transition: color 0.2s ease;
}

.wreath-detail-breadcrumb a:hover {
    color: var(--color-gray-900);
}

.wreath-detail-breadcrumb .current {
    color: var(--color-gray-900);
    font-weight: 500;
}

/* ==========================================================================
   3. Detail Grid (2-column layout)
   ========================================================================== */
.wreath-detail-grid {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: 2.5rem;
    align-items: flex-start;
    margin-bottom: 3.75rem;
}

/* ==========================================================================
   4. Image Section
   ========================================================================== */
.wreath-detail-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--color-gray-100);
}

.wreath-detail-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.wreath-detail-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 4rem;
    color: var(--color-gray-300);
    background-color: var(--color-gray-100);
}

/* ==========================================================================
   5. Info Section
   ========================================================================== */
.wreath-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Category Badge */
.wreath-detail-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-accent);
    background-color: rgba(139, 115, 85, 0.08);
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

/* Product Name */
.wreath-detail-name {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1.35;
    margin-bottom: 1rem;
    word-break: keep-all;
}

/* Price */
.wreath-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.wreath-detail-price .currency {
    font-size: 1rem;
    font-weight: 500;
    margin-left: 0.125rem;
}

/* Description */
.wreath-detail-desc {
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--color-gray-700);
    line-height: 1.8;
    word-break: keep-all;
}

/* Product Meta (specs, delivery info, etc.) */
.wreath-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.wreath-detail-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.wreath-detail-meta-label {
    flex-shrink: 0;
    width: 5rem;
    color: var(--color-gray-500);
    font-weight: 500;
}

.wreath-detail-meta-value {
    color: var(--color-gray-900);
    line-height: 1.5;
}

/* ==========================================================================
   6. Order Form
   ========================================================================== */
.wreath-detail-order {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.wreath-detail-order-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--color-border);
}

.wreath-detail-order-title i {
    color: var(--color-accent);
    font-size: 1rem;
}

/* Self-contained form element fallbacks */
.wreath-detail-order .wreath-detail-form-group {
    margin-bottom: 1.125rem;
}

.wreath-detail-order .wreath-detail-form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.wreath-detail-order .wreath-detail-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-gray-900);
}

.wreath-detail-order .wreath-detail-form-label .required {
    color: #e74c3c;
    margin-left: 0.25rem;
}

.wreath-detail-order .wreath-detail-form-input,
.wreath-detail-order .wreath-detail-form-select,
.wreath-detail-order .wreath-detail-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--color-gray-900);
    background-color: var(--color-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.wreath-detail-order .wreath-detail-form-input:focus,
.wreath-detail-order .wreath-detail-form-select:focus,
.wreath-detail-order .wreath-detail-form-textarea:focus {
    border-color: var(--color-gray-900);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.08);
}

.wreath-detail-order .wreath-detail-form-input::placeholder,
.wreath-detail-order .wreath-detail-form-textarea::placeholder {
    color: var(--color-gray-300);
}

.wreath-detail-order .wreath-detail-form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.wreath-detail-order .wreath-detail-form-textarea {
    min-height: 5rem;
    resize: vertical;
    line-height: 1.6;
}

.wreath-detail-order .wreath-detail-form-hint {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.wreath-detail-order .wreath-detail-form-row {
    display: flex;
    gap: 0.75rem;
}

.wreath-detail-order .wreath-detail-form-row .wreath-detail-form-group {
    flex: 1;
}

/* Order Summary inside form */
.wreath-detail-order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background-color: var(--color-gray-100);
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.wreath-detail-order-product {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-gray-700);
}

.wreath-detail-order-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-accent);
}

/* Submit Button */
.wreath-detail-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.0625rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--color-white);
    background-color: var(--color-accent);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.3px;
}

.wreath-detail-submit-btn:hover {
    background-color: #7a6549;
}

.wreath-detail-submit-btn:active {
    transform: scale(0.98);
}

.wreath-detail-submit-btn:disabled {
    background-color: var(--color-gray-300);
    cursor: not-allowed;
}

.wreath-detail-submit-btn i {
    font-size: 0.9375rem;
}

/* ==========================================================================
   7. Obituary Link Section
   ========================================================================== */
.wreath-detail-obituary-link {
    background-color: var(--color-gray-100);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* Obituary link header */
.wreath-detail-obituary-link-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.75rem;
}

.wreath-detail-obituary-link-header i {
    color: var(--color-accent);
    font-size: 0.875rem;
}

.wreath-detail-obituary-link-header span {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--color-gray-500);
}

/* Obituary link form */
.wreath-detail-obituary-link-form {
    display: flex;
    gap: 0.5rem;
}

.wreath-detail-obituary-link-form input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--color-gray-900);
    background-color: var(--color-white);
    transition: border-color 0.2s ease;
}

.wreath-detail-obituary-link-form input:focus {
    border-color: var(--color-gray-900);
    outline: none;
}

.wreath-detail-obituary-link-form input::placeholder {
    color: var(--color-gray-300);
}

/* Link button */
.wreath-detail-link-btn {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--color-white);
    background-color: var(--color-gray-900);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wreath-detail-link-btn:hover {
    background-color: var(--color-dark);
}

/* Connected obituary info display */
.wreath-detail-obituary-connected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-gray-100);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.wreath-detail-obituary-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wreath-detail-obituary-icon i {
    color: #4CAF50;
    font-size: 0.875rem;
}

.wreath-detail-obituary-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wreath-detail-obituary-text strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.wreath-detail-obituary-text span {
    font-size: 0.8125rem;
    color: var(--color-gray-500);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.wreath-detail-obituary-text span i {
    font-size: 0.75rem;
    color: var(--color-gray-400, #999);
}

/* Delivery info (when obituary is linked) */
.wreath-detail-delivery-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-gray-100);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-gray-700);
}

.wreath-detail-delivery-info i {
    color: var(--color-gray-500);
    font-size: 0.875rem;
}

/* ==========================================================================
   8. Order Notice
   ========================================================================== */
.wreath-detail-notice {
    background-color: var(--color-gray-100);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.wreath-detail-notice h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wreath-detail-notice h4 i {
    color: var(--color-accent);
}

.wreath-detail-notice ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wreath-detail-notice ul li {
    position: relative;
    padding-left: 1rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
    color: var(--color-gray-700);
    line-height: 1.6;
}

.wreath-detail-notice ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--color-gray-300);
}

/* ==========================================================================
   9. Related Products
   ========================================================================== */
.wreath-detail-related {
    margin-bottom: 2.5rem;
}

.wreath-detail-related-title {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.5px;
}

.wreath-detail-related-title .sub-text {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-gray-500);
    margin-top: 0.375rem;
    letter-spacing: 0;
}

.wreath-detail-related-divider {
    width: 32px;
    height: 2px;
    background-color: var(--color-accent);
    margin: 0 auto 2rem;
}

.wreath-detail-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* Reuse wreath-product-card from style-wreath.css for the actual cards.
   These are additional overrides for the related section context only. */
.wreath-detail-related-grid .wreath-product-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wreath-detail-related-grid .wreath-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Standalone related card (if not using wreath-product-card) */
.wreath-detail-related-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.wreath-detail-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.wreath-detail-related-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: var(--color-gray-100);
}

.wreath-detail-related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wreath-detail-related-card:hover .wreath-detail-related-card-thumb img {
    transform: scale(1.05);
}

.wreath-detail-related-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-gray-300);
}

.wreath-detail-related-card-body {
    padding: 1rem;
    flex: 1;
}

.wreath-detail-related-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wreath-detail-related-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

/* ==========================================================================
   10. Back to List Link
   ========================================================================== */
.wreath-detail-back {
    text-align: center;
    margin-bottom: 2rem;
}

.wreath-detail-back .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-700);
    background-color: var(--color-white);
    text-decoration: none;
    transition: all 0.2s ease;
}

.wreath-detail-back .btn:hover {
    border-color: var(--color-gray-300);
    background-color: var(--color-gray-100);
    color: var(--color-gray-900);
}

.wreath-detail-back .btn i {
    font-size: 0.75rem;
}

/* ==========================================================================
   11. Responsive - Tablet Portrait (768px ~ 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .wreath-detail-grid {
        grid-template-columns: 50% 1fr;
        gap: 1.75rem;
    }

    .wreath-detail-name {
        font-size: 1.5rem;
    }

    .wreath-detail-price {
        font-size: 1.375rem;
    }

    .wreath-detail-related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* ==========================================================================
   12. Responsive - Mobile (360px ~ 767px)
   ========================================================================== */
@media (max-width: 767px) {
    .wreath-detail-page {
        padding-top: 1.25rem;
        padding-bottom: 2.5rem;
    }

    .wreath-detail-breadcrumb {
        margin-bottom: 1.25rem;
        font-size: 0.75rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack to single column */
    .wreath-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .wreath-detail-image {
        border-radius: 10px;
    }

    .wreath-detail-name {
        font-size: 1.375rem;
    }

    .wreath-detail-price {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .wreath-detail-desc {
        padding: 1.25rem 0;
        margin-bottom: 1.25rem;
        font-size: 0.875rem;
    }

    .wreath-detail-meta-label {
        width: 4.5rem;
    }

    .wreath-detail-order {
        padding: 1.25rem;
    }

    .wreath-detail-order-title {
        font-size: 1rem;
    }

    .wreath-detail-order .wreath-detail-form-row {
        flex-direction: column;
        gap: 0;
    }

    .wreath-detail-submit-btn {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .wreath-detail-obituary-link {
        padding: 1rem 1.25rem;
    }

    .wreath-detail-notice {
        padding: 1.25rem;
    }

    .wreath-detail-related-title {
        font-size: 1.25rem;
    }

    .wreath-detail-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .wreath-detail-related-card-name {
        font-size: 0.8125rem;
    }

    .wreath-detail-related-card-price {
        font-size: 0.9375rem;
    }
}

/* ==========================================================================
   13. Responsive - Fold/Flip (~359px)
   ========================================================================== */
@media (max-width: 359px) {
    .wreath-detail-page {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .wreath-detail-breadcrumb {
        font-size: 0.6875rem;
    }

    .wreath-detail-name {
        font-size: 1.25rem;
    }

    .wreath-detail-price {
        font-size: 1.125rem;
    }

    .wreath-detail-order {
        padding: 1rem;
        border-radius: 10px;
    }

    .wreath-detail-order-title {
        font-size: 0.9375rem;
    }

    .wreath-detail-submit-btn {
        font-size: 0.9375rem;
    }

    .wreath-detail-related-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .wreath-detail-obituary-link {
        padding: 1rem;
    }

    .wreath-detail-obituary-link-form {
        flex-direction: column;
    }

    .wreath-detail-notice {
        padding: 1rem;
    }
}

/* ==========================================================================
   14. Responsive - Desktop (1024px ~ 1279px)
   ========================================================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .wreath-detail-grid {
        gap: 2rem;
    }
}

/* ==========================================================================
   15. Responsive - FHD (1920px ~ 2559px)
   ========================================================================== */
@media (min-width: 1920px) and (max-width: 2559px) {
    .wreath-detail-name {
        font-size: 2rem;
    }

    .wreath-detail-price {
        font-size: 1.625rem;
    }

    .wreath-detail-related-grid {
        gap: 1.5rem;
    }
}

/* ==========================================================================
   16. Responsive - QHD (2560px ~ 3839px)
   ========================================================================== */
@media (min-width: 2560px) and (max-width: 3839px) {
    .wreath-detail-name {
        font-size: 2.25rem;
    }

    .wreath-detail-price {
        font-size: 1.75rem;
    }

    .wreath-detail-image {
        border-radius: 16px;
    }

    .wreath-detail-order {
        padding: 2rem;
        border-radius: 16px;
    }

    .wreath-detail-related-grid {
        gap: 1.75rem;
    }
}

/* ==========================================================================
   17. Responsive - UHD (3840px+)
   ========================================================================== */
@media (min-width: 3840px) {
    .wreath-detail-name {
        font-size: 2.5rem;
    }

    .wreath-detail-price {
        font-size: 2rem;
    }

    .wreath-detail-image {
        border-radius: 20px;
    }

    .wreath-detail-order {
        padding: 2.5rem;
        border-radius: 20px;
    }

    .wreath-detail-related-grid {
        gap: 2rem;
    }
}

/* ==========================================================================
   18. Print Styles
   ========================================================================== */
@media print {
    .wreath-detail-page {
        padding: 0;
    }

    .wreath-detail-grid {
        grid-template-columns: 40% 1fr;
        gap: 1.5rem;
    }

    .wreath-detail-order,
    .wreath-detail-obituary-link,
    .wreath-detail-submit-btn,
    .wreath-detail-back {
        display: none !important;
    }

    .wreath-detail-image {
        border-radius: 0;
        border: 1px solid #ccc;
    }

    .wreath-detail-related {
        page-break-before: always;
    }

    .wreath-detail-related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .wreath-detail-related-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ==========================================================================
   19. Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .wreath-detail-submit-btn,
    .wreath-detail-related-card,
    .wreath-detail-related-card-thumb img,
    .wreath-shop-grid .wreath-shop-card {
        transition: none;
    }
}
