/* ==============================================
   Taylor's Family Puppies - Frontend Styles
   ============================================== */

:root {
    --tfp-primary:   #d4a574;
    --tfp-secondary: #8b6f47;
    --tfp-dark:      #2c2c2c;
    --tfp-gray:      #666;
    --tfp-light:     #faf8f5;
    --tfp-border:    #e8e0d8;
    --tfp-radius:    12px;
    --tfp-shadow:    0 4px 20px rgba(0,0,0,0.08);
    --tfp-shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* Hero Section */
.tfp-hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d4c0 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    border-radius: var(--tfp-radius);
    overflow: hidden;
    margin-bottom: 40px;
}
.tfp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(44,35,24,0.65) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px 48px;
}
.tfp-hero-title {
    font-size: clamp(2em, 5vw, 3.2em);
    font-weight: 800;
    color: white;
    margin: 0 0 10px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.tfp-hero-subtitle {
    font-size: clamp(1em, 2vw, 1.2em);
    color: rgba(255,255,255,0.9);
    margin: 0;
    text-shadow: 0 1px 6px rgba(0,0,0,0.2);
}

/* Archive / Grid */
.tfp-archive-wrap { padding: 0 0 60px; }

.tfp-archive-header { text-align: center; padding: 48px 20px 32px; }
.tfp-archive-header h1 { font-size: clamp(1.8em, 4vw, 2.6em); font-weight: 800; color: var(--tfp-dark); margin: 0 0 10px; }
.tfp-archive-header p  { color: var(--tfp-gray); font-size: 1.05em; margin: 0; }

/* Filter bar */
.tfp-filter-bar {
    background: white;
    border: 1px solid var(--tfp-border);
    border-radius: var(--tfp-radius);
    padding: 20px 24px;
    margin: 0 auto 32px;
    max-width: 860px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--tfp-shadow);
}
.tfp-filter-item { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.tfp-filter-item label { font-size: 0.78em; font-weight: 700; color: var(--tfp-gray); text-transform: uppercase; letter-spacing: 0.5px; }
.tfp-filter-item select {
    padding: 9px 14px;
    border: 1px solid var(--tfp-border);
    border-radius: 8px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.tfp-filter-item select:focus { outline: none; border-color: var(--tfp-primary); }
.tfp-filter-btns { display: flex; gap: 8px; }

/* Puppy Grid */
.tfp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Puppy Card */
.tfp-puppy-card {
    background: white;
    border-radius: var(--tfp-radius);
    overflow: hidden;
    box-shadow: var(--tfp-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tfp-border);
}
.tfp-puppy-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--tfp-shadow-lg);
}
.tfp-card-img-wrap {
    position: relative;
    height: 260px;
    background: #faf6f2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfp-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s ease;
}
.tfp-puppy-card:hover .tfp-card-img-wrap img { transform: scale(1.03); }
.tfp-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    opacity: 0.4;
}

/* Status Badge */
.tfp-status-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
.tfp-status-available { background: rgba(39,174,96,0.9); }
.tfp-status-reserved  { background: rgba(243,156,18,0.9); }
.tfp-status-sold      { background: rgba(231,76,60,0.9); }

.tfp-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tfp-card-name {
    font-size: 1.25em;
    font-weight: 800;
    color: var(--tfp-dark);
    letter-spacing: -0.3px;
}
.tfp-card-meta {
    font-size: 0.85em;
    color: var(--tfp-gray);
}
.tfp-card-desc {
    font-size: 0.85em;
    color: #888;
    line-height: 1.5;
    flex: 1;
}
.tfp-card-price {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--tfp-secondary);
    letter-spacing: -0.5px;
}
.tfp-card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Frontend Buttons */
.tfp-btn, .tfp-btn-view, .tfp-btn-reserve {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}
.tfp-btn-view {
    flex: 1;
    background: var(--tfp-light);
    color: var(--tfp-dark);
    border: 1px solid var(--tfp-border);
}
.tfp-btn-view:hover { background: var(--tfp-border); color: var(--tfp-dark); }
.tfp-btn-reserve {
    flex: 1;
    background: var(--tfp-primary);
    color: white;
}
.tfp-btn-reserve:hover { background: var(--tfp-secondary); box-shadow: 0 4px 16px rgba(212,165,116,0.4); color: white; }
.tfp-btn-reserve:disabled, .tfp-btn-reserve.disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* No results */
.tfp-no-results { text-align: center; padding: 60px 20px; color: #bbb; font-size: 1.1em; grid-column: 1/-1; }

/* Single Puppy Page */
.tfp-single-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px 60px; }

/* Full-Width Hero - Single Puppy + Reservation pages */
.tfp-single-hero-fullwidth {
    position: relative;
    width: 100vw;
    min-height: 380px;
    margin-left:  calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 40px;
    background: linear-gradient(135deg, #2c1a0e 0%, #5c3a1e 50%, #8b6f47 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.tfp-single-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.12) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 60px;
    width: 100%;
}
.tfp-single-hero-title {
    font-size: clamp(2em, 5vw, 3.4em);
    font-weight: 800;
    color: white;
    margin: 0 0 10px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.45);
}
.tfp-single-hero-sub {
    color: rgba(255,255,255,0.88);
    margin: 0;
    font-size: 1.1em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

/* Legacy single hero */
.tfp-single-hero {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: var(--tfp-radius);
    overflow: hidden;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f5e6d3, #e8d4c0);
}
.tfp-single-hero img { width: 100%; height: 100%; object-fit: cover; }

/* Single Layout */
.tfp-single-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) { .tfp-single-layout { grid-template-columns: 1fr; } }

/* Main image + gallery */
.tfp-main-image {
    border-radius: var(--tfp-radius);
    overflow: hidden;
    margin-bottom: 14px;
    background: #faf6f2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
.tfp-main-image img {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    object-position: center;
    display: block;
}
.tfp-gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.tfp-gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.tfp-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.tfp-gallery-thumb:hover, .tfp-gallery-thumb.active { border-color: var(--tfp-primary); transform: scale(1.05); }

/* Info Card */
.tfp-info-card {
    background: white;
    border-radius: var(--tfp-radius);
    padding: 24px;
    box-shadow: var(--tfp-shadow);
    border: 1px solid var(--tfp-border);
    position: sticky;
    top: 20px;
}
.tfp-info-card-name {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--tfp-dark);
    margin: 0 0 4px;
}
.tfp-info-card-price {
    font-size: 1.6em;
    font-weight: 800;
    color: var(--tfp-secondary);
    margin: 0 0 16px;
}
.tfp-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.tfp-info-item { display: flex; flex-direction: column; gap: 3px; }
.tfp-info-label { font-size: 0.72em; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; }
.tfp-info-value { font-size: 0.9em; font-weight: 600; color: var(--tfp-dark); }

.tfp-reserve-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--tfp-primary) 0%, var(--tfp-secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.2px;
    margin-bottom: 10px;
}
.tfp-reserve-btn:hover { box-shadow: 0 6px 20px rgba(212,165,116,0.45); transform: translateY(-1px); }
.tfp-reserve-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

.tfp-deposit-note {
    background: #fdf8f3;
    border: 1px solid #f0e0cc;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.8em;
    color: var(--tfp-secondary);
    line-height: 1.5;
    text-align: center;
}

/* Content sections */
.tfp-content-sections { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.tfp-section-card {
    background: white;
    border-radius: var(--tfp-radius);
    padding: 24px 28px;
    box-shadow: var(--tfp-shadow);
    border: 1px solid var(--tfp-border);
}
.tfp-section-card h3 {
    font-size: 1.05em;
    font-weight: 800;
    color: var(--tfp-dark);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tfp-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tfp-section-card p, .tfp-section-card li { font-size: 0.9em; color: var(--tfp-gray); line-height: 1.7; margin: 0 0 6px; }
.tfp-pedigree-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tfp-ped-item { background: var(--tfp-light); border-radius: 8px; padding: 12px; }
.tfp-ped-item .tfp-ped-role { font-size: 0.72em; text-transform: uppercase; font-weight: 700; color: #aaa; letter-spacing: 0.5px; }
.tfp-ped-item .tfp-ped-name { font-weight: 700; color: var(--tfp-dark); margin-top: 4px; }

/* Reservation Form */
.tfp-reservation-wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 80px; }

.tfp-res-header { text-align: center; margin-bottom: 30px; }
.tfp-res-header h1 { font-size: clamp(1.8em, 4vw, 2.4em); font-weight: 800; color: var(--tfp-dark); margin: 0 0 8px; }
.tfp-res-header p { color: var(--tfp-gray); margin: 0; }

/* Puppy summary banner */
.tfp-res-puppy-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    border: 1px solid var(--tfp-border);
    border-radius: var(--tfp-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--tfp-shadow);
}
.tfp-res-puppy-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tfp-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}
.tfp-res-puppy-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.tfp-res-puppy-name { font-size: 1.3em; font-weight: 800; color: var(--tfp-dark); margin: 0 0 4px; }
.tfp-res-puppy-details { font-size: 0.85em; color: var(--tfp-gray); margin: 0 0 6px; }
.tfp-res-price-row { display: flex; gap: 20px; flex-wrap: wrap; }
.tfp-res-price-item { display: flex; flex-direction: column; gap: 2px; }
.tfp-res-price-label { font-size: 0.72em; text-transform: uppercase; font-weight: 700; color: #aaa; letter-spacing: 0.5px; }
.tfp-res-price-value { font-size: 1.1em; font-weight: 800; color: var(--tfp-secondary); }
.tfp-res-price-value.deposit { color: var(--tfp-primary); }

/* Deposit box */
.tfp-deposit-box {
    background: linear-gradient(135deg, #fdf5eb 0%, #fcebd5 100%);
    border: 1px solid #f0d9ba;
    border-radius: var(--tfp-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.tfp-deposit-box .tfp-deposit-label { font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--tfp-secondary); margin-bottom: 6px; }
.tfp-deposit-box .tfp-deposit-amount { font-size: 2.4em; font-weight: 800; color: var(--tfp-secondary); line-height: 1; margin-bottom: 8px; }
.tfp-deposit-box .tfp-deposit-desc { font-size: 0.85em; color: var(--tfp-gray); max-width: 440px; margin: 0 auto; line-height: 1.5; }

/* Form card */
.tfp-res-form-card {
    background: white;
    border-radius: var(--tfp-radius);
    padding: 28px 32px;
    box-shadow: var(--tfp-shadow);
    border: 1px solid var(--tfp-border);
    margin-bottom: 20px;
}
.tfp-res-form-card h3 {
    font-size: 0.95em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tfp-secondary);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tfp-border);
}
.tfp-res-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .tfp-res-form-row { grid-template-columns: 1fr; } }
.tfp-res-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.tfp-res-form-group label { font-size: 0.82em; font-weight: 700; color: var(--tfp-dark); }
.tfp-res-form-group input,
.tfp-res-form-group select,
.tfp-res-form-group textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--tfp-border);
    border-radius: 8px;
    font-size: 0.9em;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
.tfp-res-form-group input:focus,
.tfp-res-form-group select:focus,
.tfp-res-form-group textarea:focus {
    outline: none;
    border-color: var(--tfp-primary);
    box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}
.tfp-res-form-group textarea { resize: vertical; min-height: 100px; }

.tfp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88em;
    color: var(--tfp-dark);
    line-height: 1.5;
}
.tfp-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--tfp-primary); cursor: pointer; }

.tfp-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--tfp-primary) 0%, var(--tfp-secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    letter-spacing: 0.2px;
}
.tfp-submit-btn:hover { box-shadow: 0 6px 24px rgba(212,165,116,0.45); transform: translateY(-1px); }
.tfp-submit-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

.tfp-form-note {
    text-align: center;
    font-size: 0.8em;
    color: #bbb;
    margin-top: 14px;
    line-height: 1.6;
}

/* Success Message */
.tfp-success-msg {
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    border-radius: var(--tfp-radius);
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}
.tfp-success-msg h3 { color: #1e8449; margin: 0 0 8px; font-size: 1.3em; }
.tfp-success-msg p  { color: var(--tfp-gray); margin: 0; font-size: 0.9em; }

/* Responsive */
@media (max-width: 768px) {
    .tfp-hero { min-height: 280px; }
    .tfp-hero-overlay { padding: 24px 24px; }
    .tfp-single-hero { height: 260px; }
    .tfp-filter-bar { flex-direction: column; align-items: stretch; }
    .tfp-filter-btns { justify-content: stretch; }
    .tfp-filter-btns .tfp-btn { flex: 1; }
    .tfp-res-puppy-banner { flex-direction: column; text-align: center; }
    .tfp-res-price-row { justify-content: center; }
    .tfp-res-form-card { padding: 20px; }
}

/* Loading spinner */
.tfp-grid-loading { text-align: center; padding: 40px; grid-column: 1/-1; }
.tfp-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--tfp-border);
    border-top-color: var(--tfp-primary);
    border-radius: 50%;
    animation: tfp-spin 0.7s linear infinite;
}
@keyframes tfp-spin { to { transform: rotate(360deg); } }
